diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2022-12-08 12:31:00 +0100 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2022-12-08 12:40:51 +0100 |
commit | a1b534bf8320ddbd416a9a1c9feaf29448dd1fc9 (patch) | |
tree | b2e4ae5b5045fc2435f52bcba0297dc6a1ecb5e3 | |
parent | e228a0cccd31c2466ea968f34be4ec0da50bd792 (diff) | |
download | ffmpeg-a1b534bf8320ddbd416a9a1c9feaf29448dd1fc9.tar.gz |
avcodec/nvenc: fix vbv buffer size in cq mode
The CQ calculation gets thrown off and behaves very nonsensical
if it isn't set to 0.
-rw-r--r-- | libavcodec/nvenc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index 0b0b5d79bb..ff018fef5f 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -920,8 +920,9 @@ static av_cold void nvenc_setup_rate_control(AVCodecContext *avctx) av_log(avctx, AV_LOG_VERBOSE, "CQ(%d) mode enabled.\n", tmp_quality); - //CQ mode shall discard avg bitrate & honor max bitrate; + // CQ mode shall discard avg bitrate/vbv buffer size and honor only max bitrate ctx->encode_config.rcParams.averageBitRate = avctx->bit_rate = 0; + ctx->encode_config.rcParams.vbvBufferSize = avctx->rc_buffer_size = 0; ctx->encode_config.rcParams.maxBitRate = avctx->rc_max_rate; } } |