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

[Proposal] Add PlaybackRate-based rebuffering avoidance mechanism #1588

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

peaBerberian
Copy link
Collaborator

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).

@peaBerberian peaBerberian added the proposal This Pull Request or Issue is only a proposal for a change with the expectation of a debate on it label Oct 29, 2024
@peaBerberian peaBerberian force-pushed the feat/playbackRateBasedRebufferingAvoidance branch from f3c5cc1 to e3d4723 Compare October 29, 2024 11:34
@peaBerberian peaBerberian force-pushed the feat/playbackRateBasedRebufferingAvoidance branch 2 times, most recently from a0d489f to e4567e7 Compare November 15, 2024 18:01
@peaBerberian peaBerberian added Priority: 2 (Medium) This issue or PR has a medium priority. Priority: 3 (Low) This issue or PR has a low priority. and removed Priority: 2 (Medium) This issue or PR has a medium priority. labels Nov 22, 2024
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).
@peaBerberian peaBerberian force-pushed the feat/playbackRateBasedRebufferingAvoidance branch from e4567e7 to 3a50743 Compare December 12, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: 3 (Low) This issue or PR has a low priority. proposal This Pull Request or Issue is only a proposal for a change with the expectation of a debate on it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant