How can i forcing current frame to be encoded as intra frame using libavcodec

Viewed 293
1 Answers

If the AVFrame->pict_type is set to AV_PICTURE_TYPE_I, then the NVENC encoders, by default, will encode it as an intra frame. They also have a private option to force it as an IDR frame.

For the latter, add before opening the encoder.

av_opt_set(avctx->priv_data, "forced_idr", "1", 0);
Related