From 27f71c389518ab83ade959be94a3293736667454 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 27 Jun 2025 18:17:15 -0400 Subject: [PATCH] fix(video): base min frame time strictly on client framerate (#3844) --- docs/configuration.md | 29 ------------------- src/config.cpp | 2 -- src/config.h | 1 - src/video.cpp | 6 ++-- src_assets/common/assets/web/config.html | 1 - .../tabs/audiovideo/DisplayModesSettings.vue | 7 ----- .../assets/web/public/assets/locale/en.json | 2 -- 7 files changed, 3 insertions(+), 45 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index ef248643..36237f0d 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1363,35 +1363,6 @@ editing the `conf` file in a text editor. Use the examples as reference. -### min_fps_factor - - - - - - - - - - - - - - - - - - -
Description - Sunshine will use this factor to calculate the minimum time between frames. Increasing this value may help - when streaming mostly static content. - @warning{Higher values will consume more bandwidth.} -
Default@code{} - 1 - @endcode
Range1-3
Example@code{} - min_fps_factor = 1 - @endcode
- ## Network ### upnp diff --git a/src/config.cpp b/src/config.cpp index 7147fd6c..89a5a445 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -504,7 +504,6 @@ namespace config { {} // wa }, // display_device - 1, // min_fps_factor 0 // max_bitrate }; @@ -1143,7 +1142,6 @@ namespace config { video.dd.wa.hdr_toggle_delay = std::chrono::milliseconds {value}; } - int_between_f(vars, "min_fps_factor", video.min_fps_factor, {1, 3}); int_f(vars, "max_bitrate", video.max_bitrate); path_f(vars, "pkey", nvhttp.pkey); diff --git a/src/config.h b/src/config.h index 066b95df..2e088ea7 100644 --- a/src/config.h +++ b/src/config.h @@ -140,7 +140,6 @@ namespace config { workarounds_t wa; } dd; - int min_fps_factor; // Minimum fps target, determines minimum frame time int max_bitrate; // Maximum bitrate, sets ceiling in kbps for bitrate requested from client }; diff --git a/src/video.cpp b/src/video.cpp index 0ff4d740..b4e3c147 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -1875,9 +1875,9 @@ namespace video { } }); - // set minimum frame time, avoiding violation of client-requested target framerate - auto minimum_frame_time = std::chrono::milliseconds(1000 / std::min(config.framerate, (config::video.min_fps_factor * 10))); - BOOST_LOG(debug) << "Minimum frame time set to "sv << minimum_frame_time.count() << "ms, based on min fps factor of "sv << config::video.min_fps_factor << "."sv; + // set minimum frame time based on client-requested target framerate + std::chrono::duration minimum_frame_time {1000.0 / config.framerate}; + BOOST_LOG(info) << "Minimum frame time set to "sv << minimum_frame_time.count() << "ms, based on client-requested target framerate "sv << config.framerate << "."sv; auto shutdown_event = mail->event(mail::shutdown); auto packets = mail::man->queue(mail::video_packets); diff --git a/src_assets/common/assets/web/config.html b/src_assets/common/assets/web/config.html index f021fd71..6e766e93 100644 --- a/src_assets/common/assets/web/config.html +++ b/src_assets/common/assets/web/config.html @@ -178,7 +178,6 @@ "dd_config_revert_on_disconnect": "disabled", "dd_mode_remapping": {"mixed": [], "resolution_only": [], "refresh_rate_only": []}, "dd_wa_hdr_toggle_delay": 0, - "min_fps_factor": 1, "max_bitrate": 0, }, }, diff --git a/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue b/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue index 2bf997ba..25b12deb 100644 --- a/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue +++ b/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue @@ -11,13 +11,6 @@ const config = ref(props.config)