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.

RTOS/TDA2EVM5777: VSDK H264 Encoder Link configuration to send SPS and PPS on a given interval of IDR frames

Part Number: TDA2EVM5777

Tool/software: TI-RTOS

Is it possible to configure the H264 encoder such that SPS and PPS are sent on a given interval of IDR frames?

I have configured the encoder to send all IDR frames as follows:

if (hObj->staticParams.videnc2Params.encodingPreset == XDM_USER_DEFINED){
    hObj->dynamicParams.videnc2DynamicParams.intraFrameInterval = 1;
    hObj->dynamicParams.videnc2DynamicParams.interFrameInterval = 1;
    hObj->staticParams.videnc2Params.maxInterFrameInterval = 1;
    hObj->dynamicParams.rateControlParams.maxPicSizeRatioI = 0;
}

With the above configuration the stream is as follows:

SPS | PPS | IDR | SPS | PPS | IDR | SPS | PPS | IDR | ...

Basically, all frames are sent as IDR frames and each IDR frame is prefixed with corresponding SPS and PPS.

However, I want to configure the stream such that SPS and PPS is sent only after a fixed number of IDR frames.

For example:

□ SPS num_frames_refs = 3

SPS | PPS | IDR | IDR | IDR | SPS | PPS | IDR | IDR | IDR | SPS | PPS | IDR | IDR | IDR | 

I cannot find such setting and documentation in the user guide and source code.
Because of this, may I ask if this is possible and if so may I ask reference to the correct settings to do this?

  • Hello Norman,

    If you are ok Using I-frames in between as "SPS | PPS | IDR | I | I | I | SPS | PPS | IDR | I |..." Then set IDRFrameInterval = 3.

    Also you can refer Appendix B - Control for Configurable NALU in UserGuide. It explains the configurable NAL unit support by encoder.


  • Thank you for the response.

    Although I would like to clarify my understanding regarding the use of I frames in the sequence.
    Since I have an outstanding requirement that the stream GOP size should be 1, I would like to confirm my confusion on GOP definition with respect to the suggested stream format above.

    My previous understanding is that GOP size is the distance between two IDR frames. Thus using I frames (which I believe will be encoded as NON-IDR in the suggested format) will break the GOP size.

    Apparently, this is incorrect.

    Rather, GOP size is the distance between two full frames (in this case I frame). Thus GOP size of 1 still holds true in the suggested format above.

    May I get your expect confirmation regarding this matter?

  • Hello Norman,

    Norman S. said:

    Rather, GOP size is the distance between two full frames (in this case I frame). Thus GOP size of 1 still holds true in the suggested format above.

    May I get your expect confirmation regarding this matter?

    This is correct. GOP size will be 1.

    You can set IDRFrameInterval = 3 along with your existing parameter setup 

    Norman S. said:
    1
    2
    3
    4
    5
    6
    if (hObj->staticParams.videnc2Params.encodingPreset == XDM_USER_DEFINED){
        hObj->dynamicParams.videnc2DynamicParams.intraFrameInterval = 1;
        hObj->dynamicParams.videnc2DynamicParams.interFrameInterval = 1;
        hObj->staticParams.videnc2Params.maxInterFrameInterval = 1;
        hObj->dynamicParams.rateControlParams.maxPicSizeRatioI = 0;
    }