diff --git a/plugins/obs-outputs/ftl-stream.c b/plugins/obs-outputs/ftl-stream.c index 12edb53579af90..630309a3bd4f9a 100644 --- a/plugins/obs-outputs/ftl-stream.c +++ b/plugins/obs-outputs/ftl-stream.c @@ -442,16 +442,18 @@ static void set_peak_bitrate(struct ftl_stream *stream) user_desired_bitrate, results.peak_kbps, results.starting_rtt, results.ending_rtt, percent_lost); - // We still want to set the peak to about 1.2x what the target bitrate is, + // We want to set the peak to at least 1.2x what the target bitrate is, // even if the speed test reported it should be lower. If we don't, FTL // will queue data on the client and start adding latency. If the internet // connection really can't handle the bitrate the user will see either lost frame // and recovered frame counts go up, which is reflect in the dropped_frames count. int min_bitrate = user_desired_bitrate * 12 / 10; - if (results.peak_kbps > min_bitrate) + // Assume we can use a significant percentage of the available bandwidth + int peak_usable_bitrate = results.peak_kbps * 8 / 10; + + if (peak_usable_bitrate > min_bitrate) { - // Assume we can use a large percentage of the available bandwidth - stream->peak_kbps = stream->params.peak_kbps = results.peak_kbps * 8 / 10; + stream->peak_kbps = stream->params.peak_kbps = peak_usable_bitrate; } else {