Fix NVENC Falling Back To VBR In CBR Mode

This commit is contained in:
copecone committed 2026-10-16 16:28:49 +09:00
1 parent 46fc00df9c
commit 064bd816e8
1 file changed
+8
+8
View File
@@ -1080,6 +1080,14 @@ namespace ADOFAIRenderer.Util.FFmpeg
{ {
TrySetOption("x265-params", "hrd=1:strict-cbr=1"); TrySetOption("x265-params", "hrd=1:strict-cbr=1");
} }
// NVENC: without "rc", nvenc_setup_rate_control selects CONSTQP when "qp" is set and VBR otherwise;
// bit_rate and rc_max_rate being equal does not select CBR. "rc=cbr" selects NV_ENC_PARAMS_RC_CBR.
// Reference: https://github.com/FFmpeg/FFmpeg/blob/release/8.0/libavcodec/nvenc.c (nvenc_setup_rate_control),
// https://github.com/FFmpeg/FFmpeg/blob/release/8.0/libavcodec/nvenc_h264.c ("rc" option, "cbr" constant)
else if (encoder.Kind == EncoderKind.NVENC)
{
TrySetOption("rc", "cbr");
}
} }
break; break;