-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix DASH default quality and quality selection #3278
Fix DASH default quality and quality selection #3278
Conversation
This seems a bit slow... I changed to Thoughts? Update 1: Update 2: |
Co-authored-by: PikachuEXE <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo
Co-authored-by: ChunkyProgrammer <[email protected]>
Im just putting this here before my brain forgets about this Shorts dont select default quality |
Just fixed a bug when default quality is set to auto |
Also fixed quality selection when video height > width (e.g. W720 x H1280) |
@PikachuEXE Your code will only work for the local API, Invidious doesn't return a height or width, it returns a resolution attribute with the larger dimension which we currently use as the height. |
I got the quality selection working for both local API and Invidious but the quality selector is not displaying the quality being used Video used for testing: Update 1: Note that this issue is gone if I don't use Local API and proxy video through Invidious |
@PikachuEXE sorting by bitrate is the only way to make sure hdr qualities are in the right order (they have formats that are identical in height and fps but differ in bitrate) also will setting the bandwidth to max cause issues on lower end devices and bad internet connections? |
Do we have some example videos for HDR formats? I can only find https://gist.github.com/AgentOak/34d47c65b1d28829bb17c24c04a0096f for format IDs I will revert the change since this might need some tweaking later (requires another PR) |
Another followup issue |
Is selecting between multiple of the same quality in scope of this PR? VirtualBoxVM_QIfUnyF667.mp4 |
Right now it just use highest bitrate one |
Fix DASH default quality and quality selection
Pull Request Type
Related issue
potentially addresses #595 (it fixes the original issue but someone left comments requesting automatically switching to legacy when certain qualities aren't available in DASH, which this pull request most certainly doesn't do)
potentially addresses #1533 (the quality dropping part)
Description
Fixes the default DASH quality selection and the DASH quality selector so that it should now be possible to switch between qualities in the quality selector when DASH is enabled. Fixing the default quality selection also fixes the slow loading times.
This also fixes the quality selector showing 1080p, even if you selected a different default quality.
Why wasn't the default quality selection working for DASH?
Well as it turns out even if you disable qualities videojs-http-streaming, it ignores your preferences if it thinks that it doesn't have enough bandwidth to play them (it's wrong but we can override it's decision as we know better). On my machine with the default quality set to 1080p it first requested 720p, then 144p and finally it switched up to 1080p, so the slow loading was caused by videojs-http-streaming wasting time doing pointless stuff.
The solution is to disable them as soon as possible and then also override videojs-http-streaming's default bandwidth with the one of the format, that way videojs-http-streaming will always select the correct quality at the start, as we've told it that it has enough bandwidth to play it.
As for why the quality selector works now, no idea it just started working while I was making all of these changes, so I'll take the win.
Loading and quality switching still isn't as fast as it is on YouTube but that's something for another day, if it's even possible to do with video.js.
Testing
Try various default qualites and switch between the qualities in the DASH quality selector (reminder for PikachuEXE as you asked last time: that's the quality selector that is shown when the DASH formats are selected).
Pika: For #595
(A) When low quality preferred
Desktop