多媒体开发之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 

posted @   midu  阅读(3768)  评论(1编辑  收藏  举报
编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 字符编码:从基础到乱码解决
历史上的今天:
2014-11-27 网络协议之rtp---h264的rtp网络协议实现
2014-11-27 图像处理之卷积---任意卷积核的快速实现
2014-11-27 多媒体开发之编码gop---什么是GOP
2014-11-27 多媒体开发之播放器---一个基于FFmpeg、libtorrent的P2P播放器实现
2014-11-27 开源项目之树莓派---无线监控摄像头
2014-11-27 开源项目之小玩具---各种机器人开源硬件
2014-11-27 目标检测之显著区域检测---国外的一个图像显著区域检测代码及其效果图 saliency region detection
点击右上角即可分享
微信分享提示