Closed Bug 2080453 Opened 1 month ago Closed 14 days ago

MP4, H264: seek to keyframe does not try scanning from earlier point unless it hits End of Stream

Categories

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

defect

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: tnibler, Assigned: tnibler, NeedInfo)

References

Details

Attachments

(1 external file)

(Follow up to Bug 2072130)

When searching for a keyframe to seek to, the scan only works forward. If the stream ends before one is found, the search restarts from the beginning where it is very likely to find one. But we're specifically looking for the closest keyframe before the seek point, not the first one we encounter.

If the scan does find a keyframe at time Tk before the end of stream but after the seek point Ts, this frame is displayed for entire interval Ts - Tk.
Again the logic is not correct to find the closest keyframe before the seek point.

Fix: when seeking, find the last keyframe before the target time and resolve the seek from there.

The seek algorithm now jumps back to the start if either the target time
has been passed or end of stream is hit.
Both are equivalent in that they mean that no suitable keyframe can be
found past this point.
While walking the stream, keep track of the latest keyframe which is
also the closest one to the seek target and thus the best point to seek
to.

Assignee: nobody → dev
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #9657508 - Attachment description: Bug 2080453 - Retry MP4 seek to find last keyframe before target time r=#media-playback-reviewers,alwu! → WIP: Bug 2080453 - Retry MP4 seek to find last keyframe before target time r=#media-playback-reviewers,alwu!
Attachment #9657508 - Attachment description: WIP: Bug 2080453 - Retry MP4 seek to find last keyframe before target time r=#media-playback-reviewers,alwu! → Bug 2080453 - Retry MP4 seek to find last keyframe before target time r=#media-playback-reviewers,alwu!
Attachment #9657508 - Attachment description: Bug 2080453 - Retry MP4 seek to find last keyframe before target time r=#media-playback-reviewers,alwu! → Bug 2080453 - Rework MP4 seek logic, save keyframe locations to avoid redundant work r=#media-playback-reviewers,alwu!

The severity field is not set for this bug.
:jimm, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jmathies)
Attachment #9657508 - Attachment description: Bug 2080453 - Rework MP4 seek logic, save keyframe locations to avoid redundant work r=#media-playback-reviewers,alwu! → Bug 2080453 - Rework MP4 seek logic, use keyframe lookup table r=#media-playback-reviewers,alwu!
Pushed by alwu@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/bc208b5437da https://hg.mozilla.org/integration/autoland/rev/21098182d61f Rework MP4 seek logic, use keyframe lookup table r=media-playback-reviewers,alwu
Status: ASSIGNED → RESOLVED
Closed: 14 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
Duplicate of this bug: 2080870
See Also: → 2091993
See Also: → 2095073
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: