]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/nvenc: add option to turn off a53 closed caption embedding
authorTimo Rothenpieler <timo@rothenpieler.org>
Tue, 21 Aug 2018 12:28:15 +0000 (14:28 +0200)
committerTimo Rothenpieler <timo@rothenpieler.org>
Tue, 21 Aug 2018 13:14:56 +0000 (15:14 +0200)
libavcodec/nvenc.c
libavcodec/nvenc.h
libavcodec/nvenc_h264.c
libavcodec/version.h

index cfa7268a5ebfccc4c5fd9763c6a03f2713d462b8..e180d7b99380fa79f85cad7e5ccd9b9f74f8f7f4 100644 (file)
@@ -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");
             }
index b29fbf282a154a5678222c22fb79597a3f531a13..ebb7a80fc327a67eb1a6f20c21b7433ce3e6b0e4 100644 (file)
@@ -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);
index d446f9b33cc1c0bcbb4ac548e852299f08e48dce..a6623f5f35acd623424819f4ce78ae0ebf69d8b3 100644 (file)
@@ -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 }
 };
 
index d0b207b0656c63185f39a7ae0b27328dfb0dca08..2af25d316649ef8ce3c64a3e5fdd6cd2df512ce6 100644 (file)
@@ -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, \