mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-02-06 09:39:50 +00:00
video: use a better vbv-bufsize & correct software bitrate calculation
* Increase vbv-bufsize to 1/10 of requested bitrate. The previous value was too low, which was resulting in poor encoding quality and failure to stabilize at the requested bitrate. Setting to 1/10 of bitrate is a good compromise, as it avoids quality loss but also prevents bandwidth spikes far above the bitrate/vbv-maxrate. * With vbv-bufsize set to a more appropriate value, testing shows that the average bitrate vs client-requested bandwidth overshoots by ~20%. Adjust for this scenario in the software encoding case only.
This commit is contained in:
parent
ac7fcfe056
commit
1b6bf8fa34
@ -930,9 +930,9 @@ std::optional<session_t> make_session(const encoder_t &encoder, const config_t &
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(video_format[encoder_t::CBR]) {
|
if(video_format[encoder_t::CBR]) {
|
||||||
auto bitrate = config.bitrate * 1000;
|
auto bitrate = config.bitrate * (hardware ? 1000 : 800); // software bitrate overshoots by ~20%
|
||||||
ctx->rc_max_rate = bitrate;
|
ctx->rc_max_rate = bitrate;
|
||||||
ctx->rc_buffer_size = bitrate / config.framerate;
|
ctx->rc_buffer_size = bitrate / 10;
|
||||||
ctx->bit_rate = bitrate;
|
ctx->bit_rate = bitrate;
|
||||||
ctx->rc_min_rate = bitrate;
|
ctx->rc_min_rate = bitrate;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user