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.

Why High profile encode failed in EZSDK5.3?



I use capture_encode demo. and EZSDK5.3:

 

tProfileLevel.eProfile = OMX_VIDEO_AVCProfileHigh;

  tProfileLevel.eLevel = OMX_VIDEO_AVCLevel42;

  eError = OMX_SetParameter (pHandle, OMX_IndexParamVideoProfileLevelCurrent,&tProfileLevel);

 

 

but the profile of the  encoded file is baseline profile.

I use this parameter in ezsdk5.2,it works.is this a new bug?

 

I have tried many profile ,but no one work!!!

 

//tProfileLevel.eProfile = OMX_VIDEO_AVCProfileBaseline;

  //tProfileLevel.eProfile = OMX_VIDEO_AVCProfileHigh;

  tProfileLevel.eProfile = OMX_VIDEO_AVCProfileMain;

  tProfileLevel.eLevel = OMX_VIDEO_AVCLevel42;

 

  • HW:DM8168

    SDK:ezsdk5.03

    DEMO:capture_encode

     

  • Hi,

    Can you print out the codec paramter for codec creation call see if the paramer is passed to codec?

  • hi,chris:

    I dont know how to print out the codec paramter for codec creation call see if the paramer is passed to codec?

     

    my code is as:

     

    OMX_ERRORTYPE IL_ClientSetEncodeParams (IL_Client *pAppData)

    {

      OMX_ERRORTYPE eError = OMX_ErrorUndefined;

      OMX_HANDLETYPE pHandle = NULL;

      OMX_VIDEO_PARAM_PROFILELEVELTYPE tProfileLevel;

      OMX_VIDEO_PARAM_ENCODER_PRESETTYPE tEncoderPreset;

      OMX_VIDEO_PARAM_BITRATETYPE tVidEncBitRate;

      OMX_VIDEO_PARAM_PORTFORMATTYPE tVideoParams;

      OMX_PARAM_PORTDEFINITIONTYPE tPortDef;

      OMX_VIDEO_CONFIG_DYNAMICPARAMS tDynParams;

      OMX_VIDEO_PARAM_STATICPARAMS   tStaticParam;

      pHandle = pAppData->pEncHandle;

      /* Number of frames to be encoded */

      pAppData->encILComp->numFrames = pAppData->nEncodedFrms;

      /* Set the profile and level for H264 */

      OMX_INIT_PARAM (&tProfileLevel);

      tProfileLevel.nPortIndex = OMX_VIDENC_OUTPUT_PORT;

      eError = OMX_GetParameter (pHandle, OMX_IndexParamVideoProfileLevelCurrent, &tProfileLevel);

      tProfileLevel.eProfile = OMX_VIDEO_AVCProfileHigh;

      tProfileLevel.eLevel = OMX_VIDEO_AVCLevel42;


      eError = OMX_SetParameter (pHandle, OMX_IndexParamVideoProfileLevelCurrent, &tProfileLevel);

      if (eError != OMX_ErrorNone)

        ERROR ("failed to set encoder pfofile \n");

      eError = OMX_GetParameter (pHandle, OMX_IndexParamVideoProfileLevelCurrent,&tProfileLevel);

      printf("tProfileLevel.eProfile  %d",tProfileLevel.eProfile );

      /* Encoder Preset settings */

      OMX_INIT_PARAM (&tEncoderPreset);

      tEncoderPreset.nPortIndex = OMX_VIDENC_OUTPUT_PORT;

      eError = OMX_GetParameter (pHandle, OMX_TI_IndexParamVideoEncoderPreset,  &tEncoderPreset);

      tEncoderPreset.eEncodingModePreset = OMX_Video_Enc_High_Quality;//OMX_Video_Enc_Med_Speed_High_Quality;

      tEncoderPreset.eRateControlPreset = OMX_Video_RC_Storage;//OMX_Video_RC_Low_Delay;

      eError = OMX_SetParameter (pHandle, OMX_TI_IndexParamVideoEncoderPreset,  &tEncoderPreset);

      if (eError != OMX_ErrorNone)

      {

        ERROR ("failed to Encoder Preset \n");

      }

      OMX_INIT_PARAM (&tPortDef);

      /* Get the Number of Ports */

      tPortDef.nPortIndex = OMX_VIDENC_INPUT_PORT;

      eError = OMX_GetParameter (pHandle, OMX_IndexParamPortDefinition, &tPortDef);

      /* set the actual number of buffers required */

      tPortDef.nBufferCountActual = IL_CLIENT_ENC_INPUT_BUFFER_COUNT;

      /* set the video format settings */

      tPortDef.format.video.nFrameWidth = pAppData->nWidth;

      tPortDef.format.video.nStride = pAppData->nWidth;

      tPortDef.format.video.nFrameHeight = pAppData->nHeight;

      tPortDef.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;

      /* settings for OMX_IndexParamVideoPortFormat */

      tPortDef.nBufferSize = (pAppData->nWidth * pAppData->nHeight * 3) >> 1;

      eError = OMX_SetParameter (pHandle, OMX_IndexParamPortDefinition, &tPortDef);

      if (eError != OMX_ErrorNone)

      {

        ERROR ("failed to set Encode OMX_IndexParamPortDefinition for input \n");

      }

      OMX_INIT_PARAM (&tPortDef);

      tPortDef.nPortIndex = OMX_VIDENC_OUTPUT_PORT;

      eError = OMX_GetParameter (pHandle, OMX_IndexParamPortDefinition, &tPortDef);

      /* settings for OMX_IndexParamPortDefinition */

      /* set the actual number of buffers required */

      tPortDef.nBufferCountActual = IL_CLIENT_ENC_OUTPUT_BUFFER_COUNT;

      tPortDef.format.video.nFrameWidth = pAppData->nWidth;

      tPortDef.format.video.nFrameHeight = pAppData->nHeight;

      tPortDef.format.video.eCompressionFormat = OMX_VIDEO_CodingAVC;

      tPortDef.format.video.xFramerate = (pAppData->nFrameRate << 16);

      tVideoParams.xFramerate = (pAppData->nFrameRate << 16);

      tPortDef.format.video.nBitrate = pAppData->nBitRate;

      /* settings for OMX_IndexParamVideoPortFormat */

      eError = OMX_SetParameter (pHandle, OMX_IndexParamPortDefinition, &tPortDef);

      if (eError != OMX_ErrorNone)

      {

        ERROR ("failed to set Encode OMX_IndexParamPortDefinition for output \n");

      }

      /* For changing bit rate following index can be used */

      OMX_INIT_PARAM (&tVidEncBitRate);

      tVidEncBitRate.nPortIndex = OMX_DirOutput;

      eError = OMX_GetParameter (pHandle, OMX_IndexParamVideoBitrate,

                                 &tVidEncBitRate);


      tVidEncBitRate.eControlRate =OMX_Video_ControlRateConstant;// OMX_Video_ControlRateDisable;

      tVidEncBitRate.nTargetBitrate = pAppData->nBitRate;

      eError = OMX_SetParameter (pHandle, OMX_IndexParamVideoBitrate,

                                 &tVidEncBitRate);

      if (eError != OMX_ErrorNone)

      {

        ERROR ("failed to set Encode bitrate \n");

      }

      /* before creating use set_parameters, for run-time change use set_config

         all codec supported parameters can be set using this index       */

      OMX_INIT_PARAM (&tDynParams);

      tDynParams.nPortIndex = OMX_VIDENC_OUTPUT_PORT;

      eError = OMX_GetParameter (pHandle, OMX_TI_IndexParamVideoDynamicParams,

                                 &tDynParams);

      /* setting I frame interval */

      tDynParams.videoDynamicParams.h264EncDynamicParams.videnc2DynamicParams.intraFrameInterval = 90;

      eError = OMX_SetParameter (pHandle, OMX_TI_IndexParamVideoDynamicParams, &tDynParams);

      return eError;

    }

  • Feng,

    I assume above proble is resolved, as you had same query in other post. Let me know if it still persists.

    Vimal