Update Snap libs to support VAAPI AV1 hardware decoding
Categories
(Firefox Build System :: Third Party Packaging, enhancement)
Tracking
(Not tracked)
People
(Reporter: michel.memeteau, Assigned: olivier)
References
(Blocks 1 open bug)
Details
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0
Steps to reproduce:
Use default firefox snap on Ubuntu 22.04 to play web video with AV1
Vaapi enabled in firefox ( works with VP9 )
Actual results:
video is software decoded
Expected results:
Video could be hardware decoded on supported hardware if ffmpeg is up to date , 5.1 tested on 22.04 worked perfectly for AV1
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Reporter | ||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 2•2 years ago
|
||
https://github.com/canonical/firefox-snap/blob/767875a21a6bd2c543fdee4119e67fbe5b7d2f53/snapcraft.yaml#L438-L439 explicitely states they want to stay on a lower version for compatibility reasons ?
Reporter | ||
Comment 3•2 years ago
|
||
Yes because FF Snap was based on Core20, and soon core22
Comment 4•2 years ago
|
||
(In reply to michel memeteau from comment #3)
Yes because FF Snap was based on Core20, and soon core22
And my understanding is that core22 work is ongoing per your comment https://bugzilla.mozilla.org/show_bug.cgi?id=1760941#c31 and there is no specific extra work required to do so. Why filing this bug ?
Reporter | ||
Comment 5•2 years ago
|
||
This bug is specific to AV1 HW decoding
either FF deb 22.04 or FF snap based on Core22 won't have a ffmpeg version recent enough that could hw decode AV1
Assignee | ||
Comment 6•2 years ago
|
||
core22 uses ubuntu 22.04, which has version 4.4.2 of ffmpeg.
According to Michel, we need ffmpeg 5 to support hardware-accelerated AV1 decoding, so we would need to build ffmpeg 5 from source as part of the snap build.
Assignee | ||
Comment 7•2 years ago
|
||
When building ffmpeg from source, we'll need to make sure potentially problematic codecs (from a legal point of view) are not built.
Comment 8•2 years ago
|
||
Martin, would it be just fine to use our in-tree ffmpeg code? I'm more worried about the legal aspects, as Olivier pointed.
Comment 9•2 years ago
|
||
AV1 VA-API is broken right now - Bug 1793507. Perhaps due to internal ffmpeg update to 5.0.x line.
Comment 10•2 years ago
|
||
To be clear, AV1 is HW decoded by bundled ffvpx, external ffmpeg is not used for it. External ffmpeg is used for H.264 only.
Reporter | ||
Comment 11•2 years ago
|
||
Thanks martin : is there a documentation page that explain how codecs are handled in Firefox ?
Especially , I'm wondering if widevine might be one day decoded through Vaapi , something that macOS and WIndows have a step further compared to linux if I'm right.
But I can confirm that upgrading system ffmpeg to 5.1.2 through PPA on Linux with libvpx disabled in prefs.js made AV1 VAAPI decoding possible
Reporter | ||
Updated•2 years ago
|
Comment 12•2 years ago
|
||
(In reply to Martin Stránský [:stransky] (ni? me) from comment #10)
To be clear, AV1 is HW decoded by bundled ffvpx, external ffmpeg is not used for it. External ffmpeg is used for H.264 only.
So that would mean this is orthogonal to Snap? I dont see anything disabling ffvpx in the build of the snap package, so I would assume that we still use it. Michel's comment #11 would suggest this is the case, since he has to disable the pref to force use the system's libvpx.
So if Snap uses bundled ffvpx for AV1 decoding and it is currently broken, there is no specific handling to perform on Snap package. I don't remember if bundled ffvpx is disabled on deb packages though.
At best, hacking Snap package would be indeed a workaround for bug 1793507.
Comment 13•2 years ago
|
||
Yes, it's dupe of Bug 1793507.
Comment 14•2 years ago
|
||
The fix was landed in central, it should work on Firefox Nightly (edge channel of Snap package), can you confirm?
Reporter | ||
Comment 15•2 years ago
|
||
Quickly tested Snap edge On AV1 GPU capable hardware ( Iris XE )
With
media.ffmpeg.vaapi.enabled = true
media.ffvpx.enabled = false
Result
-> No Vaapi either with VP9 or AV1
Same with media.ffvpx.enabled = true
I guess because it needs to be based on core22 to have required libva
Anyway I m not ure I understand your target ? Do you want AV1 hw decoding to be handled by bundled libffvpx ? over libffmpeg ?
Comment 16•2 years ago
|
||
(In reply to michel memeteau from comment #15)
Quickly tested Snap edge On AV1 GPU capable hardware ( Iris XE )
Withmedia.ffmpeg.vaapi.enabled = true
media.ffvpx.enabled = falseResult
-> No Vaapi either with VP9 or AV1Same with media.ffvpx.enabled = true
I guess because it needs to be based on core22 to have required libva
No, as mentionned in comment 10, decoding is to be done by bundled FFVPX
Can you verify the version and make sure it includes https://hg.mozilla.org/mozilla-central/rev/2f5cc64f2978 and https://hg.mozilla.org/mozilla-central/rev/7284ad26b1c5 ?
Reporter | ||
Comment 17•2 years ago
|
||
(In reply to Alexandre LISSY :gerard-majax from comment #16)
(In reply to michel memeteau from comment #15)
I guess because it needs to be based on core22 to have required libva
No, as mentionned in comment 10, decoding is to be done by bundled FFVPX
OK ffmpeg is not involve but as libva ( and iHD driver ? ) is too old on Core20 , ffvpx cannot initialize the vaapi stack ( GLX VAAPI error is thrown ) when running on Iris XE as Olivier explained
Description
•