aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2021-12-24 12:32:47 +0800
committerTimo Rothenpieler <timo@rothenpieler.org>2021-12-25 14:12:26 +0100
commit0c8741f819018c9a0820d7272052de4a43cd6f95 (patch)
treecdeb95193be1c6ed0cc2e013cdc5acfd92ff4c90
parentf3a949dc4c6f01f43d502cbe2a7c06fe95114c79 (diff)
downloadffmpeg-0c8741f819018c9a0820d7272052de4a43cd6f95.tar.gz
avcodec/nvenc: add udu_sei option to import user data unregistered SEIs
Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
-rw-r--r--libavcodec/nvenc.c3
-rw-r--r--libavcodec/nvenc.h1
-rw-r--r--libavcodec/nvenc_h264.c2
-rw-r--r--libavcodec/nvenc_hevc.c2
-rw-r--r--libavcodec/version.h2
5 files changed, 9 insertions, 1 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index edc46ed33a..31dfed9241 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -2217,6 +2217,9 @@ static int prepare_sei_data_array(AVCodecContext *avctx, const AVFrame *frame)
}
}
+ if (!ctx->udu_sei)
+ return sei_count;
+
for (i = 0; i < frame->nb_side_data; i++) {
AVFrameSideData *side_data = frame->side_data[i];
void *tmp;
diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h
index 08531e1be3..b42a156c56 100644
--- a/libavcodec/nvenc.h
+++ b/libavcodec/nvenc.h
@@ -235,6 +235,7 @@ typedef struct NvencContext
int intra_refresh;
int single_slice_intra_refresh;
int constrained_encoding;
+ int udu_sei;
} NvencContext;
int ff_nvenc_encode_init(AVCodecContext *avctx);
diff --git a/libavcodec/nvenc_h264.c b/libavcodec/nvenc_h264.c
index 7d78aa0d87..89e9a043fc 100644
--- a/libavcodec/nvenc_h264.c
+++ b/libavcodec/nvenc_h264.c
@@ -188,6 +188,8 @@ static const AVOption options[] = {
#endif
{ "extra_sei", "Pass on extra SEI data (e.g. a53 cc) to be included in the bitstream",
OFFSET(extra_sei), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE },
+ { "udu_sei", "Pass on user data unregistered SEI if available",
+ OFFSET(udu_sei), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
{ "intra-refresh","Use Periodic Intra Refresh instead of IDR frames",
OFFSET(intra_refresh),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
{ "single-slice-intra-refresh", "Use single slice intra refresh",
diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c
index a13ac5a395..c2c13bb210 100644
--- a/libavcodec/nvenc_hevc.c
+++ b/libavcodec/nvenc_hevc.c
@@ -169,6 +169,8 @@ static const AVOption options[] = {
#endif
{ "extra_sei", "Pass on extra SEI data (e.g. a53 cc) to be included in the bitstream",
OFFSET(extra_sei), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE },
+ { "udu_sei", "Pass on user data unregistered SEI if available",
+ OFFSET(udu_sei), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
{ "intra-refresh","Use Periodic Intra Refresh instead of IDR frames",
OFFSET(intra_refresh),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
{ "single-slice-intra-refresh", "Use single slice intra refresh",
diff --git a/libavcodec/version.h b/libavcodec/version.h
index db71fb1130..580b099b36 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
#define LIBAVCODEC_VERSION_MAJOR 59
#define LIBAVCODEC_VERSION_MINOR 15
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \