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

Michael Niedermayer michaelni at gmx.at
Wed Feb 1 18:00:05 CET 2012


On Wed, Feb 01, 2012 at 11:25:37AM -0500, Matthew Szatmary wrote:
> 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.

Yes, i would be very happy if you would maintain this file!
Simplest would likely be if you clone the ffmpeg repo somewhere (like
github) and when you have some commits which with you are happy, tell
me to pull them in.


> 
> 
> 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.

annex B:
    zero_byte is a single byte equal to 0x00.
    When any of the following conditions are fulfilled, the zero_byte syntax element shall be present:
    ­   the nal_unit_type within the nal_unit( ) is equal to 7 (sequence parameter set) or 8 (picture parameter set),
    ­   the byte stream NAL unit syntax structure contains the first NAL unit of an access unit in decoding order, as
        specified by subclause 7.4.1.2.3.

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 3
"Rare item" - "Common item with rare defect or maybe just a lie"
"Professional" - "'Toy' made in china, not functional except as doorstop"
"Experts will know" - "The seller hopes you are not an expert"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120201/67e6202d/attachment.asc>


More information about the ffmpeg-devel mailing list