Hi,I use DVRRDK 03.00.00.00 for development. Hardware platform is EVM8168.
My code is used for test encode performance.
read raw data from files(interlace data) --> IpcFramesOutHLOS --> IpcFramesInVideoM3 -->Enc -->IpcBitsOutVideoM3 --> IpcBitsInHLOS --->save bits to files.
however, no matter which data i set for inputframerate, the encoded data always 30fps.
I also change the frames rate send to Encode(very slow), the encoded data always 30fps.
I read encode link codec, can't find which place set the 30fps encode, all place i printf showes that the framerate is 25fps, which is equal to what i set.
Can somebody help me?
Which API are you using to set encoder frame rate.Also pls share all the params to the API you are using.When you say fps is 30 do you mean when you play the stream in a PC player like VLC ?
I set encoder frame rate use "encPrm.chCreateParams[i].defaultDynamicParams.inputFrameRate".
All params I set is like this.
for (i=0; i<SRC_NUM_CH; i++) { encPrm.chCreateParams[i].format = IVIDEO_H264HP; encPrm.chCreateParams[i].profile = IH264_HIGH_PROFILE; encPrm.chCreateParams[i].dataLayout = IVIDEO_FIELD_SEPARATED;//IVIDEO_FIELD_INTERLEAVED;//progressive ignore the param encPrm.chCreateParams[i].fieldMergeEncodeEnable = FALSE; encPrm.chCreateParams[i].maxBitRate = (6 * 1000 * 1000);//-1; encPrm.chCreateParams[i].encodingPreset = 1; // 3; 1: high quality encPrm.chCreateParams[i].enableHighSpeed = 0; encPrm.chCreateParams[i].encodingPreset = XDM_DEFAULT; encPrm.chCreateParams[i].enableAnalyticinfo = 0; encPrm.chCreateParams[i].enableWaterMarking = 0; encPrm.chCreateParams[i].rateControlPreset = IVIDEO_STORAGE; encPrm.chCreateParams[i].defaultDynamicParams.inputFrameRate = gDemo_info.frameRate; encPrm.chCreateParams[i].defaultDynamicParams.targetBitRate = (4 * 1000 * 1000); encPrm.chCreateParams[i].defaultDynamicParams.intraFrameInterval = 20; encPrm.chCreateParams[i].defaultDynamicParams.interFrameInterval = 1;// 1: no B frame. encPrm.chCreateParams[i].defaultDynamicParams.mvAccuracy = IVIDENC2_MOTIONVECTOR_QUARTERPEL; encPrm.chCreateParams[i].defaultDynamicParams.rcAlg = 0 ; encPrm.chCreateParams[i].defaultDynamicParams.qpMin = 10; encPrm.chCreateParams[i].defaultDynamicParams.qpMax = 40; encPrm.chCreateParams[i].defaultDynamicParams.qpInit = -1; encPrm.chCreateParams[i].defaultDynamicParams.vbrDuration = 8; encPrm.chCreateParams[i].defaultDynamicParams.vbrSensitivity = 0; }
I use Elecard StreamEye Tools to see how many fps the encoded data is. I also use another tools to get fps, 30fps shows too.
Instead of setting as create param can you use the following APIs after Venc_start to set the encoder fps
Venc_setInputFrameRate(chId, xxx); --> Set the input FPS rate here (The rate at which you are feeding frames to encLink) params.frameRate = xxx;--> Set the output fps you want the encoder to produce here
params.targetBitRate = xxx -> Set corresponding bitrate for the specified frame rate
Venc_setDynamicParam(chId, 0, ¶ms, VENC_FRAMERATE);
Hi, Narayanan
I add these in my codec, place then after enclink start.
VENC_CHN_DYNAMIC_PARAM_S params; memset(¶ms, 0, sizeof(params)); params.frameRate = 25; params.targetBitRate = 5000000; Venc_setInputFrameRate(0, 25); Venc_setDynamicParam(0, 0, ¶ms, ENC_FRAMERATE); however, it seems not work, the out fps still 30.
Is DVRRDK 3.0 support change fps when encode interlace data?
I use API Venc_getDynamicParam to get encode dynamic param, the frame rate equal to the value i set.
however, when i use tools to get fps, it is still 30 fps.
Can you provide some suggesions for me? Ths~
Can you analyze the stream to check if timingInfo VUI parameters are present in the stream . If they are not present player may be assuming 30 fps by default.
the vui_parameters_present_flag equal 0.
Pls check if the following changes are present in your codebase:
/dvr_rdk/mcfw/src_bios6/links_m3video/iva_enc/encLink_h264.c
1.#define ENCLINK_H264_SETNALU_MASK_SPS(naluMask) ((naluMask) |= (1 << IH264_NALU_TYPE_SPS_WITH_VUI))
2.enclink_h264_set_static_params()
staticParams->vuiCodingParams.timingInfoPresentFlag = 1;
The SPS should have VUI.
Hi ,Narayanan
I can find both of them in encLink_h264.c.
Are you checking the SPS for VUI info ? Pls check the IDR frame after you set the frame rate. Can you try setting
staticParams->vuiCodingParams.vuiCodingPreset = IH264_VUICODING_DEFAULT;
and see if it makes any difference
I set staticParams->vuiCodingParams.vuiCodingPreset = IH264_VUICODING_DEFAULT in enclink_h264_set_static_params function, there is no difference than before.
Hi Narayanan
The SPS have no VUI info because of vui_parameters_present_flag equal 0.
what's the mean of "check the IDR frame after you set the frame rate"?
I use tools to check the encoded bitstream, all I-Frames not an IDR-Frame, except for the first I-frame.
I find that
IDRFrameInterval is set to 1 (dvr_rdk/mcfw/src_bios6/links_m3video/iva_enc/encLink_h264.c )
What should i do next, can you give me some suggustion? Ths~
Pls set encodingPreset in encLink ch create params to XDM_USER_DEFINED for configuration to take effect.
I set encodingPresent in my codec.
encPrm.chCreateParams[i].encodingPreset = XDM_USER_DEFINED;//XDM_DEFAULT;
I also set vuiCodingPreset in enclink_h264.c
staticParams->vuiCodingParams.vuiCodingPreset = IH264_VUICODING_USERDEFINED;// IH264_VUICODING_DEFAULT;// staticParams->vuiCodingParams.hrdParamsPresentFlag = 1; staticParams->vuiCodingParams.timingInfoPresentFlag = 1; // 1
the framerate can change now.
Thank you very much. ~.~