[FFmpeg-devel] H264: mp4toannexb BSF and streaming
Wed Aug 18 14:42:10 CEST 2010
I'm in a (n admittedly suboptimal) situation where I'm receving a 3GP/H264 video file in streaming (over a TCP socket,
I would like to transcode it on-the-fly without waiting for the full 3GP file to be received. I know that the 3GP format
is not AT ALL designed for that, and that even the first chunks will be invalid since the 3GP-writer application does a
seek() back to the beginning to fill the header, etc. In short, 3GP is utterly non-streamable, but I need to do
something with it nevertheless :/
What I've come up with so far, is to detect the beginning of the 'mdat' chunk, which comes quickly in the stream, since
it contains the bulk of the bitstream (in AVC format).
Now, I know that this AVC bitstream is not suitable for input by ffmpeg, who is expecting annex B. I also know of the
mp4toannexb BSF, but I can see in its code that it is relying on extradata coming from the container (in other chunks,
coming at the end), which it will convert and interleave between the annex B NALUs it will spit out.
Hence, I conclude that mp4toannexb cannot work on a "pure" AVC bitstream without extradata.
(1) is this conclusion correct ?
(2) is there a possibility of a workaround, for example omitting the extradata altogether (just keeping the insertion
of start codes) ?
More information about the ffmpeg-devel