diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index 05cb148504..b6c5ed3e6b 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -2784,6 +2784,7 @@ static int nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame) pic_params.encodePicFlags = 0; } + pic_params.frameIdx = ctx->frame_idx_counter++; pic_params.inputTimeStamp = frame->pts; if (ctx->extra_sei) { diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h index 45860de722..85ecaf1b5f 100644 --- a/libavcodec/nvenc.h +++ b/libavcodec/nvenc.h @@ -226,6 +226,8 @@ typedef struct NvencContext void *nvencoder; + uint32_t frame_idx_counter; + int preset; int profile; int level;