This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DM368-ex 30fps encode

Dear all,

We face a strange problem when doing H264 encode on DM368-ex. If we set the key frame interval to 30 (idrFrameInterval = 30), that's ok. But if we set to 16, the statistics of the frame rate is not so good, we will face 1006 or 1007 ms for encoding 30 fps which we expect is 1000 ms.

<avenc> Module | Avg Time/Frame | Frame-rate | Total time | Total Frames |
<avenc> CAPTURE | 33.30 | 30.03 | 999 | 30 |
<avenc> ENCODE:H264 | 33.53 | 29.82 | 1006 | 30 |

And if we set the key frame interval even to 5, the statistics is also good. Seems not due to the little value of interval of key frame but due to the special number of key frame interval.

My question is: does anybody know is there any relationship between the fps and key frame interval required for deliver 30 fps? if we want 30 fps, do we only accept key frame in: 1, 2, 5, 15 and 30?


P.S. we use dm36x-codec-2.20.00.05 and dvsdk3-3.10.00.19 with below configuration for encode H.264:

dynamicParams_h264.rcAlgo = 6;

dynamicParams.targetBitRate = 3000*1000;

dynamicParams.refFrameRate = 30 * 1000;

dynamicParams.targetFrameRate = 30 * 1000;

Any suggestion are welcome and if you want any more info please let me know. Thanks.

  • Hi,

    key frame interval can be anything, recommended value for 30fps is 30 because, IDR frames take more time to encode. Performance should be same for 15 and 16 as IDR interval. If you use smaller IDR interval  you may see performance drop.

    Have you enabled GDR or AIR? Can you please send complete parameters. We will check it out at our end also.

    Thanks,

    Veeranna

  • Hi Veeranna,

    Thank you for your quick response.

    Yes, I also had same idea with you. But the phenomenon is really strange. If set key frame rate to 6, 5 or 1, the summary is ok, (no 1005 or 1006); but if I set to 16, the 1006 will appear.

    I list the configuration below:

    /*setting dynamicParams*/
    vObj->dynamicParams.size = sizeof(IVIDENC1_DynamicParams);
    /*The inputHeight and inputWidth must be multiples of two.*/
    vObj->dynamicParams.inputHeight = 1080;
    vObj->dynamicParams.inputWidth = 1920;
    vObj->dynamicParams.refFrameRate = 30 * 1000;
    vObj->dynamicParams.targetFrameRate = 30 * 1000;
    vObj->dynamicParams.targetBitRate = 3000*1000;
    vObj->dynamicParams.intraFrameInterval = 0;
    vObj->dynamicParams.generateHeader = XDM_ENCODE_AU;
    vObj->dynamicParams.captureWidth = 0;
    vObj->dynamicParams.forceFrame = IVIDEO_NA_FRAME;
    vObj->dynamicParams.interFrameInterval = 0;
    vObj->dynamicParams.mbDataFlag = 0;

    vObj->dynamicParams.size = sizeof(IH264VENC_DynamicParams);

    vObj->dynamicParams_h264.sliceSize = 0;
    vObj->dynamicParams_h264.airRate = 0;
    vObj->dynamicParams_h264.intraFrameQP = 28;
    vObj->dynamicParams_h264.interPFrameQP = 28;
    vObj->dynamicParams_h264.initQ = -1;

    vObj->dynamicParams_h264.rcAlgo = 6;/*Frame skips are not allowed*/

    vObj->dynamicParams_h264.rcQMax = q_max;
    vObj->dynamicParams_h264.rcQMin = q_min;
    vObj->dynamicParams_h264.rcQMaxI = q_max;
    vObj->dynamicParams_h264.rcQMinI = q_min;

    vObj->dynamicParams_h264.maxDelay = 2000;

    vObj->dynamicParams_h264.aspectRatioX = 1;
    vObj->dynamicParams_h264.aspectRatioY = 1;

    vObj->dynamicParams_h264.lfDisableIdc = 0;
    vObj->dynamicParams_h264.enableBufSEI = 0;
    vObj->dynamicParams_h264.enablePicTimSEI = 0;
    vObj->dynamicParams_h264.perceptualRC = 0;
    vObj->dynamicParams_h264.idrFrameInterval = vObj->intraframeinterval;
    if(frameType == 1) {/*set new intraFrameInterval just when frame type is I frame*/
    vObj->intraframeinterval = 16;
    vObj->dynamicParams_h264.idrFrameInterval = vObj->intraframeinterval;
    }

    vObj->dynamicParams_h264.mvSADoutFlag = vObj->motion_en;

    /*Flag to reset HDVICP at the start of every frame 1: ON; 0:OFF*/
    vObj->dynamicParams_h264.resetHDVICPeveryFrame = 2;

    vObj->dynamicParams_h264.enableROI = 0;
    vObj->dynamicParams_h264.metaDataGenerateConsume = 0;

    vObj->dynamicParams_h264.maxBitrateCVBR = 0;
    //02.20.00.05
    vObj->dynamicParams_h264.maxHighCmpxIntCVBR = 0;
    vObj->dynamicParams_h264.CVBRsensitivity = 0;
    vObj->dynamicParams_h264.LBRmaxpicsize = 0;
    vObj->dynamicParams_h264.LBRminpicsize = 0;
    vObj->dynamicParams_h264.LBRskipcontrol = 0;

    vObj->dynamicParams_h264.interlaceRefMode = 0;
    vObj->dynamicParams_h264.LongTermRefreshInterval = 0;
    vObj->dynamicParams_h264.UseLongTermFrame = 0;
    vObj->dynamicParams_h264.SetLongTermFrame = 0;
    vObj->dynamicParams_h264.VUI_Buffer = NULL;
    vObj->dynamicParams_h264.CustomScaleMatrix_Buffer = NULL;
    vObj->dynamicParams_h264.enableGDR = 0;
    vObj->dynamicParams_h264.GDRduration = 0;
    vObj->dynamicParams_h264.GDRinterval = 0;
    vObj->dynamicParams_h264.putDataGetSpaceFxn = NULL;//getEncodedSliceProvideSpace;
    vObj->dynamicParams_h264.dataSyncHandle = NULL;


    Thanks for any more idea.


  • Hi,

    We measured performance with IntraFrame Interval as 15 and 16, and we are not seeing any difference. We will check in system and let you know. And are you running single instance or multi?

    Thanks,

    Veeranna

  • Hi Veeranna,

    Thanks. Yes, we only run one H.264 encoder now. Could you also check the gop value with 5 or 6, seems it show better data than 16.

     

  • Hi Hermes,

    We tried with gop value as 5, 6 and 16 on dvtb, we are seeing expected numbers. GOP value 5 and 6 taking more cycles compare to 16. And we are not seeing any difference between 15 and 16, its almost same. 

    Can you once try by using latest encoder package(02.30.00.06) from http://software-dl.ti.com/dsps/dsps_public_sw/codecs/DM36x/index_FDS.html

    And which encQuality mode you are using?

    Thanks,

    Veeranna