Skip to content

Commit 27f71c3

Browse files
fix(video): base min frame time strictly on client framerate (#3844)
1 parent 2f27a57 commit 27f71c3

File tree

7 files changed

+3
-45
lines changed

7 files changed

+3
-45
lines changed

docs/configuration.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,35 +1363,6 @@ editing the `conf` file in a text editor. Use the examples as reference.
13631363
</tr>
13641364
</table>
13651365

1366-
### min_fps_factor
1367-
1368-
<table>
1369-
<tr>
1370-
<td>Description</td>
1371-
<td colspan="2">
1372-
Sunshine will use this factor to calculate the minimum time between frames. Increasing this value may help
1373-
when streaming mostly static content.
1374-
@warning{Higher values will consume more bandwidth.}
1375-
</td>
1376-
</tr>
1377-
<tr>
1378-
<td>Default</td>
1379-
<td colspan="2">@code{}
1380-
1
1381-
@endcode</td>
1382-
</tr>
1383-
<tr>
1384-
<td>Range</td>
1385-
<td colspan="2">1-3</td>
1386-
</tr>
1387-
<tr>
1388-
<td>Example</td>
1389-
<td colspan="2">@code{}
1390-
min_fps_factor = 1
1391-
@endcode</td>
1392-
</tr>
1393-
</table>
1394-
13951366
## Network
13961367

13971368
### upnp

src/config.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,6 @@ namespace config {
504504
{} // wa
505505
}, // display_device
506506

507-
1, // min_fps_factor
508507
0 // max_bitrate
509508
};
510509

@@ -1143,7 +1142,6 @@ namespace config {
11431142
video.dd.wa.hdr_toggle_delay = std::chrono::milliseconds {value};
11441143
}
11451144

1146-
int_between_f(vars, "min_fps_factor", video.min_fps_factor, {1, 3});
11471145
int_f(vars, "max_bitrate", video.max_bitrate);
11481146

11491147
path_f(vars, "pkey", nvhttp.pkey);

src/config.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ namespace config {
140140
workarounds_t wa;
141141
} dd;
142142

143-
int min_fps_factor; // Minimum fps target, determines minimum frame time
144143
int max_bitrate; // Maximum bitrate, sets ceiling in kbps for bitrate requested from client
145144
};
146145

src/video.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,9 +1875,9 @@ namespace video {
18751875
}
18761876
});
18771877

1878-
// set minimum frame time, avoiding violation of client-requested target framerate
1879-
auto minimum_frame_time = std::chrono::milliseconds(1000 / std::min(config.framerate, (config::video.min_fps_factor * 10)));
1880-
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;
1878+
// set minimum frame time based on client-requested target framerate
1879+
std::chrono::duration<double, std::milli> minimum_frame_time {1000.0 / config.framerate};
1880+
BOOST_LOG(info) << "Minimum frame time set to "sv << minimum_frame_time.count() << "ms, based on client-requested target framerate "sv << config.framerate << "."sv;
18811881

18821882
auto shutdown_event = mail->event<bool>(mail::shutdown);
18831883
auto packets = mail::man->queue<packet_t>(mail::video_packets);

src_assets/common/assets/web/config.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ <h1 class="my-4">{{ $t('config.configuration') }}</h1>
178178
"dd_config_revert_on_disconnect": "disabled",
179179
"dd_mode_remapping": {"mixed": [], "resolution_only": [], "refresh_rate_only": []},
180180
"dd_wa_hdr_toggle_delay": 0,
181-
"min_fps_factor": 1,
182181
"max_bitrate": 0,
183182
},
184183
},

src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@ const config = ref(props.config)
1111
</script>
1212

1313
<template>
14-
<!--min_fps_factor-->
15-
<div class="mb-3">
16-
<label for="qp" class="form-label">{{ $t('config.min_fps_factor') }}</label>
17-
<input type="number" min="1" max="3" class="form-control" id="min_fps_factor" placeholder="1" v-model="config.min_fps_factor" />
18-
<div class="form-text">{{ $t('config.min_fps_factor_desc') }}</div>
19-
</div>
20-
2114
<!--max_bitrate-->
2215
<div class="mb-3">
2316
<label for="max_bitrate" class="form-label">{{ $t("config.max_bitrate") }}</label>

src_assets/common/assets/web/public/assets/locale/en.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,6 @@
256256
"log_path_desc": "The file where the current logs of Sunshine are stored.",
257257
"max_bitrate": "Maximum Bitrate",
258258
"max_bitrate_desc": "The maximum bitrate (in Kbps) that Sunshine will encode the stream at. If set to 0, it will always use the bitrate requested by Moonlight.",
259-
"min_fps_factor": "Minimum FPS Factor",
260-
"min_fps_factor_desc": "Sunshine will use this factor to calculate the minimum time between frames. Increasing this value slightly may help when streaming mostly static content. Higher values will consume more bandwidth.",
261259
"min_threads": "Minimum CPU Thread Count",
262260
"min_threads_desc": "Increasing the value slightly reduces encoding efficiency, but the tradeoff is usually worth it to gain the use of more CPU cores for encoding. The ideal value is the lowest value that can reliably encode at your desired streaming settings on your hardware.",
263261
"misc": "Miscellaneous options",

0 commit comments

Comments
 (0)