video-dev / video-dev/hls.js

Proposal to improve HLS multi-segment prefetching to address server bandwidth-limited playback interruptions

Open
#6,753 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Is your feature request related to a problem? Please describe.

Background
In some cases, despite the high bandwidth of the client, the HLS server may be bandwidth-limited, resulting in slow segment loading and causing interruptions or delays in the content playback. Prefetching multiple segments one by one increases the latency between downloads, especially when the server cannot provide data at a fast enough rate.

Objective
This proposal aims to introduce a configuration option that allows the client to prefetch multiple segments instead of just one segment at a time. This will help the client to play content more seamlessly, minimizing buffering even when the server is bandwidth-limited.

Describe the solution you'd like

Proposed Solution
Configuration options for prefetching multiple segments:

  1. Prefetch multiple segments:
    Add an optional configuration to the client that allows the user to configure the number of segments to be prefetched (e.g. 2 to 5 segments at a time) before they need to be played.

This allows the client to store enough segments to play continuously even when the server download speed is slow.

  1. Concurrent loading mechanism:
    The client can prefetch multiple segments at the same time, maximizing the client's bandwidth and minimizing the dependence on the server's download speed.

In the case of limited server bandwidth, prefetching multiple segments will help avoid the situation where the client has to wait for a long time between segments.

  1. Adaptive prefetching:
    The client can prefetch multiple segments automatically based on the current connection status (adaptive prefetching). For example, when detecting that the server bandwidth is limited, the client will prefetch more segments to avoid interruptions.

Benefits
Improved user experience: Clients will have multiple segments available in the buffer to play continuously without interruption, even when the server is limited in bandwidth.
Reduced buffering: Loading multiple segments in advance reduces the risk of experiencing playback interruptions when the server is not loading segments fast enough.
Optimized client bandwidth: Make the most of the client bandwidth to ensure that the video can be played at the highest quality without interruption.
Conclusion
The proposed configuration option to load multiple segments in advance on the client will significantly improve the quality of HLS playback in situations where the server is limited in bandwidth. This not only provides a smoother video playback experience for users, but also makes better use of the bandwidth on the client without increasing the resource requirements from the server.
Thanks development team.

Additional context

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

The issue names no files, tests, or entry points. Start by locating the existing single-segment HLS prefetch path and deciding whether configurable, concurrent, or adaptive prefetching is in scope; done should include an agreed configuration and clearly defined playback behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
audio-video-rtc
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.