Video quality is not automatically adjusted
What version of Hls.js are you using?
N/A (peertube 5.2.0)
What browser (including version) are you using?
Firefox 115.03
What OS (including version) are you using?
Windows 10
Test stream
https://hlsjs.video-dev.org/demo/?src=https%3A%2F%2Fvidbin.org%2Fstatic%2Fstreaming-playlists%2Fhls%2F1257e6bd-aedf-4c05-bf31-c2582792c967%2F5988e183-0de3-4ca9-8600-19d6da808c65-master.m3u8&demoConfig=eyJlbmFibGVTdHJlYW1pbmciOnRydWUsImF1dG9SZWNvdmVyRXJyb3IiOnRydWUsInN0b3BPblN0YWxsIjpmYWxzZSwiZHVtcGZNUDQiOmZhbHNlLCJsZXZlbENhcHBpbmciOi0xLCJsaW1pdE1ldHJpY3MiOi0xfQ==
Configuration
{} N/A (peertube 5.2.0 default with h264 and av1 resolutions)
Additional player setup steps
No response
Checklist
- [X] The issue observed is not already reported by searching on Github under https://github.com/video-dev/hls.js/issues
- [X] The issue occurs in the stable client (latest release) on https://hlsjs.video-dev.org/demo and not just on my page
- [X] The issue occurs in the latest client (main branch) on https://hlsjs-dev.video-dev.org/demo and not just on my page
- [X] The stream has correct Access-Control-Allow-Origin headers (CORS)
- [X] There are no network errors such as 404s in the browser console when trying to play the stream
Steps to reproduce
- Try playing video with 480p h264 and 1080p/1440p av1
Expected behaviour
Quality adjusts based on bandwidth
What actually happened?
Quality stays the same
Console output
.
Chrome media internals output
No response
The player does not switch codecs in ABR mode. This is by design for stability and playback experience. You can select a level with a different codec and then return to auto mode if you'd like to force it (set hls.nextLevel = 1 then once the change has been made hls.loadLevel = -1).
See if #5704 resolves your issue. If it does not it is because you've provided a very limited bitrate ladder with a big jump in bitrate between h264/AAC and AV1/Opus options. Using that branch (or in v1.5 when released), if you provide an AV1 variant at a bitrate equal to or lower than the h264 variants, hls.js will start and stay on AV1. In this branch, you could also try starting with a bitrate test ({ startLevel: -1, testBandwidth: true }) or a higher default estimate ({ abrEwmaDefaultEstimate: 4000000 }) to get the first pick to one of the levels with higher bitrates.
I would not recommended having a single bitrate ladder with only different codecs at different steps. A range of resolutions and bitrates should be provided for each codec so that clients can select and adapt using the most efficient codec they support playback in.
This is by design for stability and playback experience.
Do you have more info on this? I forked this repo for my project and have not experienced any issue with removing the codec check to have an auto mode that "just works". I'm using hls.js to play streams I have no control over, sometimes they have e.g. both h264 and VP9 for the first low bitrate variants, but then only one or the other for higher qualities. If the player lands on the wrong codec initially, it gets permanently stuck to bad qualities.
Do you have more info on this?
Not all UAs support changeType and even those that do don't always transition smoothly or without error between every combination of supported decoding configurations. We also do not have a way to tell if SourceBuffers should even be expected to smoothly transition at every point where a change is appended.
https://caniuse.com/mdn-api_sourcebuffer_changetype https://github.com/w3c/media-capabilities/issues/102
I forked this repo for my project and have not experienced any issue with removing the codec check to have an auto mode that "just works".
Remove it at your own risk. If it works for all types you deliver on all browsers and devices you support and test then go for it!