Chrome 74 and lower mp4-remuxer fix #2995
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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