Irregular fmp4 fragment durations with "progressive" setting
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 16.9k
- Forks
- 2.8k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 27
Description
What do you want to do with Hls.js?
Hi, given a HLS VOD with fragmented mp4s (6s fragments, 2s chunks) using byterange requests, I'm wondering why the loaded fragments are of different durations when using the fetch-loader vs xhr-loader.
Example with xhr-loader showing consistent ~6s fragments for audio and video in the Timeline:
{
"debug": true,
"enableWorker": true,
"backBufferLength": 90,
"progressive": false
}
Example with fetch-loader showing fragments of varying durations in the Timeline:
{
"debug": true,
"enableWorker": true,
"backBufferLength": 90,
"progressive": true
}
The reason I am interested in using fetch-loader is to reduce startup time by allowing playback as soon as a chunk is downloaded rather than a full fragment. Is there a less experimental way to achieve this that you recommend?
Thank you
What have you tried so far?
- Different chunk durations (500ms, 1s, 2s)
- A custom fetch-loader, but the magic comes from more than just using fetch it is actually appending the chunks as they come which I have not re-implemented
I wanted to try next:
- fmp4 fragments of equal length as the chunk (6s fragments, 6s chunk with single moof+mdat)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the stream in the linked Hls.js demo with progressive set to false and true, then compare the fetch-loader and xhr-loader paths and their timeline durations. Start with the loader behavior described in the issue; done means determining whether the varying fMP4 durations are expected or identifying a focused fix or recommendation for chunked playback.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100