Recherche avancée

Médias (91)

Autres articles (98)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

  • Problèmes fréquents

    10 mars 2010, par

    PHP et safe_mode activé
    Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
    La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site

Sur d’autres sites (7053)

  • c++, FFMPEG, H264, creating zero-delay stream

    5 février 2015, par Mat

    I’m trying to encode video (using h264 codec at the moment, but other codecs would be fine too if better suited for my needs) such that the data needed for decoding is available directly after a frame (including the first frame) was encoded (so, i want only I and P frames, no B frames).

    How do I need to setup the AVCodecContext to get such a stream ? So far my testing arround with the values still always resulted in avcodec_encode_video() returning 0 on the first frame.

    //edit : this is currently my setup code of the AVCodecContext :

    static AVStream* add_video_stream(AVFormatContext *oc, enum CodecID codec_id, int w, int h, int fps)
    {
       AVCodecContext *c;
       AVStream *st;
       AVCodec *codec;

       /* find the video encoder */
       codec = avcodec_find_encoder(codec_id);
       if (!codec) {
           fprintf(stderr, "codec not found\n");
           exit(1);
       }

       st = avformat_new_stream(oc, codec);
       if (!st) {
           fprintf(stderr, "Could not alloc stream\n");
           exit(1);
       }

       c = st->codec;

       /* Put sample parameters. */
       c->bit_rate = 400000;
       /* Resolution must be a multiple of two. */
       c->width    = w;
       c->height   = h;
       /* timebase: This is the fundamental unit of time (in seconds) in terms
        * of which frame timestamps are represented. For fixed-fps content,
        * timebase should be 1/framerate and timestamp increments should be
        * identical to 1. */
       c->time_base.den = fps;
       c->time_base.num = 1;
       c->gop_size      = 12; /* emit one intra frame every twelve frames at most */

       c->codec = codec;
       c->codec_type = AVMEDIA_TYPE_VIDEO;
       c->coder_type = FF_CODER_TYPE_VLC;
       c->me_method = 7; //motion estimation algorithm
       c->me_subpel_quality = 4;
       c->delay = 0;
       c->max_b_frames = 0;
       c->thread_count = 1; // more than one threads seem to increase delay
       c->refs = 3;

       c->pix_fmt       = PIX_FMT_YUV420P;

       /* Some formats want stream headers to be separate. */
       if (oc->oformat->flags & AVFMT_GLOBALHEADER)
           c->flags |= CODEC_FLAG_GLOBAL_HEADER;

       return st;
    }

    but with this avcodec_encode_video() will buffer 13 frames before returning any bytes (after that, it will return bytes on every frame). if I set gop_size to 0, then avcodec_encode_video() will return bytes only after the second frame was passed to it. I need a zero delay though.

    This guy apparently was successful (even with larger gop) : http://mailman.videolan.org/pipermail/x264-devel/2009-May/005880.html but I don’t see what he is doing differently

  • MPEG-TS Segments HTTP Live Streaming

    5 juin 2013, par user1069624

    I'm trying to interleave MPEG-TS segments but failing. One set of segments was actually captured using the built in camera in the laptop, then encoded using FFMPEG with the following command :

    ffmpeg -er 4 -y -f video4linux2 -s 640x480 -r 30 -i %s -isync -f mpegts -acodec libmp3lame -ar 48000 -ab 64k -s 640x480 -vcodec libx264 -fflags +genpts -b 386k -coder 0 -me_range 16 -keyint_min 25 -i_qfactor 0.71 -bt 386k -maxrate 386k -bufsize 386k -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -aspect 640:480

    And the other one is an avi file that was encoded using the following command :

    fmpeg -er 4 -y -f avi -s 640x480 -r 30 -i ./DSCF2021.AVI -vbsf dump_extra -f mpegts -acodec libmp3lame -ar 48000 -ab 64k -s 640x480 -vcodec libx264 -fflags +genpts -b 386k -coder 0 -me_range 16 -keyint_min 25 -i_qfactor 0.71 -bt 386k -maxrate 386k -bufsize 386k -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -aspect 640:480

    Then the output is segmented into ts segments using an open source segmenter.

    If both come from the same source (both from the camera) they work fine. However in this case, the second set of segments freeze. Time passes, but the video does not move..
    So i think it's an encoding problem. So my question is, how should i change the ffmpeg command for this to work ?

    By interleave I mean, having a playlist with the first set of segments, and another playlist with the other set of segments, and having the client call one then the other (HTTP Live Streaming)

    The ffprobe output of one of the first set of segments :

    Input #0, mpegts, from 'live1.ts':
     Duration: 00:00:09.76, start: 1.400000, bitrate: 281 kb/s
     Program 1 Service01
       Metadata:
         name            : Service01
         provider_name   : FFmpeg
       Stream #0.0[0x100]: Video: h264, yuv420p, 640x480 [PAR 1:1 DAR 4:3], 29.92 fps, 29.92 tbr, 90k tbn, 59.83 tbc
       Stream #0.1[0x101]: Audio: aac, 48000 Hz, stereo, s16, 111 kb/s

    The ffprobe output of one of the second set of segments :

    Input #0, mpegts, from 'ad1.ts':
     Duration: 00:00:09.64, start: 1.400000, bitrate: 578 kb/s
     Program 1 Service01
       Metadata:
         name            : Service01
         provider_name   : FFmpeg
       Stream #0.0[0x100]: Video: h264, yuv420p, 640x480 [PAR 1:1 DAR 4:3], 25 fps, 25 tbr, 90k tbn, 50 tbc
       Stream #0.1[0x101]: Audio: aac, 48000 Hz, stereo, s16, 22 kb/s

    Thank you,

  • ffmpeg +libx264 iPhone -> 'avcodec_encode_video' return always 0 . please advice

    2 janvier 2014, par isaiah

                     av_register_all();

            AVCodec *codec ;
            AVCodecContext *c= NULL ;
            int  out_size, size, outbuf_size ;
            //FILE *f ;
            uint8_t *outbuf ;
    

    printf("Video encoding\n") ;

    /* find the mpeg video encoder */
    codec =avcodec_find_encoder(CODEC_ID_H264) ;//avcodec_find_encoder_by_name("libx264") ; //avcodec_find_encoder(CODEC_ID_H264) ;//CODEC_ID_H264) ;
    NSLog(@"codec = %i",codec) ;
    if (!codec)
    fprintf(stderr, "codec not found\n") ;
    exit(1) ;

    c= avcodec_alloc_context() ;

    /* put sample parameters */
    c->bit_rate = 400000 ;
    c->bit_rate_tolerance = 10 ;
    c->me_method = 2 ;
    /* resolution must be a multiple of two */
    c->width = 352 ;//width ;//352 ;
    c->height = 288 ;//height ;//288 ;
    /* frames per second */
    c->time_base= (AVRational)1,25 ;
    c->gop_size = 10 ; /* emit one intra frame every ten frames */
    //c->max_b_frames=1 ;
    c->pix_fmt = PIX_FMT_YUV420P ;

    c ->me_range = 16 ;
    c ->max_qdiff = 4 ;
    c ->qmin = 10 ;
    c ->qmax = 51 ;
    c ->qcompress = 0.6f ;

    'avcodec_encode_video' is always 0 .

    I guess that because 'non-strictly-monotonic PTS' warning, do you konw same situation ?