本文介绍了查找帧速率SPS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了几篇文章( http://tinyurl.com/nqtfh9a .. .)和链接( http://www.cardinalpeak.com/blog/the-h-264-sequence-parameter-set/)有关SPS和PPS的信息,但无法真正理解.

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.

我已经购买了带有SDK的编码器.在规范中,它给了我这个SPS和PPS,我想知道这里是否有任何帧速率信息:

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

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

我使用了h264分析仪,并获得了以下信息:

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

我试图从此信息中获取SPS,但无法获得相同的信息.谢谢和亲切的问候

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

推荐答案

它可以在SPS中传达,但不是强制性的.它在:

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

SPS-> VUI参数->时序信息

SPS -> VUI parameters -> Timing Info

如果vui_prameters_present_flag为1,timing_info_present_flag为1,则您想要的两个字段为:"num_units_in_tick"和"time_scale".第二个链接中的示例包含此信息.

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.

在没有任何有趣的帧速率技巧的情况下,并且当fixed_frame_rate_flag为1时,您的图片速率(以fps为单位)为:time_scale/num_units_in_tick.

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.

这篇关于查找帧速率SPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-23 19:51