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

Bugfix: Handle single sample MPEG2-TS video segments #4794

Merged
merged 1 commit into from
Jul 20, 2022

Conversation

robwalch
Copy link
Collaborator

@robwalch robwalch commented Jul 18, 2022

This PR will...

Keep track of last or average video sample duration in TS->MP4 remuxer, and use this value (or a default of 1/30s) when remuxing a single sample. Also allow a single video sample on remuxer flush to ensure all video samples in a segment are processed even if there is only one sample.

Why is this Pull Request needed?

Without this change HLS.js will not process single sample segments. We can encounter streams or discontinuity sequences that end with a single video sample or frame.

Are there any points in the code the reviewer needs to double check?

There is no way in the demuxer currently to determine duration of single sample or fps of media in a TS segment without comparing samples.

Resolves issues:

Fixes: #4783

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

@robwalch robwalch added this to the 1.2.0 milestone Jul 18, 2022
@robwalch robwalch merged commit 2b933f3 into master Jul 20, 2022
@robwalch robwalch deleted the bugfix/single-and-last-video-sample-duration branch July 20, 2022 01:14
@robwalch robwalch mentioned this pull request Sep 22, 2022
5 tasks
littlespex pushed a commit to cbsinteractive/hls.js that referenced this pull request Dec 9, 2022
We require node v14+ and Java v11+ now.

Closes video-dev#4721 
Closes video-dev#4737
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.

Playback stalling due to low buffer at end of stream with one frame video segment
1 participant