Vulkan video extensions for accelerated H.264 and H.265 encode
khronos.org
khronos.org
That's good.
By the way, mpv already supports Vulkan video decoding:
https://github.com/mpv-player/mpv/issues/11739
Now we need OBS and Firefox supporting Vulkan video too.
On Linux it should be a better option than VAAPI once drivers will support it. Since Firefox is using ffmpeg anyway, it probably shouldn't be too hard to make it an option.
Decoding h264/h265 in fixed (CPU) hardware is much more efficient than on the GPU.
Don’t get me wrong, its still miles and miles better than software decode.
Intel CPUs without iGPU, like the F-series, do not support QSV.
The only difference is the vulkan spec is _in theory_ cross-platform. However, since MacOS doesn't support Vulkan and MoltenVK doesn't implement this extension (and probably won't), and this extension also isn't implemented on Android, then your scope of actual availability is quite pathetic. So it probably doesn't make sense to move off of VAAPI regardless unless you really want Linux & Windows to share a codepath, even though you have something OS-specific anyways for MacOS/iOS & Android.
Since Khronos appears to have decided to require manual DPB management, this cannot be implemented in HW on macOS by MoltenVK.
not a thing. at worst you get a situation where the ICD loader isn't installed
Often nvidia users will try to debug it, and discover 'the vulkan checkbox is off but I have the latest driver version!' in gpuZ[0][1] - but it happens across all IHVs, AMD, Intel, etc. I was told by someone in the industry the default Microsoft drivers across all IHVs indeed have DirectX, but not Vulkan.
To make matters more annoying, Windows Update often _overwrites_ the user's driver which they installed from the manufacturer directly, leading to Vulkan becoming broken overnight[2][3]
Easy to find multiple instances of this happening[4][5][6], I became aware of it because of someone asking on /r/vulkan a few weeks ago.
[0] https://i.imgur.com/qj3Rn9p.png https://rog-forum.asus.com/t5/rog-strix-series/nvidia-driver...
[1] https://forums.x-plane.org/index.php?/forums/topic/228597-vu...
[2] https://www.reddit.com/r/Amd/comments/1145ffp/windows_update...
[3] https://answers.microsoft.com/en-us/windows/forum/all/window...
[4] https://i.imgur.com/PXZRxYh.png
[5] https://www.reddit.com/r/pcmasterrace/comments/qhfesc/vulkan...
[6] https://www.reddit.com/r/techsupport/comments/110bytq/vulkan...
The Vulkan implementation is still there. You just have to install the redistributable. (see https://vulkan.lunarg.com/sdk/home - Runtime)
There's no separate Vulkan-less version of the drivers AFAIK - it's just that the installation program of the manufacturer doesn't run so that there's no opportunity to install the Vulkan runtime.
My original point remains: out of the box, many Windows users find they have the 'latest drivers' for their graphics card, find that DirectX 12 is working fine on their system, while simultaneously finding Vulkan does not.
For games, it's fine to require users to fix their Vulkan drivers. But if you're making a video player and want to leverage hardware decoding.. I think this is an aspect you should be concerned about and aware of.
As pointed out elsewhere, it's not possible on macOS either way. Apple are too stuck up not supporting Vulkan and it won't work with MoltenVK.
Why? They have perfectly great existing hardware decoder offloading APIs via the various OS' native APIs for videos. Why use Vulkan video extensions? It seems like it just complicates things since MacOS/iOS and Android are unlikely to get these and Vulkan on Windows' is a second-class citizen as well. Not to mention the feature & API availability is lagging very far behind native APIs that they're already using.
It's not a bad extension necessarily, seems like it'd be a great option for games that want to integrate some cutscenes. But if you have an existing solution, it also doesn't seem valuable to migrate to this, either.
That's not true at all. See:
https://www.omgubuntu.co.uk/2023/07/firefox-115-intel-gpu-vi... https://www.phoronix.com/news/Mozilla-Firefox-115 https://www.omglinux.com/firefox-hardware-acceleration-raspb...
Something like this (assuming your GPU index is 0):
watch -n 1 sudo cat /sys/kernel/debug/dri/0/amdgpu_pm_info
You should see there: VCN: Enabled
If GPU accelerated video is being played.I think you might need to set this flag to true in Firefox's about:config (or it might be not needed anymore):
media.ffmpeg.vaapi.enabledIf you find that it is not accurate, e.g. by cross-checking via other means, please open a ticket at https://bugzilla.mozilla.org/enter_bug.cgi, component "Audio/Video".
I see, I hadn't found it when searching for the codec name because it only said something like "Information not available. Try again after playing a video." After opening a random YouTube video and refreshing about:support, it did show the hardware decoding information, and it was as I had expected given the hardware on this computer.
The thought process is that AMD, NVIDIA, Intel and the likes are not providing a patent license with their hardware.[3] They are instead just supplying part of an overall system that together with operating system kernel, display manager software, video player software, etc allows the decoding and encoding of patent encumbered video files. Open source software projects and distributions are concerned they'd be found to be infringing patents by enabling a complete solution out-of-the-box. Hence they put some hurdles in place so that a user has to go out of their way to separately piece together the various parts to form a complete system capable of encoding and decoding patent encumbered codecs.
edit: To clarify, if your Intel or AMD GPU/APU supports a patent-free codec such as AV1 (most GPUs/APUs available for sale?), Firefox on a standard Linux distribution will use hardware video decoding out of the box by default for the patent-free codec. The issue is really one of whether you're sourcing content from a provider that uses a good choice of codec like AV1. The good news is that patent trolls are doing a good job of pushing laggard content providers down this path.[4]
[1] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15...
[2] https://github.com/gentoo/gentoo/commit/1265a159743d7f07185a...
[3] https://lists.fedoraproject.org/archives/list/devel@lists.fe...
Hardware video decode is working for FF.
Not working for Chrome though, sadly.
> a provider that uses a good choice of codec like AV1
Much more limited HW support and slow as molasses encoders. Not exactly a good choice for most.
One vendor specific API, not "various OS' native APIs".
Firefox currently supports hardware video decoding with Intel's vendor specific VA-API only on Linux, which is not supported by NVIDIA. (A third-party VA-API to NVDEC translation layer for Linux does exist on GitHub, nvidia-vaapi-driver, but it's not yet reliable as the officially supported VDPAU or NVDEC, and is not included in official linux package repositories.)
Intel has VA-API, AMD has AMF, and NVIDIA has VDPAU which is being replaced by NVDEC/NVENC.
The idea behind Vulkan Video Extensions is to have a vendor independent and cross-platform video API.
Intel is behind VA-API originally, but I don't think it's fair to say it's a vendor specific API anymore. It's supported by the open source drivers for GPUs from all 3 vendors. It's just that the open source drivers for Nvidia cards are not very practical and the proprietary drivers only support vdpau and nvdec/nvenc
Intel, AMD and NVIDIA have their own vendor-specific video APIs, and even when they provide official support for the API of another vendor, it tends to expose a limited subset of the full functionality (like the list of available codecs and encoding features).
You are free to call these vendor specific APIs for what they are or something else, but the reality has been that there is no single video API officially supported by Intel, AMD and NVIDIA. This changed with Vulkan Video.
But Vulkan Video isn't just about desktop: mobile devices, Raspberry Pi, etc. are expected to get on board with it eventually, just like they did with Vulkan.
> It's supported by the open source drivers for GPUs from all 3 vendors.
Which 3 vendors are you referring to? Intel, AMD, and who?
> It's just that the open source drivers for Nvidia cards are not very practical and the proprietary drivers only support vdpau and nvdec/nvenc
Why are you bringing up open source drivers, and what is not practical? Both official open source drivers (open-gpu-kernel-module) and unofficial open source drivers (nouveau, through binary firmware) support VDPAU. However, NVIDIA's drivers (open source or binary) does not support VA-API.
By the way, nouveau's support is currently limited and not useful: https://nouveau.freedesktop.org/VideoAcceleration.html see Video engine support status table, only old GPUs and no H.265 or AV1 support.
It was an answer to this question specifically
> Which 3 vendors are you referring to? Intel, AMD, and who?
I either missed some of the other text in your post or it was added after I started to reply.
> Both official open source drivers (open-gpu-kernel-module)
This is not remotely close to being a complete graphics driver. Most of a GPU driver on Linux is in userspace and there is no official open source user space component.
> Why are you bringing up open source drivers, and what is not practical?
nouveau has never been practical for serious use due to poor performance and mediocre hardware support (as you noted). open-gpu-kernel-module is only practical when paired with a proprietary userspace driver.
Anyway, my original point in all this is that describing VA-API as an Intel vendor specific API is unfair given it has been well supported on AMD GPUs for a long time now and on nouveau it's supported as well as VDPAU (i.e. not very well as you note). I did not intend to imply that it was universal. I didn't even intend to imply that VDPAU is a vendor specific API (though as a decode-only API it's not really a complete replacement).
Intel tried to make va-api the standard for hardware encode and decode on Linux, Nvidia tried to make VDPAU the standard for hardware decode on Linux. Neither was entirely successful. By contrast, NVENC/NVDEC, AMF and the Intel Media SDK (and whatever they replaced this with) never had such ambitions.
Incorrect. Firefox uses Windows Media Foundation, which is cross-vendor, on Windows. It uses MediaCodec on Android which is again cross-vendor. Presumably it uses whatever iOS' equivalent is as well.
It only uses VA-API on a single OS, Linux, and that's probably more a reflection on the media qualities (or lack thereof) of Linux as a whole. Maybe Vulkan video extensions will be the savior on Linux. Or maybe it won't because it won't be anyone's focus of investment since it's largely a Linux-only problem in the first place.
On Windows there's Windows Media Foundation and DirectShow that centrally manage everything and also support the "individual nut and bolt" approach. Android has its own central thing (MediaCodec?) that must be used. MacOS and iOS presumably have their own central manager (Quicktime?) too.
But Linux? It doesn't serve as an operating system for media. It's tremendously inconvenient as an admin/user rather than an evangelist.
Comparison is also invalid. Linux as a whole (not the kernel but OS experience) isn't controlled by some Big Brother who decides what and how it's done single mindedly. So such kind of composite result is somewhat expected.
Luckly Android, ChromeOS and WebOS as proper Linux distributions have replaced most of it.
ChromeOS hasn't displaced Linux on school laptops, there wasn't any.
LG WebOS hasn't displaced "Linux", it competes with Google TV (formerly Android TV)
So here goes a children explanation.
> Unfortunely I still have to, from time to time.
I, pjmlp, still have to use GNU/Linux desktop from time to time.
> Luckly Android, ChromeOS and WebOS as proper Linux distributions have replaced most of it.
Android, ChromeOS and WebOS, have replaced most of my needs, pjmlp, for GNU/Linux in the desktop and similar devices.
Great! I really hope you're happy with that setup! It's your personal computer and by all means, do what works well for you. In the end that's always a personal thing that's different for everyone. Who am I to judge how you use your computer?
But maybe ... stop complaining about Linux desktop then? If you don't like it? This must be like the 3rd time I've seen these types of single-line dismissive "Linux will never win the desktop"-comment from you in the last few days. Just one line, little or no context, or explanation, and IMHO also zero value, and an entire discussion derailed.
This is just becoming disruptive. You don't need to say anything you know. Personally, I rather dislike a number of things, but you don't see me complaining about it with one-liners every chance I get – and when I do say something, at least I make sure it's something of some substance, when I feel it actually contributes. And I sure as hell don't go around complaining people are "children" for disagreeing.
Ideally that kind of thing would be part of GNOME, or KDE, but then there are those that rather keep using twm like experience, making GNU/Linux really only good for headless experiences, at least the UNIX/POSIX part is always there.
Yeah, binary software will have to ship its own copy of ffmpeg... This isn't unique to media codecs though.
No perfect solutions here; both "system-wide codecs" and "every application brings their own codecs" have their own up- and downsides.
Besides, with ffmpeg and gstreamer the system-wide codecs paradigm also works on Linux.
This is one of those "it's different but it doesn't really matter much" type of things. Most people "just" install vlc or mpv or whatnot and things will "just work" for them, not really different from Windows. That it's technically slightly different is almost entirely transparent to the user.
> Firefox currently supports hardware video decoding with Intel's vendor specific VA-API only on Linux, which is not supported by NVIDIA.
(emphasis added)
You further wrote:
> Firefox uses Windows Media Foundation, which is cross-vendor, on Windows. It uses MediaCodec on Android which is again cross-vendor.
And? None of those APIs are cross-platform. Vulkan Video will eventually allow developers (including Firefox developers) to write a single code path for video to cover a wide range of platforms and vendors (likely with the exception of walled gardens like Apple-land, although someone might find a way to support like via a wrapper like MoltenVk for Vulkan).
What are you talking about? They didn't quote that sentence at all, and didn't cut in the middle of the sentence they quoted.
> And? None of those APIs are cross-platform.
Your original objection, the thing that got quoted, was about whether things are cross-vendor. That question is completely unrelated to whether things are cross-platform.
> The idea behind Vulkan Video Extensions is to have a vendor independent and cross-platform video API.
(emphasis added)
So if someone criticizes a portion of your statement which is already countered by your original full statement, you're not allowed to remind your full statement. What kind of logic is that?
My original post says the point of Vulkan Video is it will be cross-platform and cross-vendor. And gives one example of cross-vendor side of things on Linux.
Someone criticizes me by essentially saying "you are incorrect, that's only on Linux. Windows, Android and iOS have their own video APIs...". This "correction" is incorrect because I already said on Linux, and it goes on to actually reinforce the post that he is responding to by highlighting cross-platform side, which also is in the post he is responding to.
So, if you look at the full conversation, the criticism is self-contradictory. This is what I'm pointing out, but you are implying I'm not allowed to do that.
I disagree. When you fragment a statement in a way that changes its meaning and make a straw man out of it, people are justified in responding to it.
The other stuff in your comment did not "counter" what they said. You made statements about cross-vendor and cross-platform. They chose to only respond to one of those statements. That's not incorrect.
> This "correction" is incorrect because I already said on Linux
The first part of your comment specifically said "not "various OS' native APIs"". That goes beyond Linux. The later part of your comment was about Linux in particular, but your introduction was an overall statement that wasn't true.
> When you fragment a statement in a way that changes its meaning
They didn't. You misspoke and they didn't know what you actually meant.
And from your other post: > Obviously, I meant to say statement, not sentence, but I can't edit it anymore.
That was not obvious. They quoted an entire paragraph, and the subsequent paragraph does not change its meaning the way you're claiming it does.
Obviously, I meant to say statement, not sentence, but I can't edit it anymore.
It is also intended as a multi-platform abstraction.
This makes it a no-go as a platform API. The open drivers for AMD use VA-API.
they are also plentiful, vendor specific and unstable.
a generic solution would be well appreciated
Also, maybe someone knows more about this, but I thought that most software like Firefox, MPV and VLC are using dav1d for AV1 decoding as it seems to be the most performant AV1 decoder (in Software) out there at the moment.
See the post. They are working on AV1 extensions.
mpv for example can use Vulkan for both at the same time.
The primary choices are space savings and power efficiency. Dedicated hardware and serial decoding/encoding often win out as a result.
You can encode the independent groups of pictures (the key frame and all the subsequent predictive frames until the next key frame) in parallel but at least with 4k video you hit memory bandwidth limitations quite quickly.
With adaptive key frame placement you don't know the intervals up front, and they might have wildly different lengths. Some might be hundreds of frames, some might be just a few.
It's the non-linear-algebra stuff that is usually problematic.
However, most formats allow for some parallelism at the "macroblock" level - you can usually decode all 16x16 pixels simultaneously. To some extent you can decode macroblocks separately, but "intra prediction" requires you to have the ones above and to the left available.
It reduces the compression efficiency, but only a little, because the tiles will be quite large anyway, such as 6 tiles per frame (but can be more for 360 video applications). It can be limited by the number of decoding instances a piece of hardware can have concurrently.
Seems like for VR video, if it’s split up longitudinally you would only have to decode the tiles that are in the direction the user is looking at any given time, and just let the other bits pass by undecoded.
how to exceed the character limit on your super wide screen with just one function name
import vkGetPhysicalDeviceVideoEncode;
QualityLevelPropertiesKHR(...);
Or even better: import vk*PhysicalDeviceVideoEncode;
Get_QualityLevelPropertiesKHR(...);