[Mp4-tech] Frame rate in h.264
John Cox
jc sj.co.uk
Mon Jul 18 12:27:29 EDT 2005
Glenn
The table you need to look at is E-6 (under the description of
fixed_frame_rate_flag).
Once you've worked through all the verbiage what it says is that the
duration of a field picture is 1x num_units_in_tick/time_scale and the
duration of a frame picture is 2x num_units_in_tick/time_scale. (If you
specify pic_struct then other options are available too for 3/2 pull
down etc.)
I agree that the example given is misleading and I guess that the sample
I saw came from the Main Concept encoder.
JC
>John,
>
>Thanks for the help, somehow skipped over this at first read.
>
>As you suggest, some samples did not have VUI in them. I'll have to
>come up with an alternative.
>
>However, a sample I made with the Main Concept h.264 encoder did have
>the VUI info in it. It is an NTSC sample and has num_units_in_tick =
>900,900 and time_scale equal to 27,000,000. Which gives you a FRAME
>RATE of 29.97. Seems correct to me, but based on your email you
>suggest this should be the field rate instead.
>
>>From my copy of h.264 "ITU-T Rec. H.264 (03/2005) - Prepublished
>version", I include the following:
>
>"For example, when the clock frequency of a video signal is 30000 / 1001
>Hz, time_scale may be 30 000 and num_units_in_tick may be 1001."
>
>Now this clearly seems to be a reference to the NTSC frame rate, and
>suggests the numbers are correct to me, though the text is less clear
>than one might like.
>
>On Thursday 14 July 2023 10:07 am, John Cox wrote:
>> Glenn
>>
>> You can get the info from the VUI (in SPS) from the timing_info
>> fields (num_units in tick, time_scale, fixed_frame_rate_flag).
>> Unfortunately these fields are optional and very few encoders fill
>> them in. Indeed in the only recent example I've seen where they were
>> filled in the encoder had got the value wrong by a factor of two.
>> num_units_in_tick/time_scale should yield field time (or half frame
>> time if progressive) rather than frame time.
>>
>> John Cox
>> SJ Consulting Ltd
>>
>> >In MPEG-2 you could just parse the SEQ header and pull out some bits
>> > to determine if the frame rate is 29.97/NTSC or 25/PAL or whatever.
>> >
>> >I don't see any obvious way to determine this from a .264 stream,
>> > other than by figuring it out based on the number of frames and the
>> > time elapsed, but given that there could be repeats that might be
>> > more complex than I'd like.
>> >
>> >Thanks,
>> >Glenn
>> >
>> >_______________________________________________
>> >NOTE: Please use clear subject lines for your posts. Include [audio,
>> > [video], [systems], [general] or another apppropriate identifier to
>> > indicate the type of question you have.
>> >
>> >Note: Conduct on the mailing list is subject to the Antitrust
>> > guidelines found at
>> > http://www.mpegif.org/public/documents/vault/mp-out-30042-Antitrust
>> >.php
>
>
>_______________________________________________
>NOTE: Please use clear subject lines for your posts. Include [audio, [video], [systems], [general] or another apppropriate identifier to indicate the type of question you have.
>
>Note: Conduct on the mailing list is subject to the Antitrust guidelines found at http://www.mpegif.org/public/documents/vault/mp-out-30042-Antitrust.php
More information about the Mp4-tech
mailing list