From 8f97e32227083da457d158f126de61e37730bcfd Mon Sep 17 00:00:00 2001 From: jp9000 Date: Tue, 24 Aug 2021 19:41:43 -0700 Subject: [PATCH] UI: Allow overriding keyframe interval if smaller Allows the ability to override the default keyframe interval via advanced output mode as long as that interval is smaller than the recommended keyframe interval. Fixes an issue where it was impossible to set a lower keyframe interval than the recommended keyframe interval. --- UI/window-basic-main-outputs.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/UI/window-basic-main-outputs.cpp b/UI/window-basic-main-outputs.cpp index 25bede848..917ad1449 100644 --- a/UI/window-basic-main-outputs.cpp +++ b/UI/window-basic-main-outputs.cpp @@ -1343,10 +1343,16 @@ void AdvancedOutput::UpdateStreamSettings() if (applyServiceSettings) { int bitrate = (int)obs_data_get_int(settings, "bitrate"); + int keyint_sec = (int)obs_data_get_int(settings, "keyint_sec"); obs_service_apply_encoder_settings(main->GetService(), settings, nullptr); if (!enforceBitrate) obs_data_set_int(settings, "bitrate", bitrate); + + int enforced_keyint_sec = + (int)obs_data_get_int(settings, "keyint_sec"); + if (keyint_sec != 0 && keyint_sec < enforced_keyint_sec) + obs_data_set_int(settings, "keyint_sec", keyint_sec); } if (dynBitrate && astrcmpi(streamEncoder, "jim_nvenc") == 0)