Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Max Bitrate option #3628

Merged
merged 53 commits into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
660d8e1
Merge pull request #332 from LizardByte/nightly
ReenigneArcher Oct 30, 2022
1e6d9da
Merge pull request #456 from LizardByte/nightly
ReenigneArcher Oct 30, 2022
8509ee7
Merge pull request #458 from LizardByte/nightly
ReenigneArcher Oct 30, 2022
e1b112c
Merge pull request #460 from LizardByte/nightly
ReenigneArcher Oct 31, 2022
08d623c
Merge pull request #467 from LizardByte/nightly
ReenigneArcher Dec 14, 2022
b2fe042
Merge pull request #567 from LizardByte/nightly
ReenigneArcher Jan 9, 2023
b2c5da2
Merge pull request #738 from LizardByte/nightly
ReenigneArcher Jan 30, 2023
09dff34
Merge pull request #866 from LizardByte/nightly
ReenigneArcher Feb 1, 2023
446825b
Merge pull request #877 from LizardByte/nightly
ReenigneArcher Feb 13, 2023
9563419
Merge pull request #929 from LizardByte/nightly
ReenigneArcher Feb 14, 2023
0dfbcfd
Merge pull request #954 from LizardByte/nightly
ReenigneArcher Feb 21, 2023
483e225
Merge pull request #969 from LizardByte/nightly
ReenigneArcher Mar 30, 2023
d70d084
Merge pull request #1105 from LizardByte/nightly
ReenigneArcher Mar 30, 2023
31e8b79
Merge pull request #1115 from LizardByte/nightly
ReenigneArcher May 29, 2023
9cfa228
added max bitrate variable that overrides bitrate set by moonlight cl…
utkarshdalal Jul 22, 2023
6d39591
corrected syntax errors
utkarshdalal Jul 22, 2023
23fbeae
updated variable in publish.cpp for windows to build in github action
utkarshdalal Jul 22, 2023
d8b62ff
added empty line to force release
utkarshdalal Jul 22, 2023
72551fe
Updated description for max_bitrate param
utkarshdalal Jul 23, 2023
3fb13de
Addressed code review comments
utkarshdalal Jul 24, 2023
5f49733
Merge branch 'nightly' into add_max_bitrate
utkarshdalal Jul 24, 2023
3955d2d
Merge branch 'nightly' into add_max_bitrate
utkarshdalal Aug 28, 2023
5bca024
Merge pull request #1334 from LizardByte/nightly
ReenigneArcher Oct 16, 2023
415fe56
Merge pull request #3 from utkarshdalal/add_max_bitrate_2
utkarshdalal Nov 22, 2023
66e8b9f
Merge branch 'nightly' into master
utkarshdalal Nov 22, 2023
82416e8
changes to match remote nightly
utkarshdalal Nov 22, 2023
6c667e6
Merge remote-tracking branch 'upstream/master'
utkarshdalal Feb 1, 2025
fba3265
Latest (#8)
utkarshdalal Feb 1, 2025
c19ab77
changed ubuntu version to build to 24.04
utkarshdalal Feb 1, 2025
99c2152
added dependency so linux appimage builds
utkarshdalal Feb 1, 2025
96bae01
removed a library
utkarshdalal Feb 1, 2025
a2a3edf
no message
utkarshdalal Feb 1, 2025
62405b1
force .deb file to be built for linux
utkarshdalal Feb 1, 2025
30221b6
removed another library
utkarshdalal Feb 1, 2025
7cd3cb2
added libxext-dev as chatgpt suggested
utkarshdalal Feb 2, 2025
db4209e
removed extra args from linux build
utkarshdalal Feb 2, 2025
04a7765
removed random package deb call
utkarshdalal Feb 2, 2025
da48bb0
Merge branch 'LizardByte:master' into master
utkarshdalal Feb 3, 2025
6edc956
Trigger workflow
utkarshdalal Feb 3, 2025
0608cd8
Trigger workflow
utkarshdalal Feb 3, 2025
cd39b7e
Merge branch 'master' of https://github.com/utkarshdalal/Sunshine-Gam…
utkarshdalal Feb 3, 2025
bbc9734
reverted some code changes
utkarshdalal Feb 4, 2025
7c0a503
reverted changes to third-party repos
utkarshdalal Feb 4, 2025
5ab1322
reset more third-party libs
utkarshdalal Feb 4, 2025
d4fdb16
removed formatting changes from ci.yml
utkarshdalal Feb 4, 2025
39b9d43
unindent ci.yml file
utkarshdalal Feb 4, 2025
7a54574
Update src/video.cpp
utkarshdalal Feb 6, 2025
34e7c91
Update src_assets/common/assets/web/configs/tabs/audiovideo/DisplayMo…
utkarshdalal Feb 6, 2025
dc9bf2f
Update src/config.h
utkarshdalal Feb 6, 2025
224cd1e
Moved max_bitrate option to video
utkarshdalal Feb 9, 2025
e623411
Merge branch 'master' of https://github.com/utkarshdalal/Sunshine-Gam…
utkarshdalal Feb 9, 2025
c3c8285
added extra space for linting
utkarshdalal Feb 9, 2025
2bbcfcd
Merge branch 'master' into master
ReenigneArcher Feb 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,29 @@ editing the `conf` file in a text editor. Use the examples as reference.
</tr>
</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

<table>
Expand Down
4 changes: 3 additions & 1 deletion src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,8 @@ namespace config {
{} // wa
}, // display_device

1 // min_fps_factor
1, // min_fps_factor
0 // max_bitrate
};

audio_t audio {
Expand Down Expand Up @@ -1138,6 +1139,7 @@ namespace config {
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_f(vars, "max_bitrate", video.max_bitrate);

path_f(vars, "pkey", nvhttp.pkey);
path_f(vars, "cert", nvhttp.cert);
Expand Down
1 change: 1 addition & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ namespace config {
} 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
};

struct audio_t {
Expand Down
3 changes: 2 additions & 1 deletion src/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,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) << "Max bitrate is " << config::video.max_bitrate;
ctx->rc_max_rate = bitrate;
ctx->bit_rate = bitrate;

Expand Down
1 change: 1 addition & 0 deletions src_assets/common/assets/web/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ <h1 class="my-4">{{ $t('config.configuration') }}</h1>
"dd_mode_remapping": {"mixed": [], "resolution_only": [], "refresh_rate_only": []},
"dd_wa_hdr_toggle": "disabled",
"min_fps_factor": 1,
"max_bitrate": 0,
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
<div class="form-text">{{ $t('config.min_fps_factor_desc') }}</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>

<style scoped>
Expand Down
Loading