Frames decoded in the RDD process lose their color space metadata when sent over the video bridge
Categories
(Core :: Audio/Video: Playback, defect, P3)
Tracking
()
People
(Reporter: david.torcivia, Assigned: chunmin, NeedInfo)
References
(Blocks 2 open bugs)
Details
(Keywords: correctness, parity-chrome)
Attachments
(9 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
Every video frame decoded in the RDD process and sent to the content process over the video bridge loses its color space metadata: RemoteVideoDecoderParent::ProcessDecodedData only fills YUVColorSpace, primaries, transfer function, and range in the shmem fallback path, and the texture path (which is what runs in practice on all desktop platforms) sends the defaults. The content side's GuessColorSpace for GPUVideoImage then reconstructs a color space from those defaults, which currently aliases to bt709 regardless of the stream.
Visible effect: VideoFrame.colorSpace in WebCodecs reports guessed values instead of the decoder's, for every software-decoded frame on Linux, Windows, and macOS (verified against current nightlies on all three). Chrome reports the decoder's values. This is the metadata sibling of bug 1969762 (which covers the pixel format and copyTo; see comment 9 there for the mechanics).
The one-line fix (hoist the extraction above the texture/shmem fork) is straightforward, but I prototyped it while working on bug 1969762 and it cannot land alone: forwarding the decoder's real values turns webcodecs/full-cycle-test.https.any.js?av1 "w/ stripped color space" red, because
- our encoders write no color info into the bitstream (bug 2057758), so
- the decoder falls back to display-size heuristics (DAV1DDecoder and VPXDecoder label SD streams BT601/BT470BG; the heuristic-primaries problem is bug 1869825), and
- the test then correctly observes that the decoded metadata contradicts the encoder's claimed color space.
In other words the test passes today only because the metadata is lost in transit. Landing order that keeps everything green and honest: bug 2057758 first, then this forwarding, with the heuristic-vs-signaled distinction from bug 1869825 (or a signaled-only forwarding rule) resolving the remaining canvas-sourced cases.
| Reporter | ||
Updated•1 month ago
|
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•8 days ago
|
||
| Assignee | ||
Comment 2•8 days ago
|
||
| Assignee | ||
Comment 3•8 days ago
|
||
| Assignee | ||
Updated•7 days ago
|
Updated•7 days ago
|
Updated•7 days ago
|
| Assignee | ||
Comment 4•7 days ago
|
||
Updated•7 days ago
|
Backed out for causing build bustages
Comment 10•2 days ago
|
||
Backed out for causing reftest failure 720p.png.bt709.bt709.pc.yuv420p.av1.webm / 720p.png
Updated•2 days ago
|
| Assignee | ||
Comment 11•2 days ago
|
||
Preserving FFmpeg's decoded color metadata reduces the pixel differences for the full-range 8-bit and 10-bit AV1 cases. Update their draw-snapshot expectations to match the corrected output.
Comment 12•2 days ago
|
||
macOS, Firefox 155. Colors are washed out in video. Setting media.rdd-process.enabled=false immediately restores correct colors. Firefox 154 did not have the problem. Safari renders the same video correctly.
Comment 13•2 days ago
|
||
Comment 14•1 day ago
|
||
Comment 15•1 day ago
|
||
Backed out for causing failures at full-cycle-test.https.any.worker.html?av1.
Backout link: https://hg.mozilla.org/integration/autoland/rev/7dd0886c03a3
Failure log: https://treeherder.mozilla.org/logviewer?job_id=589620433&repo=autoland&task=VvPut4PySuOy3HW42m8PKw.0&lineNumber=1782
Updated•11 hours ago
|
| Assignee | ||
Comment 16•33 minutes ago
|
||
| Assignee | ||
Comment 17•32 minutes ago
|
||
| Assignee | ||
Comment 18•32 minutes ago
|
||
| Assignee | ||
Comment 19•32 minutes ago
|
||
Keep the existing behavior by default until encoder color-space signaling is complete. Enable the new behavior for the color-quads reftests.
Description
•