-
Notifications
You must be signed in to change notification settings - Fork 133
[Proposal] Add PlaybackRate-based rebuffering avoidance mechanism #1588
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
base: dev
Are you sure you want to change the base?
Conversation
f3c5cc1
to
e3d4723
Compare
a0d489f
to
e4567e7
Compare
e4567e7
to
3a50743
Compare
3a50743
to
aa14ba6
Compare
Automated performance checks have been performed on commit Tests results? Tests have passed. Performance tests 1st run outputNo significative change in performance for tests:
If you want to skip performance checks for latter commits, add the |
00fc806
to
b7216b4
Compare
94db9d5
to
1ceed37
Compare
? Automated performance checks have passed on commit DetailsPerformance tests 1st run outputNo significative change in performance for tests:
|
1ceed37
to
59da7ac
Compare
? Automated performance checks have passed on commit DetailsPerformance tests 1st run outputNo significative change in performance for tests:
|
59da7ac
to
452e049
Compare
? Automated performance checks have passed on commit DetailsPerformance tests 1st run outputNo significative change in performance for tests:
|
While admittedly checking what other media players were doing that we don't do yet, I saw an interesting opportunity. Some players have a mechanism where they lower very slightly the playback rate (the speed at which we play) - for example at `0.95` (meaning we play 0.95 seconds of content every second) - if the current buffer size is low, until it gains back an acceptable size again. I'm not sure of the actual impact this mechanism has in terms of rebuffering avoidance but it seems that it can help. Because it has potential but has high uncertainties, I propose adding this mechanism as an experimental `loadVideo` option for now, meaning that we reserve the right to update this API or even remove it at any time. I re-use the `experimentalOptions` concept I already proposed in several of the currently-open PRs for this. Because we might want to check the buffer size often when it's close to the potentially-very-low value where this mechanism activates, I reduced our PlaybackObserver's regular interval from 1s to 500ms. This is the same interval we already tested on low-latency contents so it shouldn't be an issue. I also for now only enable this mechanism if the application plays at x1, not if it is already updating the playbackRate as I found the wanted behavior in thoses cases harder to define. Some players also only enable this mechanism on VoD contents, not on live contents. I think that this is a mistake as there's no reason timeshifted live shouldn't be treated the same. I didn't do the API documentation yet nor link it to the demo because I'm somewhat unhappy for that mechanism's name, for now called `playbackRateBasedRebufferingAvoidance`. Even if it describes well what it does, I found that name too long even in the code. I think we may prefer finding it a nicer-sounding name to make the code more readable and the API more approachable, like we did for our "fast-switching concept" (which sadly has now a new meaning for DASH low-latency contents different than ours or dash.js's usage, but that's always a risk and I'm willing to take it).
… buffer gap is set to 0
452e049
to
512bdc4
Compare
? Automated performance checks have passed on commit DetailsPerformance tests 1st run outputNo significative change in performance for tests:
|
While admittedly checking what other media players were doing that we don't do yet, I saw an interesting opportunity.
Some players have a mechanism where they lower very slightly the playback rate (the speed at which we play) - for example at
0.95
(meaning we play 0.95 seconds of content every second) - if the current buffer size is low, until it gains back an acceptable size again.I'm not sure of the actual impact this mechanism has in terms of rebuffering avoidance but it seems that it can help.
Because it has potential but has high uncertainties, I propose adding this mechanism as an experimental
loadVideo
option for now, meaning that we reserve the right to update this API or even remove it at any time. I re-use theexperimentalOptions
concept I already proposed in several of the currently-open PRs for this.Because we might want to check the buffer size often when it's close to
the potentially-very-low value where this mechanism activates, I reduced our PlaybackObserver's regular interval from 1s to 500ms. This is the same interval we already tested on low-latency contents so it shouldn't be an issue.
I also for now only enable this mechanism if the application plays at x1, not if it is already updating the playbackRate as I found the wanted behavior in thoses cases harder to define.
Some players also only enable this mechanism on VoD contents, not on live contents. I think that this is a mistake as there's no reason timeshifted live shouldn't be treated the same.
I didn't do the API documentation yet nor link it to the demo because I'm somewhat unhappy for that mechanism's name, for now called
playbackRateBasedRebufferingAvoidance
.Even if it describes well what it does, I found that name too long even in the code. I think we may prefer finding it a nicer-sounding name to make the code more readable and the API more approachable, like we did for our "fast-switching concept" (which sadly has now a new meaning for DASH low-latency contents different than ours or dash.js's usage, but that's always a risk and I'm willing to take it).