From d5b0a8e5030652244f16c2fa6bb7a53a5a76240f Mon Sep 17 00:00:00 2001 From: Timo Rothenpieler Date: Fri, 30 Oct 2020 17:21:13 +0100 Subject: [PATCH] avcodec/nvenc: only auto-pick vbr rc in cq mode --- libavcodec/nvenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index e8b29fabee..b4a0a5bf0a 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -908,7 +908,7 @@ static av_cold void nvenc_setup_rate_control(AVCodecContext *avctx) ctx->rc = NV_ENC_PARAMS_RC_CBR; } else if (ctx->cqp >= 0) { ctx->rc = NV_ENC_PARAMS_RC_CONSTQP; - } else { + } else if (ctx->quality >= 0.0f) { ctx->rc = NV_ENC_PARAMS_RC_VBR; } }