26 #define OFFSET(x) offsetof(NvencContext, x)
27 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
46 {
"level",
"Set the encoding level restriction",
OFFSET(
level),
AV_OPT_TYPE_INT, { .i64 = NV_ENC_LEVEL_AUTOSELECT }, NV_ENC_LEVEL_AUTOSELECT, NV_ENC_LEVEL_HEVC_62,
VE,
"level" },
47 {
"auto",
"", 0,
AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AUTOSELECT }, 0, 0,
VE,
"level" },
67 {
"tier",
"Set the encoding tier",
OFFSET(tier),
AV_OPT_TYPE_INT, { .i64 = NV_ENC_TIER_HEVC_MAIN }, NV_ENC_TIER_HEVC_MAIN, NV_ENC_TIER_HEVC_HIGH,
VE,
"tier"},
70 {
"rc",
"Override the preset rate-control",
OFFSET(rc),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX,
VE,
"rc" },
71 {
"constqp",
"Constant QP mode", 0,
AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_CONSTQP }, 0, 0,
VE,
"rc" },
72 {
"vbr",
"Variable bitrate mode", 0,
AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_VBR }, 0, 0,
VE,
"rc" },
73 {
"cbr",
"Constant bitrate mode", 0,
AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_CBR }, 0, 0,
VE,
"rc" },
74 {
"vbr_minqp",
"Variable bitrate mode with MinQP (deprecated)", 0,
AV_OPT_TYPE_CONST, { .i64 =
RCD(NV_ENC_PARAMS_RC_VBR_MINQP) }, 0, 0,
VE,
"rc" },
75 {
"ll_2pass_quality",
"Multi-pass optimized for image quality (deprecated)",
77 {
"ll_2pass_size",
"Multi-pass optimized for constant frame size (deprecated)",
79 {
"vbr_2pass",
"Multi-pass variable bitrate mode (deprecated)", 0,
AV_OPT_TYPE_CONST, { .i64 =
RCD(NV_ENC_PARAMS_RC_2_PASS_VBR) }, 0, 0,
VE,
"rc" },
80 {
"cbr_ld_hq",
"Constant bitrate low delay high quality mode", 0,
AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_CBR_LOWDELAY_HQ }, 0, 0,
VE,
"rc" },
81 {
"cbr_hq",
"Constant bitrate high quality mode", 0,
AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_CBR_HQ }, 0, 0,
VE,
"rc" },
82 {
"vbr_hq",
"Variable bitrate high quality mode", 0,
AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_VBR_HQ }, 0, 0,
VE,
"rc" },
83 {
"rc-lookahead",
"Number of frames to look ahead for rate-control",
88 {
"gpu",
"Selects which NVENC capable GPU to use. First GPU is 0, second is 1, and so on.",
92 {
"delay",
"Delay frame output by the given amount of frames",
94 {
"no-scenecut",
"When lookahead is enabled, set this to 1 to disable adaptive I-frame insertion at scene cuts",
96 {
"forced-idr",
"If forcing keyframes, force them as IDR frames.",
100 {
"zerolatency",
"Set 1 to indicate zero latency operation (no reordering delay)",
102 {
"nonref_p",
"Set this to 1 to enable automatic insertion of non-reference P-frames",
104 {
"strict_gop",
"Set 1 to minimize GOP-to-GOP rate fluctuations",
106 {
"aq-strength",
"When Spatial AQ is enabled, this field is used to specify AQ strength. AQ strength scale is from 1 (low) - 15 (aggressive)",
108 {
"cq",
"Set target quality level (0 to 51, 0 means automatic) for constant quality mode in VBR rate control",
111 {
"bluray-compat",
"Bluray compatibility workarounds",
OFFSET(bluray_compat),
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1,
VE },
115 {
"qp",
"Constant quantization parameter rate control method",
117 {
"weighted_pred",
"Set 1 to enable weighted prediction",
119 #ifdef NVENC_HAVE_HEVC_BFRAME_REF_MODE
120 {
"b_ref_mode",
"Use B frames as references",
OFFSET(b_ref_mode),
AV_OPT_TYPE_INT, { .i64 = NV_ENC_BFRAME_REF_MODE_DISABLED }, NV_ENC_BFRAME_REF_MODE_DISABLED, NV_ENC_BFRAME_REF_MODE_MIDDLE,
VE,
"b_ref_mode" },
121 {
"disabled",
"B frames will not be used for reference", 0,
AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_DISABLED }, 0, 0,
VE,
"b_ref_mode" },
122 {
"each",
"Each B frame will be used for reference", 0,
AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_EACH }, 0, 0,
VE,
"b_ref_mode" },
123 {
"middle",
"Only (number of B frames)/2 will be used for reference", 0,
AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_MIDDLE }, 0, 0,
VE,
"b_ref_mode" },
125 {
"b_ref_mode",
"(not supported)",
OFFSET(b_ref_mode),
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX,
VE,
"b_ref_mode" },
146 #if FF_API_NVENC_OLD_NAME
162 .
name =
"nvenc_hevc",
177 .wrapper_name =
"nvenc",
190 .
name =
"hevc_nvenc",
205 .wrapper_name =
"nvenc",