aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2024-04-01 00:43:23 +0200
committerTimo Rothenpieler <timo@rothenpieler.org>2024-04-01 00:46:12 +0200
commit271a0a55bcc5b5dac471aedbb5cd446cb645547c (patch)
tree2be5f33c4d3eaf14753eb662e9cc261b2c9387f7
parentc06e9e289f1e26b779ea46e435ed0ad243a2cd0d (diff)
downloadffmpeg-271a0a55bcc5b5dac471aedbb5cd446cb645547c.tar.gz
avcodec/nvenc: provide nvenc with monotonic frame index
-rw-r--r--libavcodec/nvenc.c1
-rw-r--r--libavcodec/nvenc.h2
2 files changed, 3 insertions, 0 deletions
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;