------------------------------author:pkf
-----------------------------------------time:2015-8-20
----------------------------------------------------------qq:1327706646
1. sps 中的帧率
2. vui 结构
3 帧率计算
4 代码实现
1. sps 中的帧率
不是所有的编码器都带有帧率信息,在nalu 中的sps里,应为耗费带宽,通过解析nalu 中的数据结构可以发现里面有个标志位:
vui_parameters_present_flag 负责是否带帧率
2. vui 结构
很多
3 帧率计算
framerate = time_scale/2*num_units_in_tick.
好多网络博客说是framerate = time_scale/num_units_in_tick 这个公式,其实是错误的,只有自己动手才能丰衣足食,我用elecard streameye 看了下 实际数据套用这个公式后多了一倍帧率!
4 代码实现
还没实现,流着后面实现
//add 8-30
vui_parameters()
{
}
VUI参数语法:
vui_parameters( ) { C 描述符
aspect_ratio_info_present_flag 0 u(1)
if( aspect_ratio_info_present_flag ) {
aspect_ratio_idc 0 u(8)
if( aspect_ratio_idc = = Extended_SAR ) {
sar_width 0 u(16)
sar_height 0 u(16)
}
}
overscan_info_present_flag 0 u(1)
if( overscan_info_present_flag )
overscan_appropriate_flag 0 u(1)
video_signal_type_present_flag 0 u(1)
if( video_signal_type_present_flag ) {
video_format 0 u(3)
video_full_range_flag 0 u(1)
colour_description_present_flag 0 u(1)
if( colour_description_present_flag ) {
colour_primaries 0 u(8)
transfer_characteristics 0 u(8)
matrix_coefficients 0 u(8)
}
}
chroma_loc_info_present_flag 0 u(1)
if( chroma_loc_info_present_flag ) {
chroma_sample_loc_type_top_field 0 ue(v)
chroma_sample_loc_type_bottom_field 0 ue(v)
}
timing_info_present_flag 0 u(1)
if( timing_info_present_flag ) {
num_units_in_tick 0 u(32)
time_scale 0 u(32)
fixed_frame_rate_flag 0 u(1)
}
nal_hrd_parameters_present_flag 0 u(1)
if( nal_hrd_parameters_present_flag )
hrd_parameters( )
vcl_hrd_parameters_present_flag 0 u(1)
if( vcl_hrd_parameters_present_flag )
hrd_parameters( )
if( nal_hrd_parameters_present_flag | | vcl_hrd_parameters_present_flag )
low_delay_hrd_flag 0 u(1)
pic_struct_present_flag 0 u(1)
bitstream_restriction_flag 0 u(1)
312 ITU-T H.264建议书(03/2005)
if( bitstream_restriction_flag ) {
motion_vectors_over_pic_boundaries_flag 0 u(1)
max_bytes_per_pic_denom 0 ue(v)
max_bits_per_mb_denom 0 ue(v)
log2_max_mv_length_horizontal 0 ue(v)
log2_max_mv_length_vertical 0 ue(v)
num_reorder_frames 0 ue(v)
max_dec_frame_buffering 0 ue(v)
}
}
附录:
http://www.chinavideo.org/archiver/?tid-5256.html
http://blog.csdn.net/android_lee/article/details/6200276
http://blog.csdn.net/ljh081231/article/details/5828997 帧率解析
http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/237004 ti dm8168 中可以设置vui 帧率方法
http://www.ithao123.cn/content-4258668.html
http://blog.csdn.net/bingqingsuimeng/article/details/9980579 pts