[FFmpeg-cvslog] avcodec/nvenc: provide nvenc with monotonic frame index

Timo Rothenpieler git at videolan.org
Mon Apr 1 01:48:22 EEST 2024


ffmpeg | branch: master | Timo Rothenpieler <timo at rothenpieler.org> | Mon Apr  1 00:43:23 2024 +0200| [271a0a55bcc5b5dac471aedbb5cd446cb645547c] | committer: Timo Rothenpieler

avcodec/nvenc: provide nvenc with monotonic frame index

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=271a0a55bcc5b5dac471aedbb5cd446cb645547c
---

 libavcodec/nvenc.c | 1 +
 libavcodec/nvenc.h | 2 ++
 2 files changed, 3 insertions(+)

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;



More information about the ffmpeg-cvslog mailing list