Merge remote-tracking branch 'sunshine/master'

This commit is contained in:
Yukino Song
2025-02-15 04:32:32 +08:00
10 changed files with 45 additions and 5 deletions

View File

@@ -1316,6 +1316,29 @@ editing the `conf` file in a text editor. Use the examples as reference.
</tr> </tr>
</table> </table>
### max_bitrate
<table>
<tr>
<td>Description</td>
<td colspan="2">
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.
</td>
</tr>
<tr>
<td>Default</td>
<td colspan="2">@code{}
0
@endcode</td>
</tr>
<tr>
<td>Example</td>
<td colspan="2">@code{}
max_bitrate = 5000
@endcode</td>
</tr>
</table>
### min_fps_factor ### min_fps_factor
<table> <table>

View File

@@ -10,12 +10,12 @@
"dependencies": { "dependencies": {
"@lizardbyte/shared-web": "2024.921.191855", "@lizardbyte/shared-web": "2024.921.191855",
"vue": "3.5.13", "vue": "3.5.13",
"vue-i18n": "11.0.1" "vue-i18n": "11.1.1"
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "4.6.2", "@vitejs/plugin-vue": "4.6.2",
"serve": "14.2.3", "serve": "14.2.3",
"vite": "4.5.2", "vite": "4.5.9",
"vite-plugin-ejs": "1.6.4" "vite-plugin-ejs": "1.6.4"
} }
} }

View File

@@ -1,2 +1,2 @@
Babel==2.16.0 Babel==2.17.0
clang-format clang-format

View File

@@ -513,7 +513,10 @@ namespace config {
{}, // mode_remapping {}, // mode_remapping
{} // wa {} // wa
}, // display_device }, // display_device
1, // min_fps_factor 1, // min_fps_factor
0 // max_bitrate
"1920x1080x60", // fallback_mode "1920x1080x60", // fallback_mode
}; };
@@ -1183,6 +1186,7 @@ namespace config {
bool_f(vars, "dd_wa_hdr_toggle", video.dd.wa.hdr_toggle); bool_f(vars, "dd_wa_hdr_toggle", video.dd.wa.hdr_toggle);
int_between_f(vars, "min_fps_factor", video.min_fps_factor, {1, 3}); int_between_f(vars, "min_fps_factor", video.min_fps_factor, {1, 3});
int_f(vars, "max_bitrate", video.max_bitrate);
string_f(vars, "fallback_mode", video.fallback_mode); string_f(vars, "fallback_mode", video.fallback_mode);
path_f(vars, "pkey", nvhttp.pkey); path_f(vars, "pkey", nvhttp.pkey);

View File

@@ -141,6 +141,8 @@ namespace config {
} dd; } dd;
int min_fps_factor; // Minimum fps target, determines minimum frame time 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
std::string fallback_mode; std::string fallback_mode;
}; };

View File

@@ -1711,7 +1711,8 @@ namespace video {
} }
} }
auto bitrate = config.bitrate * 1000; auto bitrate = ((config::video.max_bitrate > 0) ? std::min(config.bitrate, config::video.max_bitrate) : config.bitrate) * 1000;
BOOST_LOG(info) << "Streaming bitrate is " << bitrate;
ctx->rc_max_rate = bitrate; ctx->rc_max_rate = bitrate;
ctx->bit_rate = bitrate; ctx->bit_rate = bitrate;

View File

@@ -201,6 +201,7 @@
"headless_mode": "disabled", "headless_mode": "disabled",
"double_refreshrate": "disabled", "double_refreshrate": "disabled",
"min_fps_factor": 1, "min_fps_factor": 1,
"max_bitrate": 0,
}, },
}, },
{ {

View File

@@ -17,6 +17,13 @@ const config = ref(props.config)
<input type="number" min="1" max="3" class="form-control" id="min_fps_factor" placeholder="1" v-model="config.min_fps_factor" /> <input type="number" min="1" max="3" class="form-control" id="min_fps_factor" placeholder="1" v-model="config.min_fps_factor" />
<div class="form-text">{{ $t('config.min_fps_factor_desc') }}</div> <div class="form-text">{{ $t('config.min_fps_factor_desc') }}</div>
</div> </div>
<!--max_bitrate-->
<div class="mb-3">
<label for="max_bitrate" class="form-label">{{ $t("config.max_bitrate") }}</label>
<input type="number" class="form-control" id="max_bitrate" placeholder="0" v-model="config.max_bitrate" />
<div class="form-text">{{ $t("config.max_bitrate_desc") }}</div>
</div>
</template> </template>
<style scoped> <style scoped>

View File

@@ -308,6 +308,8 @@
"log_level_desc": "The minimum log level printed to standard out", "log_level_desc": "The minimum log level printed to standard out",
"log_path": "Logfile Path", "log_path": "Logfile Path",
"log_path_desc": "The file where the current logs of Apollo are stored.", "log_path_desc": "The file where the current logs of Apollo are stored.",
"max_bitrate": "Maximum Bitrate",
"max_bitrate_desc": "The maximum bitrate (in Kbps) that Apollo will encode the stream at. If set to 0, it will always use the bitrate requested by Artemis/Moonlight.",
"min_fps_factor": "Minimum FPS Factor", "min_fps_factor": "Minimum FPS Factor",
"min_fps_factor_desc": "Apollo 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.", "min_fps_factor_desc": "Apollo 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.",
"min_threads": "Minimum CPU Thread Count", "min_threads": "Minimum CPU Thread Count",