在這裏你去:
### Sequence Parameter Set
profile_idc 100
constraint_set0_flag 0
constraint_set1_flag 0
constraint_set2_flag 0
constraint_set3_flag 0
level_idc 42
seq_parameter_set_id 0
chroma_format_idc 1
// TODO: ...
// TODO: ...
num_ref_frames 1
gaps_in_frame_num_value_allowed_flag 1
pic_width_in_mbs_minus1 119
pic_height_in_map_units_minus1 67
frame_mbs_only_flag 1
direct_8x8_inference_flag 1
frame_cropping_flag 1
frame_crop_left_offset 0
frame_crop_right_offset 0
frame_crop_top_offset 0
frame_crop_bottom_offset 4
vui_parameters_present_flag 1
// TODO: ...
### Picture Parameter Set
pic_parameter_set_id 0
seq_parameter_set_id 0
entropy_coding_mode_flag 1
num_slice_groups_minus1 0
// TODO: ...
這是1920×1080視頻:基本上你分析出每個規格的值,然後計算出在這篇文章中描述的尺寸:Fetching the dimensions of a H264Video stream
具體做法是:
width = ((pic_width_in_mbs_minus1 + 1) * 16)
- (frame_crop_left_offset + frame_crop_right_offset) * 2
height= (2 - frame_mbs_only_flag) * ((pic_height_in_map_units_minus1 + 1) * 16)
- (frame_crop_top_offset + frame_crop_bottom_offset) * 2
讓你120 * 16
68 * 16 - 8
(假設4:2:0顏色採樣)。
2014年10 UPD:我把這種向上從編輯/註釋:
轉換從場到幀(2 - frame_mbs_only_flag)
被施加到剪切區域爲好。 subWidthC和subHeightC的x2僅適用於顏色採樣4:2:0。 4:4:4,4:2:2,而單色使用x1表示一個或兩個x2。
可能出現[從H.264 NALU獲取視頻的寬度/高度]的副本(http://stackoverflow.com/questions/12018535/get-the-width-height-of-the-video-從-H-264-NALU) – mpromonet