多媒體開發之h264中的sps---sps信息提取之幀率


------------------------------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 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM