video-dev / video-dev/hls.js

Cached Fragments increase BandwidthEstimate causing suboptimal quality selection

Open
#5,826 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Browser issue Missing Feature
Dominant language
TypeScript
Stars
16.9k
Forks
2.8k
Avg merge
1d 12h
Merged PRs (30d)
27

Description

What version of Hls.js are you using?

1.4.12

What browser (including version) are you using?

Chrome 117.0.5938.48

What OS (including version) are you using?

Windows 11

Test stream

No response

Configuration
default
Additional player setup steps

No response

Checklist
Steps to reproduce
  1. Open a page with a hls.js-video and have it load some fragments into the cache.
  2. Reload the page with a throttled connection and watch the bandwidthEstimate
  3. When cached fragments are used, the bandwidthEstimate shoots up and causes the quality level to go up, even though the connection is actually bad. This causes the video to stall, when loading big fragments with a bad connection
Expected behaviour

Disregard cached fragments in the calculation of the bandwidthEstimate

What actually happened?

Cached fragments are being treated as if they were loaded over the network

Console output
Will paste more tomorrow, but will just show the bandwidthEstimate increasing to over 6Mb/s even though the connection is set to 1Mb/s.

This is from my logs in the console:

BandwidthEstimate: 404816640
BandwidthEstimate: 6228293.959612044

Even Though the connection is set to 1Mb/s
Chrome media internals output

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using the listed Chrome, Windows 11, hls.js 1.4.12 setup and a throttled connection, then trace how bandwidthEstimate is updated when cached fragments are used. Confirm that cached fragments are excluded from network bandwidth measurement and that quality selection no longer rises incorrectly or causes stalls.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
audio-video-rtc, frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.