NVENC generates IDR frames when reconfiguring the codec with a new framerate

I’m using CBR encoding and my application is calling nvEncReconfigureEncoder often to update the framerate being generated that is not always stable.

Every time there is a call to nvEncReconfigureEncoder with a different framerate the next frame is an IDR even if that is not requested in the Reconfigure parameters and neither in the Encode parameters.

Is there any way to avoid that to save bandwidth and resources by not sending so many IDR frames?

Thank you.

Thank you for reporting this issue. We are looking into this. How often you need to change framerate? Can you share more details about the encoder settings you use?


We need to change the framerate very often, it is a real time streaming application and the framerate of video can change because of different reasons (bad network conditions, unstable video source…) so in certain circunstances i’m seeing several changes of framerate per second with the consequence of sending that many IDRs per second.

These is part of the initial configuration:

EncoderInitParams.encodeGUID = NV_ENC_CODEC_H264_GUID;
EncoderInitParams.frameRateNum = Encoder.MaxFramerate;
EncoderInitParams.frameRateDen = 1;
EncoderInitParams.enablePTD = 1;
EncoderInitParams.reportSliceOffsets = 0;
EncoderInitParams.enableSubFrameWrite = 0;

When changing the framerate we update the frameRateNum to the new value, copy that structure to NV_ENC_RECONFIGURE_PARAMS and calling nvEncReconfigureEncoder.

Is there any other config you need?

Thank you very much

Thanks you. I have filed an internal enhancement request tracked as 200631126.
We may consider this for future release.