Video distortion with H.264 when using vaapi in Firefox on Linux - video has wrong size.
Categories
(Core :: Audio/Video, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox102 | --- | verified |
People
(Reporter: shtetldik, Assigned: stransky)
References
(Blocks 1 open bug)
Details
Attachments
(5 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0
Steps to reproduce:
When playing an H.264 encoded video in Firefox with vaapi enabled, there is a distortion that occurs at the bottom of the video (like a stripe of vertically repeated pixels).
I tested it on this example:
https://mirrors.dotsrc.org/blender/blender-demo/movies/BBB/bbb_sunflower_1080p_60fps_normal.mp4
See attached screenshot which demonstrates distortion on the bottom.
- Firefox 99.0b4 (Mozilla build) on Debian testing.
- GPU: Sapphire Pulse RX 6800 XT (so it's radeonsi_drv_video.so for vaapi support)
- This happens both with Mesa main and Mesa 22.0.0.
Additional settings:
about:config
media.ffmpeg.vaapi.enabled = true
environment:
MOZ_DISABLE_RDD_SANDBOX=1
I can't reproduce this with vaapi using mpv. Mesa developers suggested it's a Firefox bug. (For the reference, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6151 ).
Updated•3 years ago
|
Comment 1•3 years ago
|
||
I also have this with Firefox 98.0 on Fedora 35, and with similar about:config
settings, and the necessary RDD sandbox workaround.
Part of vainfo
output:
libva info: VA-API version 1.13.0
libva info: Trying to open /usr/lib64/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_13
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.13 (libva 2.13.0)
vainfo: Driver version: Mesa Gallium driver 21.3.7 for AMD Radeon RX 580 Series (POLARIS10, DRM 3.44.0, 5.16.14-200.fc35.x86_64, LLVM 13.0.0)
Assignee | ||
Comment 2•3 years ago
|
||
Can you attach a screenshot of that issue? I have similar setup but I'm not sure if I see that or not.
Thanks.
Assignee | ||
Comment 3•3 years ago
|
||
I see that https://gitlab.freedesktop.org/mesa/mesa/-/issues/6151 has the screenshot.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 4•3 years ago
•
|
||
It's related to Bug 1724385 - We need to set texture size correctly.
Yeah, just in case I already attached the screenshot above.
See: https://bugzilla.mozilla.org/attachment.cgi?id=9267965&action=edit
Assignee | ||
Comment 7•2 years ago
|
||
We need transfer aligned surface size, VA-API add extra width/height to decoded surface to keep 16px alignment
and some GL drivers (like AMD) refuses to create EGLImage when stride and width does not match (Bug 1724385).
Updated•2 years ago
|
Assignee | ||
Comment 8•2 years ago
|
||
There may be added pixels to VA-API decoded surface to keep 16px alignment.
Store the aligned size internaly as widthAligned/heightAligned and use that to create EGLImage only.
Depends on D146084
Assignee | ||
Comment 9•2 years ago
|
||
This is similar to Bug 1750858 but for VA-API, in this patch we set cropped frame size.
Depends on D146085
Assignee | ||
Comment 10•2 years ago
|
||
This is similar to Bug 1750858 but for VA-API.
Depends on D146086
Comment 11•2 years ago
|
||
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/64aa5dcbb275 [Linux] Add widthAligned / heightAligned to SurfaceDescriptorDMABuf r=sotaro https://hg.mozilla.org/integration/autoland/rev/f7e0860e5d7e [Linux] Store logical and aligned surface size for DMABufSurfaceYUV r=sotaro https://hg.mozilla.org/integration/autoland/rev/839c401d16c3 [Linux] Update VideoFramePool to pass frame size along VA-API surface decriptor r=alwu https://hg.mozilla.org/integration/autoland/rev/3a18b123610e [Linux] Pass frame size to VideoFramePool r=alwu
Comment 12•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/64aa5dcbb275
https://hg.mozilla.org/mozilla-central/rev/f7e0860e5d7e
https://hg.mozilla.org/mozilla-central/rev/839c401d16c3
https://hg.mozilla.org/mozilla-central/rev/3a18b123610e
Updated•2 years ago
|
Comment 13•2 years ago
•
|
||
Could not reproduce on Fedora 36 using FX build 98.0 (20220304153049) nor on Ubuntu 20.4 using 99.0b4(20220315185755) probably because I do not have the same GPU.
Can you please confirm issue is fixed on your side on latest Beta (https://archive.mozilla.org/pub/firefox/candidates/102.0b5-candidates/). Thank you.
Reporter | ||
Comment 14•2 years ago
|
||
This has been fixed for a while in beta, yeah.
Comment 15•2 years ago
|
||
Mark as verified based on comment#14.
Description
•