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

Fix Safari decode errors with DTS not increasing when PTS decreases #5710

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

robwalch
Copy link
Collaborator

@robwalch robwalch commented Aug 1, 2023

This PR will...

Increase m2ts->fmp4 remuxed sample dts to prevent decode artifacts and errors in Safari.

Why is this Pull Request needed?

Samples with negative DTS after aligning on PTS can cause decode artifacts and errors when hls.js sets those initial samples' DTS to 0.

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

It's not ideal that hls.js has to modify the decode timeline in order to align the media presentation to 0. This is done to remove large video starting gaps that result from MSE implementations not accounting for or reflecting composition time in the media elements timeline.

In the future, HLS.js could improve by setting SourceBuffer timestampOffset before appending, without shifting sample timestamps. That would be a much more involved change as it could impact fragment timing properties and append positions across browsers, so for these reasons this intermediate fix is being made instead.

Resolves issues:

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.5.0 milestone Aug 1, 2023
@robwalch robwalch changed the title Update mp4-remuxer.ts Fix Safari decode errors with DTS not increasing when PTS decreases Aug 1, 2023
@robwalch robwalch merged commit c275d2c into master Aug 2, 2023
16 checks passed
@robwalch robwalch deleted the bugfix/ensure-sample-monotonic-dts branch August 2, 2023 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant