summaryrefslogtreecommitdiff
path: root/libavcodec/nvenc.c
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2022-11-05 21:18:36 +0100
committerTimo Rothenpieler <timo@rothenpieler.org>2022-11-05 21:18:36 +0100
commit6362b8cd19c72f5b7b58709729afac2a965c3e37 (patch)
treeae374e8cc1eaa88f355cee0caa3a544f2d1c1ca6 /libavcodec/nvenc.c
parent5c288a44ad16087c3d3a7563490cb634790e751f (diff)
avcodec/nvenc: set correct "sei" payload type for AV1
Diffstat (limited to 'libavcodec/nvenc.c')
-rw-r--r--libavcodec/nvenc.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 8228c66f64..0d1d68d70d 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -24,6 +24,9 @@
#include "nvenc.h"
#include "hevc_sei.h"
+#if CONFIG_AV1_NVENC_ENCODER
+#include "av1.h"
+#endif
#include "libavutil/hwcontext_cuda.h"
#include "libavutil/hwcontext.h"
@@ -2306,8 +2309,15 @@ static int prepare_sei_data_array(AVCodecContext *avctx, const AVFrame *frame)
} else {
ctx->sei_data = tmp;
ctx->sei_data[sei_count].payloadSize = (uint32_t)a53_size;
- ctx->sei_data[sei_count].payloadType = 4;
ctx->sei_data[sei_count].payload = (uint8_t*)a53_data;
+
+#if CONFIG_AV1_NVENC_ENCODER
+ if (avctx->codec->id == AV_CODEC_ID_AV1)
+ ctx->sei_data[sei_count].payloadType = AV1_METADATA_TYPE_ITUT_T35;
+ else
+#endif
+ ctx->sei_data[sei_count].payloadType = SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35;
+
sei_count++;
}
}
@@ -2332,8 +2342,15 @@ static int prepare_sei_data_array(AVCodecContext *avctx, const AVFrame *frame)
} else {
ctx->sei_data = tmp;
ctx->sei_data[sei_count].payloadSize = (uint32_t)tc_size;
- ctx->sei_data[sei_count].payloadType = SEI_TYPE_TIME_CODE;
ctx->sei_data[sei_count].payload = (uint8_t*)tc_data;
+
+#if CONFIG_AV1_NVENC_ENCODER
+ if (avctx->codec->id == AV_CODEC_ID_AV1)
+ ctx->sei_data[sei_count].payloadType = AV1_METADATA_TYPE_TIMECODE;
+ else
+#endif
+ ctx->sei_data[sei_count].payloadType = SEI_TYPE_TIME_CODE;
+
sei_count++;
}
}