[FFmpeg-user] H.264 annex B muxing in mp4

malikcis malik.cisse at gmx.net
Tue Jan 14 15:39:19 CET 2014

I managed to write a H.264 annex B muxer (from a compression board) in mp4
using libavformat.
If I don’t specify extradata as bellow, the generated MP4 stream appears to
be corrupted and won’t play in quicktime.
pMux_ctx->video_st = NULL;  
if ( pMux_ctx->fmt->video_codec != CODEC_ID_NONE ) 
                AVCodecContext * c;  
                pMux_ctx->video_st = av_new_stream (pMux_ctx->oc , 0);  
                if (! pMux_ctx->video_st) 
                               fprintf( stderr, "Could not alloc
video_stream\n" );  
                c = pMux_ctx->video_st->codec;  
c->extradata = buffer;
c->extradata_size = size;
This all works fine but I just don’t understand why the muxer needs the
extradata since all necessary metadata have already been set through
I would like to simplify the code and avoid computing extradata in advance
(saving thus 600 lines of code).
Thanks, Malikcis

View this message in context: http://ffmpeg-users.933282.n4.nabble.com/H-264-annex-B-muxing-in-mp4-tp4663221.html
Sent from the FFmpeg-users mailing list archive at Nabble.com.

More information about the ffmpeg-user mailing list