Open Bug 1735300 Opened 4 years ago Updated 24 days ago

Firefox does not respect mp4 edit list media start time

Categories

(Core :: Audio/Video: Playback, defect, P3)

Firefox 92
defect

Tracking

()

People

(Reporter: arutyunyan.roman, Unassigned)

References

Details

Attachments

(1 file)

Attached video s.mp4

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15

Steps to reproduce:

Attached is an mp4 file with one video and one audio track. It has an edit list which cuts a few seconds from the start of the video track. The video frame to start playback with is NOT a key frame, but there's one such frame is the cut part.

Actual results:

When playing the file in Firefox, video playback starts silently with the key frame in the cut part and then progresses to the actual edit list start time. At this moment audio starts playing.

Expected results:

Both video and audio should start simultaneously. Video should start exactly at the time specified in the edit list. This should not change whether the first video frame is a key frame or not. If it's not, Firefox should search for the key frame in the cut part and progress from that key frame to the start frame without showing those frames. That's what QuickTime/Chrome/ffmpeg do.

The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

I'm not sure about how to deal with this issue. The video starts with negative timestamp [-6375000, -6333333]. This kind of situation happens sometime, so we would automatically adjust it to [0,41667]. So those "cut part" are all adjusted to the non-negative timestamp and we would keep playing it. From my point of view, I don't feel it's wrong, because if you want to cut the video, why you still put those parts on the container? But maybe there are some MP4 spec rule to allow this kind of behavior? I don't know...

Bryce, John, what would y'all think about this issue?

Thank you.

Severity: -- → S3
Flags: needinfo?(jolin)
Flags: needinfo?(bvandyk)
Priority: -- → P3

(In reply to Alastor Wu [:alwu] from comment #2)

if you want to cut the video, why you still put those parts on the container?

Here's the task. I have an encoded video. I want to cut it so that it starts with a random frame, which may not be a key frame. In this case I have to keep the previous key frame and everything in between to render my first frame. Even though it's all in the file, I still want to skip it. The mp4 spec allows me to do that by using an edit list.

(In reply to Roman Arutyunyan from comment #3)

The mp4 spec allows me to do that by using an edit list.

Good to know that's supported by the MP4 spec! Thanks!
I found that there is EditListBox in our mp4 parser, so maybe we just didn't parse those boxes correctly?

(In reply to Alastor Wu [:alwu] from comment #4)

(In reply to Roman Arutyunyan from comment #3)

The mp4 spec allows me to do that by using an edit list.

Good to know that's supported by the MP4 spec! Thanks!
I found that there is EditListBox in our mp4 parser, so maybe we just didn't parse those boxes correctly?

I think you do parse them correctly since audio and video are perfectly synchronized. But then you rewind the entire movie.

Acking and holding NI -- my hands are full right now, but can look more at this once I've got cycles (if no one else gets to it first).

Status: UNCONFIRMED → NEW
Ever confirmed: true
Severity: S3 → S4
Flags: needinfo?(jolin)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: