Elecard
June 20, 2013, 04:38:15 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: H264 SPS declared Framerate decoded incorrectly?  (Read 2247 times)
brandyj
Newbie
*
Posts: 1


View Profile
« on: October 19, 2011, 09:34:50 am »

Hello,
I have been working with Stream Eye for some time.  I have an H264 stream with different frame rates declared within it.  It decodes some of them correctly and others in correctly within the same stream.  When I decode the SPS by hand it seems to that all the frame rates are correct.  I think there might be a bug in the system that is adding or deleting bits when decoding the header.  I see from the H264 specification that the num_units_in_tick and time_scale values are supposed to be 32bits each.  But for some reason, the time_scale will occasionally shift and grab the bit intended for fixed_frame_rate_flag and trailing_bits.

I would like to up load a screen shot or imagery file for you see the headers, but I can't figure on how to do that.

Here is some text:
A good decode of the frame rate looks like this:
SPS header in hex: 00 00 00 01 67 42 80 28 f4 05 a1 e9 28 40 00 7d 00 00 04 e2 00 21
and then the Headers info shows with proper flags set and 5 as the framerate declared.
  [00]seq_parameter_set_rbsp() {
    profile_idc                                    = 66 (Baseline)
    constraint_set0_flag                           = 1 (true)
    constraint_set1_flag                           = 0 (false)
    constraint_set2_flag                           = 0 (false)
    constraint_set3_flag                           = 0 (false)
    reserved_zero_4bits                            = 0 (false)
    level_idc                                      = 40
    seq_parameter_set_id                           = 0
    if (profile_idc == 100 || profile_idc == 110 || profile_idc == 122 || profile_idc == 144) {
    log2_max_frame_num_minus4                      = 0 (4)
    pic_order_cnt_type                             = 0
    if (pic_order_cnt_type == 0)
    else if (pic_order_cnt_type == 1) {
    num_ref_frames                                 = 1
    gaps_in_frame_num_value_allowed_flag           = 0
    pic_width_in_mbs_minus1                        = 44 (720)
    pic_height_in_map_units_minus1                 = 29 (480)
    frame_mbs_only_flag                            = 1
    if (!frame_mbs_only_flag)
    direct_8x8_inference_flag                      = 0 (false)
    frame_cropping_flag                            = 0 (false)
    if (frame_cropping_flag) {
    vui_parameters_present_flag                    = 1 (true)
    if (vui_parameters_present_flag)
      vui_parameters() {
        aspect_ratio_info_present_flag             = 0 (false)
        if (aspect_ratio_info_present_flag) {
        overscan_info_present_flag                 = 0 (false)
        if (overscan_info_present_flag)
        video_signal_type_present_flag             = 1 (true)
        if (video_signal_type_present_flag) {
          video_format                             = 2
          video_full_range_flag                    = 0 (false)
          colour_description_present_flag          = 0 (false)
          if (colour_description_present_flag) {
          }
        chroma_location_info_present_flag          = 0 (false)
        if (chroma_loc_info_present_flag) {
        timing_info_present_flag                   = 1 (true)
        if (timing_info_present_flag) {
          num_units_in_tick                        = 128000
          time_scale                               = 1280000
          fixed_frame_rate_flag                    = 1
          }

        nal_hrd_parameters_present_flag            = 0 (false)
        if (nal_hrd_parameters_present_flag)
        vcl_hrd_parameters_present_flag            = 0 (false)
        if (vcl_hrd_parameters_present_flag)
        if (nal_hrd_parameters_present_flag || vcl_hrd_parameters_present_flag)
        pic_struct_present_flag                    = 0 (false)
        bitstream_restriction_flag                 = 0 (false)
        if (bitstream_restriction_flag) {
        }
      }
    }
  [00]pic_parameter_set_rbsp() {
  [00]slice_header() {
  [00]sei() {                                      = 35

The very next frame has should have a declared rate of 4fps
SPS header in hex: 00 00 00 01 67 42 80 28 f4 05 a1 e9 28 40 00 7d 00 00 03 e8 00 21
The Headers Info displays this and states that the declared frame rate is 237.569
  [00]seq_parameter_set_rbsp() {
    profile_idc                                    = 66 (Baseline)
    constraint_set0_flag                           = 1 (true)
    constraint_set1_flag                           = 0 (false)
    constraint_set2_flag                           = 0 (false)
    constraint_set3_flag                           = 0 (false)
    reserved_zero_4bits                            = 0 (false)
    level_idc                                      = 40
    seq_parameter_set_id                           = 0
    if (profile_idc == 100 || profile_idc == 110 || profile_idc == 122 || profile_idc == 144) {
    log2_max_frame_num_minus4                      = 0 (4)
    pic_order_cnt_type                             = 0
    if (pic_order_cnt_type == 0)
    else if (pic_order_cnt_type == 1) {
    num_ref_frames                                 = 1
    gaps_in_frame_num_value_allowed_flag           = 0
    pic_width_in_mbs_minus1                        = 44 (720)
    pic_height_in_map_units_minus1                 = 29 (480)
    frame_mbs_only_flag                            = 1
    if (!frame_mbs_only_flag)
    direct_8x8_inference_flag                      = 0 (false)
    frame_cropping_flag                            = 0 (false)
    if (frame_cropping_flag) {
    vui_parameters_present_flag                    = 1 (true)
    if (vui_parameters_present_flag)
      vui_parameters() {
        aspect_ratio_info_present_flag             = 0 (false)
        if (aspect_ratio_info_present_flag) {
        overscan_info_present_flag                 = 0 (false)
        if (overscan_info_present_flag)
        video_signal_type_present_flag             = 1 (true)
        if (video_signal_type_present_flag) {
          video_format                             = 2
          video_full_range_flag                    = 0 (false)
          colour_description_present_flag          = 0 (false)
          if (colour_description_present_flag) {
          }
        chroma_location_info_present_flag          = 0 (false)
        if (chroma_loc_info_present_flag) {
        timing_info_present_flag                   = 1 (true)
        if (timing_info_present_flag) {
          num_units_in_tick                        = 128000
          time_scale                               = 60817540
          fixed_frame_rate_flag                    = 0
          }

        nal_hrd_parameters_present_flag            = 0 (false)
        if (nal_hrd_parameters_present_flag)
        vcl_hrd_parameters_present_flag            = 0 (false)
        if (vcl_hrd_parameters_present_flag)
        if (nal_hrd_parameters_present_flag || vcl_hrd_parameters_present_flag)
        pic_struct_present_flag                    = 0 (false)
        bitstream_restriction_flag                 = 0 (false)
        if (bitstream_restriction_flag) {
        }
      }
    }
  [00]pic_parameter_set_rbsp() {
  [00]slice_header() {
  [00]sei() {                                      = 35

Is there some limitation as to how many times it can change frame rates?  Or is this an error within Stream Eye?

thanks for you prompt reply.  I am going to look for another decoder too to verify what I am seeing.

Brandy
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!