[MPlayer-dev-eng] Need help with this H264 patch

Loren Merritt lorenm at u.washington.edu
Tue Feb 22 13:38:35 CET 2005


On Wed, 16 Feb 2005, Nico Sabbi wrote:

> I wrote this patch to autodetect the fps of H264 video when it's in 
> other containers than AVI, but I stumbled on a problem I can't fix:
> in h264_parse_vui() the values of time_scale and time_units
> are almost always reported wrong.
>
> I added some debug statement in libavcodec/h264.c to print most of sps 
> and vui values read from the bitstream, and I could match all fields up 
> to (but excluding) the said timing values. I don't really understand 
> what I did wrong.
>
> Can someone give a look at the code, please?

Your problem is the start-code emulation prevention function:
Before sending a packet to your parser, you must scan though it and 
replace any (byte-aligned) instance of "0x00 0x00 0x03" with "0x00 0x00".

--Loren Merritt




More information about the MPlayer-dev-eng mailing list