1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

avcodec/nvenc: add option to turn off a53 closed caption embedding

This commit is contained in:
Timo Rothenpieler
2018-08-21 14:28:15 +02:00
parent 6972dae5a4
commit dc2d56a66b
4 changed files with 4 additions and 2 deletions

View File

@@ -2107,7 +2107,7 @@ int ff_nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame)
pic_params.inputTimeStamp = frame->pts; 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) { 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"); av_log(ctx, AV_LOG_ERROR, "Not enough memory for closed captions, skipping\n");
} }

View File

@@ -186,6 +186,7 @@ typedef struct NvencContext
int weighted_pred; int weighted_pred;
int coder; int coder;
int b_ref_mode; int b_ref_mode;
int a53_cc;
} NvencContext; } NvencContext;
int ff_nvenc_encode_init(AVCodecContext *avctx); int ff_nvenc_encode_init(AVCodecContext *avctx);

View File

@@ -137,6 +137,7 @@ static const AVOption options[] = {
{ "each", "", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, VE, "b_ref_mode" }, { "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" }, { "middle", "", 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, VE, "b_ref_mode" },
#endif #endif
{ "a53cc", "Use A53 Closed Captions (if available)", OFFSET(a53_cc), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE },
{ NULL } { NULL }
}; };

View File

@@ -29,7 +29,7 @@
#define LIBAVCODEC_VERSION_MAJOR 58 #define LIBAVCODEC_VERSION_MAJOR 58
#define LIBAVCODEC_VERSION_MINOR 24 #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, \ #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \ LIBAVCODEC_VERSION_MINOR, \