Bug 287516

Summary: WebCodecs VideoDecoder Outputs Frames in Incorrect Order
Product: WebKit Reporter: mail
Component: MediaAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: ahmad.saleem792, dpayr, jean-yves.avenard, jer.noble, jozefchutka, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari 18   
Hardware: Mac (Apple Silicon)   
OS: macOS 15   
Attachments:
Description Flags
Video sample exhibiting the issue (if applicable). none

mail
Reported 2025-02-11 14:59:36 PST
Created attachment 474211 [details] Video sample exhibiting the issue (if applicable). Description: When using the WebCodecs VideoDecoder API in Safari, video frames are received in an incorrect order. This issue does not occur in Chrome, where frames are correctly decoded and presented in the expected sequence. Steps to Reproduce: Use WebCodecs VideoDecoder to decode a video containing B-frames. Observe the output frame order. Expected Behavior: The VideoDecoder should output frames in the correct display order, as specified by the video encoding and the WebCodecs specification. Actual Behavior: In Safari, the decoder appears to output frames in the wrong order, likely due to incorrect handling of B-frames. The raw samples are not monotonically ordered by their timestamp, yet Chrome correctly orders them upon decoding, whereas Safari does not. Additional Observations: Safari successfully decodes B-frames correctly in other videos (e.g., Big Buck Bunny), so this issue may be specific to certain video files. The issue suggests that Safari’s VideoDecoder is not fully spec-compliant in handling reordering of frames.
Attachments
Video sample exhibiting the issue (if applicable). (5.55 MB, video/mp4)
2025-02-11 14:59 PST, mail
no flags
Radar WebKit Bug Importer
Comment 1 2025-02-18 15:00:35 PST
Ahmad Saleem
Comment 2 2025-03-04 12:45:26 PST
Does it impact any live website or product? Plus if you have any test case or minimal reduction to reproduce the issue?
Jozef Chutka
Comment 3 2025-12-08 05:08:04 PST
Reproduction steps can be found in https://bugs.webkit.org/show_bug.cgi?id=302714 It does affect live websites and libraries built on top of WebCodecs as reported on: - https://github.com/Vanilagy/mediabunny/issues/223 - https://github.com/Vanilagy/mediabunny/issues/242
youenn fablet
Comment 4 2026-01-12 02:17:30 PST
*** Bug 302714 has been marked as a duplicate of this bug. ***
youenn fablet
Comment 5 2026-01-12 03:21:24 PST
EWS
Comment 6 2026-01-12 09:55:44 PST
Committed 305475@main (948e6208a6dc): <https://commits.webkit.org/305475@main> Reviewed commits have been landed. Closing PR #56441 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.