PDA

View Full Version : Frame rate in H264 SPS Nal unit


tydrive
4th June 2007, 12:22
Hi,
I have some problem while finding out the frame rate from SPS Nal unit.

Some streams I found
timing_info_present_flag =1
num_units_in_tick =2002
time_scale = 30000
fixed_frame_rate_flag=0

which gives the framerate 30000/2002 = 15fps

Many other streams , with variable frame rate, I get

timing_info_present_flag =1
num_units_in_tick =771
time_scale = 3909091445
fixed_frame_rate_flag=0

and no idea how to calculate the framerate.
I wonder if I need some other info to get the exact framerate.

Please reply if any one has some idea.

Thanks,
Tydrive.

Kurtnoise
4th June 2007, 12:42
In general, time_scale / (2 * num_units_in_tick)

kwtc
4th June 2007, 12:58
If fixed_frame_rate_flag=0, then you've lost...

You will need to decode PTS/DTS associated with each picture (if they are present) to compute the average frame rate.

Otherwise, the above formula is correct.

tydrive
5th June 2007, 01:33
thanks,
I was trying to calculate the framerate from PTS/DTS but found that in that stream we get only one PTS per 5 frames and need to extrapolate the for other 4 frames, and it gets screwed up when there is a sudden change in framerate.



timing_info_present_flag =1
num_units_in_tick =771
time_scale = 3909091445
fixed_frame_rate_flag=0



I found the information above in many streams and wondering there must be some other information we need to get to calculate the framerate.

Sergey A. Sablin
5th June 2007, 09:16
thanks,
I was trying to calculate the framerate from PTS/DTS but found that in that stream we get only one PTS per 5 frames and need to extrapolate the for other 4 frames, and it gets screwed up when there is a sudden change in framerate.



timing_info_present_flag =1
num_units_in_tick =771
time_scale = 3909091445
fixed_frame_rate_flag=0



I found the information above in many streams and wondering there must be some other information we need to get to calculate the framerate.

any chance to share any of these streams?