mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-14 22:22:59 +02:00
avcodec/nvenc: add option to disable all extra SEI data
With these triggering a lot of crashes recently, an option to globally disable all of them is added as a tool to work around those crashes in case the SEI data is not needed by the user. Also re-enables s12m for hevc_nvenc, since the issue is not specifically with that, but it affects all SEI data. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
This commit is contained in:
parent
c67f354be8
commit
8bcce5673a
@ -2325,10 +2325,12 @@ static int nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame)
|
|||||||
|
|
||||||
pic_params.inputTimeStamp = frame->pts;
|
pic_params.inputTimeStamp = frame->pts;
|
||||||
|
|
||||||
res = prepare_sei_data_array(avctx, frame);
|
if (ctx->extra_sei) {
|
||||||
if (res < 0)
|
res = prepare_sei_data_array(avctx, frame);
|
||||||
return res;
|
if (res < 0)
|
||||||
sei_count = res;
|
return res;
|
||||||
|
sei_count = res;
|
||||||
|
}
|
||||||
|
|
||||||
nvenc_codec_specific_pic_params(avctx, &pic_params, ctx->sei_data, sei_count);
|
nvenc_codec_specific_pic_params(avctx, &pic_params, ctx->sei_data, sei_count);
|
||||||
} else {
|
} else {
|
||||||
|
@ -222,6 +222,7 @@ typedef struct NvencContext
|
|||||||
int tuning_info;
|
int tuning_info;
|
||||||
int multipass;
|
int multipass;
|
||||||
int ldkfs;
|
int ldkfs;
|
||||||
|
int extra_sei;
|
||||||
} NvencContext;
|
} NvencContext;
|
||||||
|
|
||||||
int ff_nvenc_encode_init(AVCodecContext *avctx);
|
int ff_nvenc_encode_init(AVCodecContext *avctx);
|
||||||
|
@ -182,6 +182,8 @@ static const AVOption options[] = {
|
|||||||
{ "ldkfs", "Low delay key frame scale; Specifies the Scene Change frame size increase allowed in case of single frame VBV and CBR",
|
{ "ldkfs", "Low delay key frame scale; Specifies the Scene Change frame size increase allowed in case of single frame VBV and CBR",
|
||||||
OFFSET(ldkfs), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UCHAR_MAX, VE },
|
OFFSET(ldkfs), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UCHAR_MAX, VE },
|
||||||
#endif
|
#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 },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ static const AVOption options[] = {
|
|||||||
{ "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 },
|
{ "a53cc", "Use A53 Closed Captions (if available)", OFFSET(a53_cc), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE },
|
||||||
{ "s12m_tc", "Use timecode (if available)", OFFSET(s12m_tc), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
|
{ "s12m_tc", "Use timecode (if available)", OFFSET(s12m_tc), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE },
|
||||||
{ "dpb_size", "Specifies the DPB size used for encoding (0 means automatic)",
|
{ "dpb_size", "Specifies the DPB size used for encoding (0 means automatic)",
|
||||||
OFFSET(dpb_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
|
OFFSET(dpb_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
|
||||||
#ifdef NVENC_HAVE_MULTIPASS
|
#ifdef NVENC_HAVE_MULTIPASS
|
||||||
@ -163,6 +163,8 @@ static const AVOption options[] = {
|
|||||||
{ "ldkfs", "Low delay key frame scale; Specifies the Scene Change frame size increase allowed in case of single frame VBV and CBR",
|
{ "ldkfs", "Low delay key frame scale; Specifies the Scene Change frame size increase allowed in case of single frame VBV and CBR",
|
||||||
OFFSET(ldkfs), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UCHAR_MAX, VE },
|
OFFSET(ldkfs), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UCHAR_MAX, VE },
|
||||||
#endif
|
#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 },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#define LIBAVCODEC_VERSION_MAJOR 59
|
#define LIBAVCODEC_VERSION_MAJOR 59
|
||||||
#define LIBAVCODEC_VERSION_MINOR 1
|
#define LIBAVCODEC_VERSION_MINOR 1
|
||||||
#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, \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user