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.

inserted I frame after changing rate change?



Dear Experts,

We are studying video encode function with dynamic data rate changing.

that case, it is inserted I frame after changing rate change.

Is it normal behavior?

Is it possible to change behavior for not inserting I frame?

Note:

We try to print out I frame information when change bitrate.

Result: It will produce I frame when change bitrate.

Int32 EncLinkH264_algSetConfig(EncLink_algObj * algObj) {

        ……….

        if (algObj->u.h264AlgIfObj.dynamicParams.videnc2DynamicParams.forceFrame ==IVIDEO_IDR_FRAME)

        {

                Vps_printf("%s %d %d\n",__FUNCTION__,__LINE__,algObj->u.h264AlgIfObj.dynamicParams.videnc2DynamicParams.forceFrame); <<< add this log to check I frame.

        }

thx ~

HB

  • Hello,

    What is the software release that you are using here?

    The bitrate, framerate, resolution etc could be change but  change in resolution will result in IDR insertion. Change in bit rate may insert IDR if HRD parameters are coded as part of bit-stream. Similarly if timing info related parameters are coded in bit-stream then it can cause insertion of IDR by doing change in frame rate.

    I would recommend you to check the h264enc user guide for more information. 

    Best Regards,

    Margarita

  • You will not find any info in h264Encoder User guide for this issue.

    Bitrate changes causes IDR frame insertion is a combination of encoder issue + encoder settings. TO resolve the issue pls do the following:

    1. Migrate to H264 encoder release REL.500.V.H264AVC.E.IVAHD.02.00.08.00. For new target bitrate to take effect HRDBufferSize and initialBufferLevel need to be updated along with targetBitrate according to formula initialBufferLevel  = HRDBufferSize = 2 * targetBitRate.
    There is an issue with the encoder,that it inserts IDR frame when initialBufferLevel is modified. This issue is resolved in REL.500.V.H264AVC.E.IVAHD.02.00.08.00 release where it internally updates vbvLevel without inserting IDR frame.

    2. Set hrdParamsPresentFlag & timingInfoPresentFlag to 0 in the enclink_set_static_params. Note that with this you will not have timing info in the H264 elementary stream

    3. Comment out call to EncLink_h264EncoderReset if present in your codebase for targetBitrate update setting.

     

  • Note that the rate control algorithm takes some time (typically 0.5 to 1 sec) to latch to new targetbitrate. So continuous bitrate update causes the rate controller to get reset constantly and bitrate will never settle.The behavior does _not_ dependent on the whether targetbitrate update is small amount.So don't do frequent bitrate updates else targetBitrate will never settle. This is independent of IDR frame insertion.

  • Dear Badri,

    We found problem. (If need, we can issue another thread)

    We didn't upgrade codec to latest version. (We are using REL.500.V.H264AVC.E.IVAHD.02.00.04.01).

    We follow two comments:

    2. Set hrdParamsPresentFlag & timingInfoPresentFlag to 0 in the enclink_set_static_params. Note that with this you will not have timing info in the H264 elementary stream

    3. Comment out call to EncLink_h264EncoderReset if present in your codebase for targetBitrate update setting.

    When we comment out "EncLink_h264EncoderReset" to avoid I frame insertion issue, but bit rate is not changed anymore.

    We can change bit rate only when we reserve "EncLink_h264EncoderReset".

    Is it codec version problem?

    HB

  • As I mentioned to update targetBitRate you have to set new vbvBufLevel using the formula before

    "For new target bitrate to take effect HRDBufferSize and initialBufferLevel need to be updated along with targetBitrate according to formula initialBufferLevel  = HRDBufferSize = 2 * targetBitRate."

    However updating initialBufferSize will result in IFrame insertion.

    The only option is to migrate to the release I mentioned which changes encoder behavior to not insert I frame.