diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2018-08-21 14:28:15 +0200 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2018-08-21 15:14:56 +0200 |
commit | dc2d56a66b8ad8bc5b07a5cc9c0608a67d5c2ae2 (patch) | |
tree | f7dc5ab09ab7119e01bab2b0303195399ec537eb | |
parent | 6972dae5a494fb69836343ea0e8d430769177c5d (diff) | |
download | ffmpeg-dc2d56a66b8ad8bc5b07a5cc9c0608a67d5c2ae2.tar.gz |
avcodec/nvenc: add option to turn off a53 closed caption embedding
-rw-r--r-- | libavcodec/nvenc.c | 2 | ||||
-rw-r--r-- | libavcodec/nvenc.h | 1 | ||||
-rw-r--r-- | libavcodec/nvenc_h264.c | 1 | ||||
-rw-r--r-- | libavcodec/version.h | 2 |
4 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index cfa7268a5e..e180d7b993 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -2107,7 +2107,7 @@ int ff_nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame) pic_params.inputTimeStamp = frame->pts; - if (av_frame_get_side_data(frame, AV_FRAME_DATA_A53_CC)) { + if (ctx->a53_cc && av_frame_get_side_data(frame, AV_FRAME_DATA_A53_CC)) { if (ff_alloc_a53_sei(frame, sizeof(NV_ENC_SEI_PAYLOAD), (void**)&sei_data, &sei_size) < 0) { av_log(ctx, AV_LOG_ERROR, "Not enough memory for closed captions, skipping\n"); } diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h index b29fbf282a..ebb7a80fc3 100644 --- a/libavcodec/nvenc.h +++ b/libavcodec/nvenc.h @@ -186,6 +186,7 @@ typedef struct NvencContext int weighted_pred; int coder; int b_ref_mode; + int a53_cc; } NvencContext; int ff_nvenc_encode_init(AVCodecContext *avctx); diff --git a/libavcodec/nvenc_h264.c b/libavcodec/nvenc_h264.c index d446f9b33c..a6623f5f35 100644 --- a/libavcodec/nvenc_h264.c +++ b/libavcodec/nvenc_h264.c @@ -137,6 +137,7 @@ static const AVOption options[] = { { "each", "", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, VE, "b_ref_mode" }, { "middle", "", 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, VE, "b_ref_mode" }, #endif + { "a53cc", "Use A53 Closed Captions (if available)", OFFSET(a53_cc), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE }, { NULL } }; diff --git a/libavcodec/version.h b/libavcodec/version.h index d0b207b065..2af25d3166 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #define LIBAVCODEC_VERSION_MAJOR 58 #define LIBAVCODEC_VERSION_MINOR 24 -#define LIBAVCODEC_VERSION_MICRO 100 +#define LIBAVCODEC_VERSION_MICRO 101 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ |