Applying a rotation to a video causes colors to shift
Categories
(Core :: Audio/Video: Web Codecs, defect, P3)
Tracking
()
People
(Reporter: jakea, Unassigned, NeedInfo)
References
(Regression)
Details
(Keywords: regression)
Attachments
(2 files)
https://random-stuff.jakearchibald.com/bug-repros/video-color-issue/
When a rotation is applied to the video (or a containing element), the colours shift.
translatez causes the same issue.
Comment 1•6 months ago
•
|
||
I don't see the issue in https://random-stuff.jakearchibald.com/bug-repros/video-color-issue/
Can you provide some detail? What video? Is the menu image the video? Not sure.
| Reporter | ||
Comment 2•6 months ago
|
||
Here's a video description of the issue (includes audio)
Comment 3•6 months ago
|
||
I can reproduce this in Firefox 148 on my Macbook Pro M4, but don't think changing the element style would affect the decoded data from the video. Maybe the color shift is a side effect of rendering when rotation transformation is applied? Moving this to gfx to see if someone can help.
Comment 4•6 months ago
|
||
Thank you for filing, and for the testcase. I can reproduce on macOS. I did a mozregression and found something surprising: older versions of Firefox show the "wrong" color for the video both rotated and not rotated. In other words, the color is consistent, but does not match the background of the test page. That seems correct and predictable. I don't know what to say about the assertion that the color of the video should match the background color.
Anyway, the regression is in this range which I think clearly implicates Bug 1887818. Sotaro, would you please investigate?
Comment 5•6 months ago
|
||
Set release status flags based on info from the regressing bug 1887818
Updated•6 months ago
|
Comment 6•6 months ago
|
||
Hmm, I always see the color shit both rotated and not rotated on Windows, on macOS and on Linux.
Comment 7•6 months ago
|
||
(In reply to Brad Werth [:bradwerth] from comment #4)
Anyway, the regression is in this range which I think clearly implicates Bug 1887818. Sotaro, would you please investigate?
Bug 1887818 affects only to accelerated canvas 2d. The test page in comment 0 does not use canvas. Then Bug 1887818 seems not related.
When the video element did not have a rotation, video overlay was used. And when the video element had a rotation, video overlay was not used. It seems to affect to the problem.
Comment 8•6 months ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #7)
(In reply to Brad Werth [:bradwerth] from comment #4)
Anyway, the regression is in this range which I think clearly implicates Bug 1887818. Sotaro, would you please investigate?
Bug 1887818 affects only to accelerated canvas 2d. The test page in comment 0 does not use canvas. Then Bug 1887818 seems not related.
When the video element did not have a rotation, video overlay was used. And when the video element had a rotation, video overlay was not used. It seems to affect to the problem.
Ah, I apologize. I'll try a new mozregression.
Comment 9•6 months ago
|
||
Did another mozregression and got the same range. New regression theory is Bug 1871796. I'll try to revert it locally and see what happens.
Comment 10•6 months ago
|
||
Confirmed that setting sCanUseHWDecoder[MediaCodec::AV1] = false is sufficient to make the video consistently display the same background color -- which is not the same color at the page background. I think that confirms Bug 1871796 as the regressor.
Obviously we want to keep AV1 hardware decode on macOS. It's possible that this is a graphics issue, having something to do with how colors are rendered for surfaces from different sources. But since we are getting different colors in the background of the video with different decoders (darker with SW decode, whether or not rotation is applied) I think this actually is a media decode issue, and I'm assigning it to that component.
Comment 11•6 months ago
|
||
:jrmuizel, since you are the author of the regressor, bug 1871796, could you take a look?
For more information, please visit BugBot documentation.
| Reporter | ||
Comment 12•6 months ago
|
||
In Chrome and Safari, the background of the video is the same colour as the page, and that was author intent. So if the fix is to make it always not-match the page background, then that's an interop issue.
Comment 13•6 months ago
|
||
Set release status flags based on info from the regressing bug 1871796
Updated•5 months ago
|
Updated•5 months ago
|
Description
•