Understanding H.264 num_units_in_tick and time_scale

View Full Version : Understanding H.264 num_units_in_tick and time_scale


sameersbn
25th February 2010, 21:09
Hi,
I have been trying to understand the various fields in the SPS Unit of H.264 stream.
I have a h.264 bitstream that is plays at 25 fps. Looking at the bitstream the VUI information in the SPS unit has
num_units_in_tick = 1000
time_scale = 50000

I am failing to understand how the fps is calculated using these two values.
I can arrive at 25 value using:

fps = time_scale / num_units_in_tick / 2
= 50000 / 1000 / 2
= 25

Looking at the patch attached in this post http://osdir.com/ml/video.x264.devel/2005-07/msg00054.html, it seems thats x264 does it in the same (not sure whether the patch was accepted or not)

Is this actually how its supposed to be? Or is there some way a divisor is to be calculated or something of that sort.

Also can you please tell me which bit field indicates whether the video stream is in field mode or frame mode.

In the mean time i will keep looking on the internet.

Thanks and Regards
~Sameer

neuron2
25th February 2010, 22:04
It's all documented in the AVC specifications, which are readily available.

Shevach
28th February 2010, 17:00
In the H.264 standard the notion of the ratio 'num_units_in_tic/time_scale'
depends on nuit_field_based_flag.

If nuit_field_based_flag=1 then the the above ratio denotes field rate otherwise it denotes frame rate.

Apparently in x.264 nuit_field_based_flag is set to 1 therefore the ratio num_units_in_tic/time_scale is further divided by 2 in order to get frame rate.
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值