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

Chrome 74 and lower mp4-remuxer fix #2995

Merged
merged 1 commit into from Aug 26, 2020

Conversation

robwalch
Copy link
Collaborator

@robwalch robwalch commented Aug 25, 2020

This PR will...

Fix mp4-remuxer CHUNK_DEMUXER_ERROR_APPEND_FAILED in Chrome 74 and lower, as well as Chromium based browsers like Opera 58.

Why is this Pull Request needed?

Older versions of Chrome error when appending mp4 fragments with negative base decode times. Using these values works in other browsers and allows us to append video as close to 0 and the first audio sample as possible, reducing start gaps at the beginning of video with large composition times (pts-dts delta).

Negative DTS append devtool log output from Chrome <=74:

The video playback was aborted due to a corruption problem or because the video used features your browser did not support - CHUNK_DEMUXER_ERROR_APPEND_FAILED: video frame with PTS 40000us has negative DTS -40000us after applying timestampOffset, handling any discontinuity, and filtering against append window

Changes that caused the regression:

Negative DTS were allowed in v0.14.4 to improve stability in Safari and remove AVC sample workarounds for that user agent. Removing or preventing timestamp shifting workaround prevents AVC samples and the fragment timeline from being shifted around when they shouldn't be. Also keeping the composition times consistent with the input source prevents decode artifacts from being displayed in Safari. While a broad number of browsers were tested, older Chrome was missed. Also this issue only affects streams with large composition times for the first frame not matched with corresponding audio.

Checklist

  • changes have been done against patch 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 0.14.10 milestone Aug 25, 2020
@robwalch robwalch requested a review from itsjamie August 25, 2020 23:24
@robwalch robwalch merged commit a1c8f0e into patch/v0.14.x Aug 26, 2020
@robwalch robwalch deleted the bugfix/chrome-74-negative-dts branch August 26, 2020 15:36
@itsjamie
Copy link
Collaborator

Nice. Thanks for this @robwalch.

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.

None yet

2 participants