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.

Run time changing configuration parameters of DEI and Encoder in capture_encode demo of EZSDK5.05.01.04

Hello All,

I am using capture_encode demo available in ezsdk_dm814x-evm_5_05_01_04 on DM8148 EVM, in which i want to use DEI as scaler and want to scale down resolution run time. To elaborate my use case more, I have below requirement:

Capture ---> DEI as scaler ---> Encoder

I want to keep capture resolution same but want to scale down capture resolution using DEI and then want to encode the scaled down resolution. As i want to change the above mentioned configuration run-time, I tried using OMX_SetConfig OMX api as shown below code:

  OMX_VIDEO_CONFIG_DYNAMICPARAMS tDynParams;
  OMX_CONFIG_VIDCHANNEL_RESOLUTION chResolution;

      OMX_INIT_PARAM (&chResolution);
      /* first output to display */
      chResolution.Frm0Width = scaled_nWidth;
      chResolution.Frm0Height = scaled_nHeight;
      chResolution.Frm0Pitch = scaled_nWidth * 2;

      /* second output to encode */
      chResolution.Frm1Width = scaled_nWidth;
      chResolution.Frm1Height = scaled_nHeight;
      chResolution.Frm1Pitch  = scaled_nWidth;
      chResolution.FrmStartX  = 0;
      chResolution.FrmStartY  = 0;
      chResolution.FrmCropWidth = 0;
      chResolution.FrmCropHeight = 0;
      chResolution.FrmCropWidth = 0;
      chResolution.FrmCropHeight = 0;
      chResolution.eDir = OMX_DirOutput;
      chResolution.nChId = 0;

      eError = OMX_SetConfig (pAppData->pDeiHandle,
                              (OMX_INDEXTYPE) OMX_TI_IndexConfigVidChResolution,
                              &chResolution);
      if (eError != OMX_ErrorNone)
      {
        ERROR ("failed to set output channel resolution\n");
      }
      else
      {
        printf ("set output resolution to %dx%d\n", scaled_nWidth, scaled_nHeight);
      }

      OMX_INIT_PARAM (&tDynParams);

      tDynParams.nPortIndex = OMX_VIDENC_OUTPUT_PORT;

      eError = OMX_GetConfig (pAppData->pEncHandle, OMX_TI_IndexParamVideoDynamicParams,
                              &tDynParams);

      /* setting resolution (width x height)*/
      tDynParams.videoDynamicParams.h264EncDynamicParams.videnc2DynamicParams.inputWidth = scaled_nWidth;
      tDynParams.videoDynamicParams.h264EncDynamicParams.videnc2DynamicParams.inputHeight = scaled_nHeight;

      eError = OMX_SetConfig (pAppData->pEncHandle, OMX_TI_IndexParamVideoDynamicParams,
                              &tDynParams);

I am able to set encoder's dynamic parameters and it results me as expected but DEI dynamic parameters doesn't result well. I guess there is some issue of pitch as my chroma is shifted to some wrong positions and results me green overlapped video.

Can any one guide me to resolve this issue ?

Regards,

Hitesh