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

preemptive use of the bandwidth-limit in video encoders #1957

Closed
totaam opened this issue Sep 12, 2018 · 10 comments
Closed

preemptive use of the bandwidth-limit in video encoders #1957

totaam opened this issue Sep 12, 2018 · 10 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Sep 12, 2018

Issue migrated from trac ticket # 1957

component: encodings | priority: major | resolution: worksforme

2018-09-12 09:27:44: antoine created the issue


The bandwidth-limit is used to raise the batch delay (variable refresh rate) so that we stay within budget (and that in turns has an effect on quality and speed), but we should pass the information down to the video encoders so that they can be tuned adequately earlier.

This bitrate constraint overrules the speed and quality settings so this should only be applied when the bandwidth-limit is relatively low.

Somewhat related to #1951, #1840, #1952

@totaam
Copy link
Collaborator Author

totaam commented Sep 12, 2018

2018-09-12 09:46:56: antoine changed owner from antoine to maxmylyn

@totaam
Copy link
Collaborator Author

totaam commented Sep 12, 2018

2018-09-12 09:46:56: antoine edited the issue description

@totaam
Copy link
Collaborator Author

totaam commented Sep 12, 2018

2018-09-12 09:46:56: antoine commented


Done in r20399 for x264 and vpx.
We only use the bandwidth-limit value when speed and quality are on "auto" and when min-quality is lower than 50%.

  • vpx will cap its bitrate attribute using the bandwidth-limit
  • x264 switches from CRF mode (aka "contant quality" - more info here: CRF Guide) to VBV mode (aka "constrained encoding ", see Understanding Rate Control Modes (x264, x265, vpx)) - but only when the bandwidth-limit is lower than 5Mbps

The change also improves the amount of x264 encoder configuration details shown in xpra info, so we can see which "rc-method" is in use, ie trimmed:

client.window.2.encoder=x264
client.window.2.encoder.b-frames=1
client.window.2.encoder.bandwidth-limit=2000000
client.window.2.encoder.content-type=video
client.window.2.encoder.fps=159
client.window.2.encoder.ms_per_frame=3
client.window.2.encoder.params.rc.bitrate=1953
client.window.2.encoder.params.rc.rc-method=ABR
client.window.2.encoder.params.rc.vbv_buffer_init=1.0
client.window.2.encoder.params.rc.vbv_buffer_size=1953
client.window.2.encoder.params.rc.vbv_max_bitrate=3906
client.window.2.encoder.preset=fast
client.window.2.encoder.profile=high10
client.window.2.encoder.tune=film

@totaam
Copy link
Collaborator Author

totaam commented Dec 19, 2018

2018-12-19 18:23:11: antoine commented


Regression introduced by r20399 is fixed: #2087#comment:4

@totaam
Copy link
Collaborator Author

totaam commented Dec 19, 2018

2018-12-19 18:36:32: antoine commented


Summary: this new code should allow the video encoders to be better tuned for the amount of bandwidth available, lowering the picture quality (sometimes drastically - see #2087 for what a 2Mbps limit does) but allowing for a higher refresh rate and a better quality for the non-video areas around it.

@totaam
Copy link
Collaborator Author

totaam commented Feb 9, 2019

2019-02-09 03:42:22: antoine changed owner from maxmylyn to encodedEntropy

@totaam
Copy link
Collaborator Author

totaam commented Aug 1, 2019

2019-08-01 13:00:44: smo changed owner from encodedEntropy to smo

@totaam
Copy link
Collaborator Author

totaam commented Dec 12, 2019

2019-12-12 08:07:29: antoine changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Dec 12, 2019

2019-12-12 08:07:29: antoine set resolution to worksforme

@totaam
Copy link
Collaborator Author

totaam commented Dec 12, 2019

2019-12-12 08:07:29: antoine commented


Not heard back.

@totaam totaam closed this as completed Dec 12, 2019
@totaam totaam added the v2.3.x label Jan 22, 2021
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

No branches or pull requests

1 participant