From b4bc8d96df583312922081a3bef1feb07a5dcb02 Mon Sep 17 00:00:00 2001 From: eiqnepm <86803173+eiqnepm@users.noreply.github.com> Date: Fri, 14 Jul 2023 18:15:28 +0100 Subject: [PATCH] set max_bitrate to match bitrate when using vbr --- Classes/Recorders/LibObsRecorder.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Classes/Recorders/LibObsRecorder.cs b/Classes/Recorders/LibObsRecorder.cs index 2206ac00..b8a77c13 100644 --- a/Classes/Recorders/LibObsRecorder.cs +++ b/Classes/Recorders/LibObsRecorder.cs @@ -385,6 +385,9 @@ private IntPtr GetVideoEncoder(string encoder, string rateControl) { } obs_data_set_string(videoEncoderSettings, "rate_control", rate_controls[rateControl]); obs_data_set_int(videoEncoderSettings, "bitrate", (uint)SettingsService.Settings.captureSettings.bitRate * 1000); + if (SettingsService.Settings.captureSettings.rateControl == "VBR") { + obs_data_set_int(videoEncoderSettings, "max_bitrate", (uint)SettingsService.Settings.captureSettings.bitRate * 1000); + } IntPtr encoderPtr = obs_video_encoder_create(encoder_ids[encoder], "Replays Recorder", videoEncoderSettings, IntPtr.Zero); obs_data_release(videoEncoderSettings); return encoderPtr;