Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th April 2018, 04:11   #1  |  Link
leandro
Registered User
 
Join Date: Feb 2017
Posts: 13
Doubts about timing and lost frame/packet at the codec level

As far as I understand, the h264 codec holds information about the frame rate (within the NAL, of SEI's type, timing_info_present_flag -> time_scale) and with that plus the frames count a container can build up its timing scheme. (like PTS) Is that right?

Here are some other questions:
  1. Why do we have to divide the time_scale value by 2 to get the framerate?
  2. Why the codec won't use the original framerate?
  3. is it because we can get a double precision? (I think this is done by utilizing time_scale and num_units_in_tick)
  4. how does double precision framerate are stored at the codec level? (I think this is done by utilizing time_scale and num_units_in_tick)
  5. Does the codec signalizes somehow that a frame/packet was lost?
  6. How an encoder identify that a frame/packet or part of it was missing?
  7. How does dropped frame are handled at the codec leve?

I saw an example at Internet with what seems to be a 29.97 (time_scale/num_units_in_tick)/2 but I downloaded the big bunny (30fps) and then I extracted the .h264 and there I noticed a time_scale valued with 60 and a num_units_in_tick of 1 but the video itself is 30fps, do I really need to half its value to get the right framerate? Why spend more bits where I could store its value?

Last edited by leandro; 29th April 2018 at 04:25.
leandro is offline   Reply With Quote
Old 3rd May 2018, 03:52   #2  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,507
Did you check nuit_field_based_flag? The spec is obnoxiously bad at making it clear, but the actual framerate is
Code:
time_scale / (num_units_in_tick * (nuit_field_based_flag+1))
. But that hardly matters, since the container always overrides the VUI values. Most raw streams will have a generic raw 60/1 or 25/1 and be fixed in muxing.
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order.
foxyshadis is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:31.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.