[FFmpeg-devel] [PATCH] mp4toannexb modification / improvement

Luca Abeni lucabe72
Thu Jun 3 13:07:48 CEST 2010

Hi all,

the "mp4toannexb" currently converts an H264 bitstream from
the "AVC" syntax to "Annex B byte stream format", inserting
the (converted) extradata in the stream when a NAL with type
5 is received.

However, in some cases (see the recent thread about H.264 and
RTP) it might be useful to only convert the extradata, and to
get the converted extradata before the bsf is fed with any data.

Hence, I propose to modify / enhance this filter to return the
converted extradata if no data is passed (that is, if buf_size
is 0). The "regular" behaviour of the filter is not affected
by this patch (the only difference is that if buf_size == 0 the
filter returns the converted extradata instead of failing), and
this patch allows to avoid a good amount of code duplication in

Is the patch ok? If not, what is needed to make it acceptable?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: improve_mp4toannexb.diff
Type: text/x-diff
Size: 597 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100603/2e67e8d2/attachment.diff>

More information about the ffmpeg-devel mailing list