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

Michael Niedermayer michaelni at gmx.at
Wed Feb 1 21:06:13 CET 2012


On Wed, Feb 01, 2012 at 09:45:45PM +0200, Martin Storsjö wrote:
> On Wed, 1 Feb 2012, Michael Niedermayer wrote:
> 
> >>The h264_mp4toannexb bsf isn't exactly what's needed in this case -
> >>the data is in annex b format already, but with SPS/PPS as extradata
> >>instead of inline in the stream. (This is exactly the same format as
> >>libx264 outputs if encoding for mp4 files, when the global header
> >>flag is set, FWIW.) Not sure if there currently is any bitstream
> >>filter to do exactly this conversion (removing extradata and
> >>embedding it into the stream) though.
> >
> >dump_extra maybe
> >
> >but in how far that would produce valid annex b iam not sure.
> >Our decoder will handle it of course but that doesnt mean its compliant
> >to the spec.
> 
> Hmm, that might actually work.
> 
> >[...]
> >>Currently, the rtp depacketizer sets timestamps for all packets, but
> >>it seems that the h264 parser clears this from the first frame, so
> >>that it has dts=pts=N/A.
> >
> >that sounds like a bug
> >
> >
> >>With the current code, this frame has
> >>keyframe=1 set, and the mkv muxer will fail to write it with "Can't
> >>write packet with unknown timestamp". With your patch applied, this
> >>frame is marked as keyframe=0 by the parser, and ffmpeg.c won't
> >
> >Is it or is it not a keyframe ?
> >either way this too sounds like theres a bug somewhere
> 
> I do think it's a keyframe.
> 
> The stream is available publicly in the url as in the previous mail
> (rtsp://albin.abo.fi:8554/sample_h264_100kbit.mp4), if you want to
> have a look.

hmm
this doesnt look good with the patch, i get 2 startcodes
0 0 0 1 0 0 0 1
then duplicate SPS & PPS


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

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- 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/84baf033/attachment.asc>


More information about the ffmpeg-devel mailing list