[FFmpeg-devel] rtpdec_h264.c RTP to annex-b patch

Matthew Szatmary szatmary at gmail.com
Wed Feb 1 17:25:37 CET 2012


The 3 byre start codes and out of band SPS/PPS format is legal, but the only thing in the ffmpeg stack that can parse that is the h264 decoder itself. I could have made this a bit stream filter, but it would do the exact same thing and require extra code / CLI options from the user. Maybe this solution is not ideal for everyone, but currently it is not possible to write an H.264 RTSP stream without transcoding it. This fixes that.


I'll fix the tabs, and can volunteer to be the maintainer of this file if necessary.


On Feb 1, 2012, at 3:57 AM, Martin Storsjö wrote:

> On Wed, 1 Feb 2012, Michael Niedermayer wrote:
> 
>> On Tue, Jan 31, 2012 at 09:53:12PM -0500, Matthew Szatmary wrote:
>>> Excuse me if i'm missing something, This is my first time submitting a patch to this group.
>>> This patch formats h264 RTP streams as annex-b format. This allows for transmuxing without transcoding (e.g "-vcodec copy") RTP and RTSP streams.
>> 
>> Do we have a maintainer for this file, or volunteer to become
>> maintainer ?
>> 
>> about the patch, if the output isnt compliant to either of the
>> formats then yes it should be fixed.
>> note, tabs are forbiden in ffmpeg git
> 
> FWIW, to me, it seems that the code already produces data in annex b format (with 3 byte startcodes, which should be legal, right?). This patch changes things so that SPS/PPS aren't exported via extradata as earlier, but are prepended to packets with nal type 5.
> 
> If this is required for stream copy to some certain format, it's probably better to do it either via a bitstream filter, or to make the target muxer accept this format as input. Since if this currently fixes one format, it will probably just as well break some other format which expects this format.
> 
> Also, I much prefer having the SPS/PPS out of band if they actually are transmitted in that format (as they are, in RTP) than mixed into the stream.
> 
> // Martin
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel



More information about the ffmpeg-devel mailing list