Skip to content

feat(ABR): Add BufferBasedAbrManager for low-latency live streams#9896

Closed
erikherz wants to merge 5 commits into
shaka-project:mainfrom
erikherz:buffer-based-abr
Closed

feat(ABR): Add BufferBasedAbrManager for low-latency live streams#9896
erikherz wants to merge 5 commits into
shaka-project:mainfrom
erikherz:buffer-based-abr

Conversation

@erikherz

Copy link
Copy Markdown
Contributor

Summary

A buffer-based ABR manager for low-latency live streams (MoQ/MSF) where bandwidth estimation is unreliable due to small segment sizes and push-based delivery via WebTransport.

Instead of estimating bandwidth from segment downloads, this manager monitors buffer health relative to the stream's target latency.

How it works

  • Down-switch: immediate when buffer < 30% of target latency, or when dropped frames exceed threshold
  • Up-switch: requires 5 seconds of sustained buffer > 150% of target latency
  • Quality ladder: built from variants sorted by resolution (pixel count)
  • Grace period: 5 seconds after enable before evaluating

Usage

player.configure({
  abrFactory: () => new shaka.abr.BufferBasedAbrManager(),
});

Files

File Change
lib/abr/buffer_based_abr_manager.js New file — implements shaka.extern.AbrManager
build/types/core Include in core build

Test plan

  • Tested with live MoQ/MSF multi-quality streams (480p/720p/1080p)
  • Verified down-switch on buffer depletion
  • Verified up-switch after sustained healthy buffer
  • Verified smooth playback during quality transitions
  • Unit tests (to be added based on feedback)

Related to #9872

Author: erik@vivoh.com

avelad and others added 5 commits March 25, 2026 13:44
More types of messages are now supported than before.
SubscribeError handling has been improved.
A new error has been added when no catalog.
A buffer-based ABR manager designed for low-latency live streams
(MoQ/MSF) where bandwidth estimation is unreliable due to small
segment sizes and push-based delivery via WebTransport.

Instead of estimating bandwidth from segment downloads, this manager
monitors buffer health relative to the stream's target latency:

- Down-switch: immediate when buffer < 30% of target latency or
  when dropped frames exceed threshold
- Up-switch: requires 5s of sustained buffer > 150% of target latency
- Quality ladder built from variants sorted by resolution

Usage:
  player.configure({
    abrFactory: () => new shaka.abr.BufferBasedAbrManager(),
  });

Related to shaka-project#9872
@matvp91

matvp91 commented Mar 26, 2026

Copy link
Copy Markdown
Member

Thank you,@erikherz! Glad to see some activity around LL ABR.

Shall we mark this as a draft for the sake of reference?

I'm not entirely sure we'd want to ship a secondary ABR impl for the sake of LL, but EWMA is definitely lacking. I also suspect buffer health is a useful metric unrelated to MSF or even LL but that's an unproven theory.

Hope to hear some opinions, @joeyparrish @avelad @tykus160?

@joeyparrish

Copy link
Copy Markdown
Member

I haven't reviewed the implementation yet, but I would be in favor of including this as an option. (Assuming it's not a large change to the size of Shaka Player.)

@erikherz, you have a linter failure preventing other CI workflows from running, including the size analysis.

@joeyparrish

Copy link
Copy Markdown
Member
/home/runner/work/shaka-player/shaka-player/head-source/lib/abr/buffer_based_abr_manager.js
  339:9  error  Unnecessary return statement  no-useless-return

@avelad

avelad commented Mar 27, 2026

Copy link
Copy Markdown
Member

I think it would be good if this were only included in the experimental build.

@avelad

avelad commented Mar 31, 2026

Copy link
Copy Markdown
Member

@erikherz FYI, we are working on add "monitor dropped frames to influence ABR decisions " #9918

@avelad avelad added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jun 24, 2026
@shaka-bot

Copy link
Copy Markdown
Collaborator

Closing due to inactivity. If the author would like to continue this PR, they can reopen it (preferred) or start a new one (if needed).

@shaka-bot shaka-bot closed this Jul 1, 2026
@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jul 1, 2026
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

Successfully merging this pull request may close these issues.

5 participants