Open Bug 2023594 Opened 6 months ago Updated 5 months ago

Applying a rotation to a video causes colors to shift

Categories

(Core :: Audio/Video: Web Codecs, defect, P3)

defect

Tracking

()

Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- wontfix
firefox148 --- wontfix
firefox149 --- wontfix
firefox150 --- wontfix
firefox151 --- wontfix

People

(Reporter: jakea, Unassigned, NeedInfo)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Attached image Screenshot of issue —

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.

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.

Flags: needinfo?(jaffathecake)
Attached video Video of the issue —

Here's a video description of the issue (includes audio)

Flags: needinfo?(jaffathecake)

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.

Component: Audio/Video: Playback → Graphics

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?

Severity: -- → S3
Flags: needinfo?(sotaro.ikeda.g)
Keywords: regression
Priority: -- → P3
Regressed by: 1887818

Set release status flags based on info from the regressing bug 1887818

Hmm, I always see the color shit both rotated and not rotated on Windows, on macOS and on Linux.

(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.

Flags: needinfo?(sotaro.ikeda.g)

(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.

No longer regressed by: 1887818

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.

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.

Component: Graphics → Audio/Video: Web Codecs
Regressed by: 1871796

:jrmuizel, since you are the author of the regressor, bug 1871796, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(jmuizelaar)

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.

Set release status flags based on info from the regressing bug 1871796

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: