mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-08 12:24:09 +00:00
obs-ffmpeg: Fix NVENC VBR maxBitRate set to avgBitrate
MaxBitrate gets correctly set during encoder init, and then promptly overwritten by nvenc_update, which set max = (avg)bitrate
This commit is contained in:
parent
f7d5d80b04
commit
e0293add61
|
@ -264,9 +264,14 @@ static bool nvenc_update(void *data, obs_data_t *settings)
|
|||
/* Only support reconfiguration of CBR bitrate */
|
||||
if (enc->can_change_bitrate) {
|
||||
int bitrate = (int)obs_data_get_int(settings, "bitrate");
|
||||
int max_bitrate =
|
||||
(int)obs_data_get_int(settings, "max_bitrate");
|
||||
bool vbr = (enc->config.rcParams.rateControlMode ==
|
||||
NV_ENC_PARAMS_RC_VBR);
|
||||
|
||||
enc->config.rcParams.averageBitRate = bitrate * 1000;
|
||||
enc->config.rcParams.maxBitRate = bitrate * 1000;
|
||||
enc->config.rcParams.maxBitRate = vbr ? max_bitrate * 1000
|
||||
: bitrate * 1000;
|
||||
|
||||
NV_ENC_RECONFIGURE_PARAMS params = {0};
|
||||
params.version = NV_ENC_RECONFIGURE_PARAMS_VER;
|
||||
|
|
Loading…
Reference in a new issue