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只是一種壓縮標准,但是到實際應用的時候,一般都需要封裝到某種容器里,你所需要的幀率是在容器中指定的。

 


免責聲明!

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



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