feat: Add Max Bitrate option (#3628)
This commit is contained in:
parent
ff0ed25e47
commit
3a88ddc639
6 changed files with 37 additions and 2 deletions
|
|
@ -509,7 +509,8 @@ namespace config {
|
|||
{} // wa
|
||||
}, // display_device
|
||||
|
||||
1 // min_fps_factor
|
||||
1, // min_fps_factor
|
||||
0 // max_bitrate
|
||||
};
|
||||
|
||||
audio_t audio {
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -1687,7 +1687,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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue