Find frame rate SPS

本秂侑毒 提交于 2021-02-08 07:50:37

问题


I have been reading several posts (http://tinyurl.com/nqtfh9a...) and links (http://www.cardinalpeak.com/blog/the-h-264-sequence-parameter-set/) about SPS and PPS, but cannot really get the idea.

I have bought an encoder with a SDK. In the specifications, it gives me this SPS and PPS, and I was wondering if there is any frame rate information here:

SPS= 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x00, 0x1e, 0x9a, 0x74, 0x05, 0x81, 0xec, 0x80

I used an h264 analyzer and I got this information:

Found NAL at offset 4 (0x0004), size 10 (0x000A) 
XX 00 00 00 01 67 42 00 1E 9A 74 05 81 EC 80 
==================== NAL ====================
 forbidden_zero_bit : 0 
 nal_ref_idc : 3 
 nal_unit_type : 7 ( Sequence parameter set ) 
======= SPS =======
 profile_idc : 66 
 constraint_set0_flag : 0 
 constraint_set1_flag : 0 
 constraint_set2_flag : 0 
 constraint_set3_flag : 0 
 constraint_set4_flag : 0 
 constraint_set5_flag : 0 
 reserved_zero_2bits : 0 
 level_idc : 30 
 seq_parameter_set_id : 0 
 chroma_format_idc : 1 
 residual_colour_transform_flag : 0 
 bit_depth_luma_minus8 : 0 
 bit_depth_chroma_minus8 : 0 
 qpprime_y_zero_transform_bypass_flag : 0 
 seq_scaling_matrix_present_flag : 0 
 log2_max_frame_num_minus4 : 5 
 pic_order_cnt_type : 0 
   log2_max_pic_order_cnt_lsb_minus4 : 6 
   delta_pic_order_always_zero_flag : 0 
   offset_for_non_ref_pic : 0 
   offset_for_top_to_bottom_field : 0 
   num_ref_frames_in_pic_order_cnt_cycle : 0 
 num_ref_frames : 1 
 gaps_in_frame_num_value_allowed_flag : 0 
 pic_width_in_mbs_minus1 : 43 
 pic_height_in_map_units_minus1 : 29 
 frame_mbs_only_flag : 1 
 mb_adaptive_frame_field_flag : 0 
 direct_8x8_inference_flag : 1 
 frame_cropping_flag : 0 
   frame_crop_left_offset : 0 
   frame_crop_right_offset : 0 
   frame_crop_top_offset : 0 
   frame_crop_bottom_offset : 0 
 vui_parameters_present_flag : 0 
=== VUI ===
 aspect_ratio_info_present_flag : 0 
   aspect_ratio_idc : 0 
     sar_width : 0 
     sar_height : 0 
 overscan_info_present_flag : 0 
   overscan_appropriate_flag : 0 
 video_signal_type_present_flag : 0 
   video_format : 0 
   video_full_range_flag : 0 
   colour_description_present_flag : 0 
     colour_primaries : 0 
   transfer_characteristics : 0 
   matrix_coefficients : 0 
 chroma_loc_info_present_flag : 0 
   chroma_sample_loc_type_top_field : 0 
   chroma_sample_loc_type_bottom_field : 0 
 timing_info_present_flag : 0 
   num_units_in_tick : 0 
   time_scale : 0 
   fixed_frame_rate_flag : 0 
 nal_hrd_parameters_present_flag : 0 
 vcl_hrd_parameters_present_flag : 0 
   low_delay_hrd_flag : 0 
 pic_struct_present_flag : 0 
 bitstream_restriction_flag : 0 
   motion_vectors_over_pic_boundaries_flag : 0 
   max_bytes_per_pic_denom : 0 
   max_bits_per_mb_denom : 0 
   log2_max_mv_length_horizontal : 0 
   log2_max_mv_length_vertical : 0 
   num_reorder_frames : 0 
   max_dec_frame_buffering : 0 
=== HRD ===
 cpb_cnt_minus1 : 0 
 bit_rate_scale : 0 
 cpb_size_scale : 0 
   bit_rate_value_minus1[0] : 0 
   cpb_size_value_minus1[0] : 0 
   cbr_flag[0] : 0 
 initial_cpb_removal_delay_length_minus1 : 0 
 cpb_removal_delay_length_minus1 : 0 
 dpb_output_delay_length_minus1 : 0 
 time_offset_length : 0 

I have tried to obtain the SPS from this information, but I cannot obtain the same one. Thanks and kind regards


回答1:


It can be conveyed in the SPS, but it's not mandatory. It's in:

SPS -> VUI parameters -> Timing Info

If vui_prameters_present_flag is 1, and timing_info_present_flag is 1, then the two fields you want are: 'num_units_in_tick' and 'time_scale'. The example in your second link has this information.

In the absence of any funny frame rate tricks, and when fixed_frame_rate_flag is 1, then your picture rate (in fps) is: time_scale / num_units_in_tick.

If you are using field-based video then this will be a field rate, so you'll have to halve it to get a frame rate.



来源:https://stackoverflow.com/questions/31334973/find-frame-rate-sps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!