[FFmpeg-devel] [PATCH v3 1/3] avcodec/nvenc: Enable recovery point SEI for intra refresh mode

Zhao Zhili quinkblack at foxmail.com
Thu Jan 23 16:12:00 EET 2025


From: Zhao Zhili <zhilizhao at tencent.com>

Otherwise all frames can be dropped after seek without the
output_corrupt/showall flags.
---
 libavcodec/nvenc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 06e3fb81a4..68b1b661e4 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -1247,6 +1247,7 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx)
         h264->intraRefreshPeriod = cc->gopLength;
         h264->intraRefreshCnt = cc->gopLength - 1;
         cc->gopLength = NVENC_INFINITE_GOPLENGTH;
+        h264->outputRecoveryPointSEI = 1;
 #ifdef NVENC_HAVE_SINGLE_SLICE_INTRA_REFRESH
         h264->singleSliceIntraRefresh = ctx->single_slice_intra_refresh;
 #endif
@@ -1380,6 +1381,7 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx)
         hevc->intraRefreshPeriod = cc->gopLength;
         hevc->intraRefreshCnt = cc->gopLength - 1;
         cc->gopLength = NVENC_INFINITE_GOPLENGTH;
+        hevc->outputRecoveryPointSEI = 1;
 #ifdef NVENC_HAVE_SINGLE_SLICE_INTRA_REFRESH
         hevc->singleSliceIntraRefresh = ctx->single_slice_intra_refresh;
 #endif
-- 
2.46.0



More information about the ffmpeg-devel mailing list