Bug 1735300 - Do not use MP4 edit-list preroll as the media start time#306
Closed
dancrew32 wants to merge 1 commit into
Closed
Bug 1735300 - Do not use MP4 edit-list preroll as the media start time#306dancrew32 wants to merge 1 commit into
dancrew32 wants to merge 1 commit into
Conversation
…e. r?#media-playback-reviewers
No Taskcluster jobs started for this pull requestThe |
Contributor
|
(Automated Close) Please do not file pull requests here, see https://firefox-source-docs.mozilla.org/contributing/how_to_submit_a_patch.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
MediaFormatReadermetadata start time.MediaFormatReadergtest covering an MP4 edit-list style pre-roll first sample.Why
This fixes Bug 1735300.
MP4 edit lists describe the presentation timeline. A decoder may still need samples before the presentation start in order to decode the first visible frame, but those dependency samples should not become the media element's visible
currentTime == 0frame.That distinction matches the broader media stack's behavior:
mov/mp4/3gpdemuxer documents edit lists as timeline data: by default it modifies the stream index to reflect the timeline described by the edit list, withignore_editlistas the opt-out path. See theignore_editlistandadvanced_editlistoptions in the FFmpeg formats documentation.CAP_FFMPEG), so video-processing workflows using that backend follow FFmpeg's presentation timeline behavior rather than exposing decode pre-roll as frame zero. See OpenCV'sVideoCaptureAPI backend list.The current Firefox behavior lets MP4 decode pre-roll pull the media timeline earlier. That makes the first visible frame differ from Chrome and from file-processing tools that honor the edit-list presentation start.
Visual evidence
These screenshots use the public sample from Bug 1735300. The file reports a 2.0s audio/video presentation, while its first video packets are negative decode pre-roll:
Current Firefox 152.0.1 at
0.000000sstill shows pre-roll before the edit-list start:Chrome 149.0.7827.156 at
0.000000sstarts on the edit-list presentation frame:Current Firefox near the presentation end still remains behind the edit-list timeline:
Chrome near the presentation end remains aligned with the presentation timeline:
Test plan
git diff --checkTestMediaFormatReader.PositiveMediaTimeIgnoresNegativePreroll./mach gtest TestMediaFormatReader.PositiveMediaTimeIgnoresNegativePrerollThis local checkout is sparse because the full Firefox checkout exceeded available disk on this machine. A full checkout/build or try run is still needed before this is ready for non-draft review.
Notes