Skip to content

Conversation

@psyke83
Copy link
Contributor

@psyke83 psyke83 commented Dec 10, 2021

  • 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 change greatly increases stream quality on my system. Before the vbv-bufsize change, there would be consistently blurry details for complex or dark scenes (such as foliage or details on far away rocks), especially during movement. Additionally, monitoring of incoming bandwidth to the moonlight-qt client showed a consistent failure to reach the requested bandwidth for intensive scenes.

With the patch, complex details are much better preserved, and the client bandwidth consistently stays at the requested bitrate (which was overshooting by 20%) for intensive scenes. I tested various resolutions and bitrate combinations to ensure the adjusted vbv-bufsize value was not causing vbv-maxrate to be exceeded.

* 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.
@psyke83 psyke83 changed the title video: use a better vbv-bufsize & correctly software bitrate calculation video: use a better vbv-bufsize & correct software bitrate calculation Dec 10, 2021
@psyke83 psyke83 closed this Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant