Community
cancel
Showing results for 
Search instead for 
Did you mean: 
vucetica
Beginner
166 Views

timing_info_present_flag not set by h264 encoder

Is there any way I can force h264 encoder to write timing_info_resent_flag. I'm missing timing_infor_present_flag, num_units_in_tick, time_scale and fixed_frame_rate_flag in the H264 sequence parameter set of the encoded stream. Is there any way to force encoder to set those values? H264VideoEncoder has a method for getting sequenceParameterSet (as a const) so there is not way to set it. Here is my h264.par file:
[bash]/* CommentLine: H.264 Sequence.*/
stream.yuv        /* name of source files */
300               /* number of frames to encode */
1 12 1           /* 1(reserved) , N (# of frames in between I frames), IDR interval. */
2 0               /* Number of B frames between I (or P) and next P, treat B as a reference (only 0 is supported!) */
4 1 0             /* num_ref_frames (2-16), minimum length of list1 for backward prediction (only 1 is supported!), number of slices. */
77 32			  /* profile_idc (77-main, 100-high); level_idc (set 0 for automatic selection) (check that num_ref_frames and frame size are in accordance with the level)  */
720				/* horizontal_size */
480               /* vertical_size */
5                 /* frame_rate_code [0,8] (0-30 fps,1-15 fps,2-24 fps,3-25 fps,4-30 fps,5-30 fps,6-50 fps,7-60 fps,8-60 fps)*/
1 8 8             /* High profile: chroma_format_idc (0 - monochrom, 1 - 420, 2 - 422), bit_depth_luma [8,12], bit_depth_chroma [8,12] */
0 8 0 0 0         /* High profile: aux_format_idc: [0,3], bit_depth_aux: [8,12], alpha_incr_flag: 0, 1; alpha_opaque_value: [0, 2^(bit_depth_aux + 9) -1]; alpha_transparent_value: [0, 2^(bit_depth_aux + 9) - 1]  */
2 0 0 0 600000    /* RC method(0 - quant_codes, 1 - CBR MBwise, 2 - CBR framewise, 3 - Debug); start qp values for I, P, B slices; bitrate (bits per second) */
2 1 8 8           /* ME method (1-6), subblock split, search x,search_y */
0 0 0             /* weighted prediction, weighted biprediction implicit weighted biprediction (not supported!)*/
1 1               /* direct type (0 - temporal 1 - spatial 2 - auto); direct_inference_flag */
0 0 0             /* disable_deblocking_idc: 1-- off, 0 - on, 2 -- on(without crossing slice boundaries); deblocking_filter_alpha, deblocking_filter_beta */
0 0 0             /* High profile: transform_8x8_mode: 0 -- off, 1 - on; 0 -- use standard, 1 -- use default scaling matrices for 8x8 quantization; qpprime_y_zero_transform_bypass_flag: (0, 1) */
352               /* display_horizontal_size */
288            	  /* display_vertical_size */
1 2               /* entropy coding mode (0-cavlc,1-cabac); cabac_init_idc (0,1,2) */
0                 /* picture coding type (0 - only FRM, 1 - only FLD , 2 - only AFRM, 3  - pure PicAFF(no MBAFF) 4 PicAFF + MBAFF). Only 0 (FRM) is supported! */
1 0               /* speed/quality grade [0,3] (0-maximum speed, 3-maximum quality); OptimalQuantization (0, 1) */[/bash]
Thanks,
Aleksandar
0 Kudos
1 Reply
Pavel_V_Intel
Employee
166 Views

This problem was fixed in 7.0.2 sample. You can add time code by yourself following this:

In file "umc_h264_gen_enc_tmpl.cpp.h" there is function "void H264ENC_MAKE_NAME(H264CoreEncoder_SetSequenceParameters)". On line 1196 you can find comment "//VUI parameters" and just after you can add this code:
[cpp]       //VUI parameters       
       if(core_enc->m_info.info.framerate != 0)
       {
          core_enc->m_SeqParamSet.vui_parameters.timing_info_present_flag = 1;
          core_enc->m_SeqParamSet.vui_parameters.num_units_in_tick = 1;
          core_enc->m_SeqParamSet.vui_parameters.time_scale = 
            2*core_enc->m_SeqParamSet.vui_parameters.num_units_in_tick * (Ipp32u)core_enc->m_info.info.framerate;
          core_enc->m_SeqParamSet.vui_parameters.fixed_frame_rate_flag = 1;
       }[/cpp]
Reply