Closed Bug 1726186 Opened 3 years ago Closed 2 years ago

[video color range changes] Video whiter while using VAAPI hwaccel

Categories

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

Firefox 92
x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox-esr91 --- disabled
firefox91 --- disabled
firefox92 --- disabled
firefox93 --- disabled
firefox94 --- disabled
firefox95 --- disabled
firefox96 --- fixed

People

(Reporter: niko2040, Assigned: stransky)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Attached image vaapi_compare.png

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0

Steps to reproduce:

Video played with VAAPI hardware decoding are whiter then without one. Tested on Debian and ArchLinux with Firefox, Firefox Developer Edition and Firefox Nightly.

Actual results:

On video black colors become gray and the whole gamma are more whiter than its should be.

Expected results:

Colors on videos with VAAPI enabled and disabled must be the same.

The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

I also have this issue after update to Firefox 91.

Hi Martin, would you mind having a look?

Severity: -- → S3
Flags: needinfo?(stransky)
Priority: -- → P3

Thanks for the report!

"good" = black
"bad" = dark grey
MOZ_X11_EGL=1 mozregression --good 2021-05-01 --bad 2021-08-20 --pref gfx.webrender.all:true media.ffmpeg.vaapi.enabled:true media.rdd-ffvpx.enabled:false media.rdd-vpx.enabled:false media.webm.enabled:false -a 'https://www.youtube.com/embed/JeQuelXsUYA?start=68'

17:54.57 INFO: Last good revision: 46f6770282875a567f6d6fc2c1cda0da05d0ba98
17:54.57 INFO: First bad revision: ab0835f9c26792583c502be43100222deae798ca
17:54.57 INFO: Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=46f6770282875a567f6d6fc2c1cda0da05d0ba98&tochange=ab0835f9c26792583c502be43100222deae798ca

ab0835f9c26792583c502be43100222deae798ca Jeff Gilbert — Bug 1459526 - Handle full-range video in Webrender. r=gw,lsalzman

h264 vaapi hardware decoding:
MOZ_X11_EGL=1 mozregression --launch 2021-08-20 --pref gfx.webrender.all:true media.ffmpeg.vaapi.enabled:true media.rdd-ffvpx.enabled:false media.rdd-vpx.enabled:false media.webm.enabled:false -a 'https://www.youtube.com/embed/JeQuelXsUYA?start=68'

h264 software decoding:
MOZ_X11_EGL=1 mozregression --launch 2021-08-20 --pref gfx.webrender.all:true media.ffmpeg.vaapi.enabled:false media.rdd-ffvpx.enabled:false media.rdd-vpx.enabled:false media.webm.enabled:false -a 'https://www.youtube.com/embed/JeQuelXsUYA?start=68'

I can confirm that it's still black with software-decoding, but since bug 1459526 it's dark grey with hardware decoding.
@jgilbert: Is this behavior expected?

Status: UNCONFIRMED → NEW
Has Regression Range: --- → yes
Has STR: --- → yes
Ever confirmed: true
Flags: needinfo?(stransky) → needinfo?(jgilbert)
Keywords: regression
OS: Unspecified → Linux
Regressed by: 1459526
Hardware: Unspecified → x86_64

Sounds like a bug. We don't test that config I think, so step one is adding expectations here for that config.

Flags: needinfo?(jgilbert)

I think dmabuf surface provides incorrect info about YUV color range.

Summary: Video whiter while using VAAPI hwaccel → [video color range changes] Video whiter while using VAAPI hwaccel

I've been troubleshooting and it definitely seems like an issue with YUV range. Videos with TV range don't get expanded correctly, so (0, 0, 0) in the original is rendered as (16, 16, 16) and (255, 255, 255) as (235, 235, 235). Files encoded with the full YUV range are rendered properly, and disabling VAAPI fixes partial range files.

It's very strange that we'd see it misinterpreting narrow as full instead of vice-versa.
We should see if we can't just flip that pref and test this on CI.

See Also: → 1727490

Is there currently any workaround for this bug? I don't want to disable hardware accelerated decoding since I run multiple cpu intensive programs beside the browser, but the washed out appearance is too distracting

I can confirm that this is also a problem in Ubuntu 20.04 and Firefox 92.0 with Intel i915 driver.

I tried changing the HDMI output back and forth between full and limited range, but videos in Firefox look washed out regardless.

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

No progress on this one? Any workaround if possible would be appreciated (except disabling hardware acceleration)

This happens to me with both Intel and AMDGPU on both Ubuntu 20.04 and 21.10 when I get a video with a vaapi supported codec, like vp9.

Vaapi doesn't kick in with AV1, and the "Monitor Color Test / Monitor-Farbtest (RGB/CMYK) (1080p)" seems to be served with AV1 only for me.

That doesn't surprise me—hardware AV1 decode support is only on the very latest hardware (Ampere, RDNA2, Rocket Lake, Tiger Lake, Alder Lake), and even then I'm not sure if Firefox supports it. If you want to try that monitor test video, you can use an extension like enhanced-h264ify to forcibly disable AV1 playback on YouTube.

Yes, I see that. On theater mode the video borders are black but video itself is lighter somehow.

I have the same issue AMDGPU, Ubuntu 21.10

VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde PRO [Radeon HD 7750/8740 / R7 250E]
Kernel driver in use: amdgpu

I wonder why there even was support added for full range video. I don't think it is a realistic occurrence for SDR video. Anyway, this should be easy to solve, even ad additional range conversion as a workaround should be mostly free on GPU. A bit sad that it's been months.

Assignee: nobody → stransky
Status: NEW → ASSIGNED
Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/dba9ac6ddb57
[Linux] Don't advertise full range color for DMABufSurfaceYUV, r=rmader
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch

Since the status are different for nightly and release, what's the status for beta?
For more information, please visit auto_nag documentation.

See Also: → 1743577

This is now out on the 96 beta branch, works well for me!

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

Attachment

General

Creator:
Created:
Updated:
Size: