Add new nvenc options to legacy ffmpeg path
This commit is contained in:
@@ -953,6 +953,8 @@ namespace config {
|
|||||||
video.nv.two_pass == nvenc::nvenc_two_pass::full_resolution ? NV_ENC_TWO_PASS_FULL_RESOLUTION :
|
video.nv.two_pass == nvenc::nvenc_two_pass::full_resolution ? NV_ENC_TWO_PASS_FULL_RESOLUTION :
|
||||||
NV_ENC_MULTI_PASS_DISABLED;
|
NV_ENC_MULTI_PASS_DISABLED;
|
||||||
video.nv_legacy.h264_coder = video.nv.h264_cavlc ? NV_ENC_H264_ENTROPY_CODING_MODE_CAVLC : NV_ENC_H264_ENTROPY_CODING_MODE_CABAC;
|
video.nv_legacy.h264_coder = video.nv.h264_cavlc ? NV_ENC_H264_ENTROPY_CODING_MODE_CAVLC : NV_ENC_H264_ENTROPY_CODING_MODE_CABAC;
|
||||||
|
video.nv_legacy.aq = video.nv.adaptive_quantization;
|
||||||
|
video.nv_legacy.vbv_percentage_increase = video.nv.vbv_percentage_increase;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int_f(vars, "qsv_preset", video.qsv.qsv_preset, qsv::preset_from_view);
|
int_f(vars, "qsv_preset", video.qsv.qsv_preset, qsv::preset_from_view);
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ namespace config {
|
|||||||
int preset;
|
int preset;
|
||||||
int multipass;
|
int multipass;
|
||||||
int h264_coder;
|
int h264_coder;
|
||||||
|
int aq;
|
||||||
|
int vbv_percentage_increase;
|
||||||
} nv_legacy;
|
} nv_legacy;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|||||||
@@ -638,6 +638,7 @@ namespace video {
|
|||||||
{ "tune"s, NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY },
|
{ "tune"s, NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY },
|
||||||
{ "rc"s, NV_ENC_PARAMS_RC_CBR },
|
{ "rc"s, NV_ENC_PARAMS_RC_CBR },
|
||||||
{ "multipass"s, &config::video.nv_legacy.multipass },
|
{ "multipass"s, &config::video.nv_legacy.multipass },
|
||||||
|
{ "aq"s, &config::video.nv_legacy.aq },
|
||||||
},
|
},
|
||||||
// SDR-specific options
|
// SDR-specific options
|
||||||
{},
|
{},
|
||||||
@@ -658,6 +659,7 @@ namespace video {
|
|||||||
{ "tune"s, NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY },
|
{ "tune"s, NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY },
|
||||||
{ "rc"s, NV_ENC_PARAMS_RC_CBR },
|
{ "rc"s, NV_ENC_PARAMS_RC_CBR },
|
||||||
{ "multipass"s, &config::video.nv_legacy.multipass },
|
{ "multipass"s, &config::video.nv_legacy.multipass },
|
||||||
|
{ "aq"s, &config::video.nv_legacy.aq },
|
||||||
},
|
},
|
||||||
// SDR-specific options
|
// SDR-specific options
|
||||||
{
|
{
|
||||||
@@ -681,6 +683,7 @@ namespace video {
|
|||||||
{ "rc"s, NV_ENC_PARAMS_RC_CBR },
|
{ "rc"s, NV_ENC_PARAMS_RC_CBR },
|
||||||
{ "coder"s, &config::video.nv_legacy.h264_coder },
|
{ "coder"s, &config::video.nv_legacy.h264_coder },
|
||||||
{ "multipass"s, &config::video.nv_legacy.multipass },
|
{ "multipass"s, &config::video.nv_legacy.multipass },
|
||||||
|
{ "aq"s, &config::video.nv_legacy.aq },
|
||||||
},
|
},
|
||||||
// SDR-specific options
|
// SDR-specific options
|
||||||
{
|
{
|
||||||
@@ -1698,6 +1701,12 @@ namespace video {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ctx->rc_buffer_size = bitrate / config.framerate;
|
ctx->rc_buffer_size = bitrate / config.framerate;
|
||||||
|
|
||||||
|
#ifndef __APPLE__
|
||||||
|
if (encoder.name == "nvenc" && config::video.nv_legacy.vbv_percentage_increase > 0) {
|
||||||
|
ctx->rc_buffer_size += ctx->rc_buffer_size * config::video.nv_legacy.vbv_percentage_increase / 100;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user