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.

[DM385] Video Quality of H264 encode

Other Parts Discussed in Thread: DM385

Hi, TI experters:

We find one problem with H264 encode.The encode video quality is so bad at some scene on the input video. Our system is working like this,SDI video input,Then capture and encode by dm385.I pause the input video at different scene ,and saved h264 file. the video quality of ok.h264 file is good,but  video quality of error.h264 is bad,looks like flicker. All the testing environment is the same,except the  scene on the input video I saved。Please tell why this happens?And how improve this?error.rarok.rar

  • Hi,Eason Wang ,thanks for your advise,I changed the value of qbmin&qbmax,and this question really has improved.But i have still 2 questions.
    1、 I feel troubled about the relationship between qb and targetbitrate,I set the targetBitRate to 10M,and rcType is VBR mode,save 180 frames to a file,when i changed the qb,the file size is changed too.The targetBitRate is useless?
    2、How do set CBR with the interlace resorution?I can set CBR with 1080P,but cann't set CBR with 1080i(the codec will hangs).
  • sunnyT said:
    1、 I feel troubled about the relationship between qb and targetbitrate,I set the targetBitRate to 10M,and rcType is VBR mode,save 180 frames to a file,when i changed the qb,the file size is changed too.The targetBitRate is useless?

    When rcType is  set to VBR, Qp will be used only for 1st frame/subframe. Better you set Qp as -1, let codec decide the appropriate QP. Change in Qp value will impact Rate control behavior so the file size change is expected(impact should be small).

    sunnyT said:
    2、How do set CBR with the interlace resorution?I can set CBR with 1080P,but cann't set CBR with 1080i(the codec will hangs).

    Encoder should not hang in any case. Setting CBR is possible for interlace video. Can you please send complete static and dynamic parameters?

    Thanks,

    Veeranna

  • HI,Veeranna,the static and dynamic parameters as below:
    pChPrm->enableAnalyticinfo = 0;
    pChPrm->enableWaterMarking = 0;
    pChPrm->enableSVCExtensionFlag = VENC_IH264_SVC_EXTENSION_FLAG_DISABLE;
    pChPrm->encodingPreset = VENC_XDM_USER_DEFINED;
    pChPrm->maxBitRate = -1;
    pChPrm->rcType = VENC_RATE_CTRL_CBR;
    pChPrm->numTemporalLayer = VENC_TEMPORAL_LAYERS_1;

    pDynPrm->frameRate = 60; // NOT USED
    pDynPrm->targetBitRate = 10000 * 1000;
    pDynPrm->intraFrameInterval = 15;//30;
    pDynPrm->inputFrameRate = pDynPrm->frameRate;
    pDynPrm->rcAlg = pChPrm->rcType; // MUST be same as pChPrm->rcType
    pDynPrm->qpMin = 10;
    pDynPrm->qpMax = 40;
    pDynPrm->qpInit = -1; // SHOULD BE SET to -1 ALWAYS
    pDynPrm->vbrDuration = 8;
    pDynPrm->vbrSensitivity = 0;
  • Hi Sunny,

    Can you send all the static and dynamic parameter including the input width and input height. Based on preivous sent parameters, we cant conclude anything .

    Regards
    Gajanan
  • Hi,Gajanan,the input width and input height parameter as below。when i set vbr with 1080i, the system is working well,But set cbr with 1080i,the system cannot work,I only changed the parameter pChPrm->rcType from VENC_RATE_CTRL_VBR to VENC_RATE_CTRL_CBR ,can you tell me how do set the CBR parameters with 1080i60?The resolution of 1080P can work well with VBR and CBR both.
    [m3video] enclink cmd 6
    [m3video] videnc2DynamicParams -> inputHeight : 540
    [m3video] videnc2DynamicParams -> inputWidth : 1920
    [m3video] videnc2DynamicParams -> refFrameRate : 30000
    [m3video] videnc2DynamicParams -> targetFrameRate : 30000
    [m3video] videnc2DynamicParams -> targetBitRate : 20000000
    [m3video] videnc2DynamicParams -> intraFrameInterval : 15
    [m3video] videnc2DynamicParams -> generateHeader : 0
    [m3video] videnc2DynamicParams -> captureWidth : 1920
    [m3video] videnc2DynamicParams -> forceFrame : -1
    [m3video] videnc2DynamicParams -> interFrameInterval : 1
    [m3video] videnc2DynamicParams -> mvAccuracy : 2
    [m3video] videnc2DynamicParams -> sampleAspectRatioHeight : 1
    [m3video] videnc2DynamicParams -> sampleAspectRatioWidth : 1
    [m3video] videnc2DynamicParams -> ignoreOutbufSizeFlag : 1
    [m3video] videnc2DynamicParams -> lateAcquireArg : -1
  • Hi sunny,

    Interlace coding is not supported with CBR(Low Delay). So it should not hang but give an error

    "IH264ENC_EXTERROR_RATECTRL_RCALGO_INTERLACE_OR_BFRAME".

    Regards

    Gajanan