H264裸流分析中,能获取哪些信息?

从H264的裸流中,PPS,SPS中,一定可以获取到的,有图像的宽,高信息。

这部分信息的提取,用Stream eye 分析:

这里需要特别提一下这两个参数:
  pic_width_in_mbs_minus1 = 119(1920)
  pic_height_in_map_units_minus1 = 67(1088)
分别表示图像的宽和高,以宏块(16x16)为单位的值减1
因此,实际的宽为 (119+1)*16 = 352,高:(67+1)*16=1088

开始的时候,我还以为是哪里不对,1080咋是1088?后面才知道,1080是因为简称,实际是1088,因为要16的倍数。


===================================

给一段264的码流,可以得出帧率信息吗?(来自:http://bbs.chinavideo.org/forum.php?mod=viewthread&tid=17285&highlight=%D6%A1%C2%CA)
下面是网上找到的:
H.264码流中一般没有帧率,比特率信息到使可以得到,你参考码流语法,但是有的吗流有VUI信息,他里面有个标志 timing_info_present_flag 若等于1,则码流中有num_units_in_tick 和 time_scale。
framerate = time_scale/num_units_in_tick.

下面是264标准中给出:


timing_info_present_flag equal to 1 specifies that num_units_in_tick, time_scale and fixed_frame_rate_flag are present in the bitstream. timing_info_present_flag equal to 0 specifies that num_units_in_tick, time_scale and
fixed_frame_rate_flag are not present in the bitstream.

num_units_in_tick is the number of time units of a clock operating at the frequency time_scale Hz that corresponds to one increment (called a clock tick) of a clock tick counter. num_units_in_tick shall be greater than 0. A clock tick is the minimum interval of time that can be represented in the coded data. For example, when the frame rate of a video signal is 30 000 ÷ 1001 Hz, time_scale may be equal to 60 000 and num_units_in_tick may be equal to 1001. See Equation C-1.

time_scale is the number of time units that pass in one second. For example, a time coordinate system that measures time using a 27 MHz clock has a time_scale of 27 000 000. time_scale shall be greater than 0.


从上面红色标注的例子看,应该是framerate=(time_scale/num_unit_in_tick)/2;

PS:后面我专门查看了H264的标准,在VUI里面,确实看到了这段话,所以从上面可以知道,我分析的那段码率的帧率为:framerate=50/1/2=25fps;这确实是我编码的时候设置的帧率。

这是timing_info_present_flag =1才可以知道。如果在timing_info_present_flag =0的时候,那怎么获取呢?

 

帖子里有人回答了:

但不是每一段264码流都包含了VUI,这部分可有可无,264只是一种压缩标准,但是到实际应用的时候,一般都需要封装到某种容器里,你所需要的帧率是在容器中指定的。

 

posted @ 2015-01-18 11:43  lihaiping  阅读(6177)  评论(0编辑  收藏  举报