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.

DM814x Force First H.264 Frame using OMX

Hello all,

Could someone tell me if it is possible to force the generation of a 'first frame' of H.264 data (the frame containing the SPS/PPS data).

At arbitrary points in my encoding I want to regenerate the SPS/PPS data but I can't find any examples on how to do this.

In my application I ran a test to see if generating continuous I-frames would be sufficient but if I do not write the very first I-frame to my elementary stream file my H.264 parser and player cannot process the stream.

Regards,

Danny

  • Hello,

    You could check the H264 user guild.
    /component-sources/omx_05_02_00_48/src/ti/omx/docs

    Best Regards,
    Margarita
  • Hi Danny,
    You can force the next frame to be encoded as IDR frame by setting "forceFrame" of VIDENC2_DynamicParams to IVIDEO_IDR_FRAME.
    you can try the following code to force IDR frame arbitrarily.

    OMX_VIDEO_CONFIG_DYNAMICPARAMS tDynParams;
    OMX_INIT_PARAM (&tDynParams);

    tDynParams.nPortIndex = OMX_VIDENC_OUTPUT_PORT;

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

    /* Force IDR frame */
    tDynParams.videoDynamicParams.h264EncDynamicParams.videnc2DynamicParams.forceFrame = IVIDEO_IDR_FRAME;

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

    Thanks
  • Hello Ramprasad,

    Thank you very much for the hint. I have been trying to solve this by generating I-frames dynamically but hadn't spotted the generation of IDR frames.

    I shall confirm the behaviour next week after I have implemented the changes to my application.

    Regards,

    Danny