News for hackers. Stuff that matters.
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by kllrnohj on Tuesday December 19, 2023 @06:20PM (#38703342)
> Now we need OBS and Firefox supporting Vulkan video too.

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.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by jdiff on Tuesday December 19, 2023 @07:13PM (#38703820)
Firefox still has no support for hardware video decode on Linux. There's all sorts of shims for it, but I've never managed to get them functioning. Maybe Vulkan video decode could be the one agnostic API to rule them all this time, especially if it's more cross-platform than the current situation.
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by mattst88 on Tuesday December 19, 2023 @07:36PM (#38704026)
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by cesarb on Tuesday December 19, 2023 @08:07PM (#38704276)
How can I confirm whether Firefox is actually using hardware decode for videos on my machine for a given codec? Is there a magic keyword I should search for within the about:support page, or is it recorded somewhere else? Mine shows for instance "VP9_HW_DECODE default available", does this means it's using hardware decode for VP9, or merely that it might be possible for my Firefox version?
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by shmerl on Tuesday December 19, 2023 @08:15PM (#38704331)
At least with AMD GPU, an easy way to do it is to check usage of VCN.

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.enabled
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by mattst88 on Tuesday December 19, 2023 @09:44PM (#38704862)
On an Intel GPU, you can check the 'Video' percentage in `sudo intel_gpu_top` (from the igt-gpu-tools package) while playing a video.
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by padenot on Wednesday December 20, 2023 @03:20AM (#38706482)
We've put a dedicated section called Media in about:support, it has decoding capabilities and other things such as audio IO informations.

If 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".

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by cesarb on Wednesday December 20, 2023 @06:04AM (#38707333)
> We've put a dedicated section called Media in about:support, it has decoding capabilities

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.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by dhx on Tuesday December 19, 2023 @10:12PM (#38705037)
Whilst Firefox may support hardware video decoding, Mesa since March 2022 disables patent encumbered codecs by default[1], and distributions such as Fedora and OpenSuse do not explicitly enable these patent encumbered codecs to avoid possible legal problems. Even Gentoo (built from source code by the user) requires the user to explicitly enable a USE flag (proprietary-codes) to use patent encumbered codecs.[2]

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/[email protected]...

[4] https://news.ycombinator.com/item?id=38249527

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by Sunspark on Wednesday December 20, 2023 @01:36AM (#38706064)
I use the flatpak version of Firefox because my Linux machine is an immutable OS.

Hardware video decode is working for FF.

Not working for Chrome though, sadly.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by account42 on Wednesday December 20, 2023 @06:07AM (#38707350)
Which is of course a bullshit reason because Linux distributions don't ship the patented hardware decoders (because they are hardwared) so the user already has to assemble the complete system.

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

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by jdiff on Wednesday December 20, 2023 @05:42AM (#38707220)
My bad, that's what I get for commenting before bed. I meant to tack on an "on Nvidia" in there. AMD and Intel are well supported with VAAPI, but I've never managed to get any of the NV-to-VAAPI wrappers and shims working.
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by shmerl on Tuesday December 19, 2023 @08:13PM (#38704321)
Firefox has both decoding and encoding already supported via ffmpeg+vaapi. What would be nice to see is ffmpeg+vulkan path for it.
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by shmerl on Tuesday December 19, 2023 @08:12PM (#38704313)
I think a very simple reason is I'd rather rely on Vulkan driver for faster iteration, than on VAAPI. It's historically moving much slower since it first needs Intel to pull weight, then AMD to implement their side for example.
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by tagrun on Tuesday December 19, 2023 @08:52PM (#38704555)
> They have perfectly great existing hardware decoder offloading APIs via the various OS' native APIs for videos

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.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by mikepavone on Tuesday December 19, 2023 @08:59PM (#38704600)
> No, Firefox currently supports hardware video decoding with Intel's vendor specific VA-API only, which is not supported by NVIDIA.

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

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by tagrun on Tuesday December 19, 2023 @09:07PM (#38704644)
You can make the same argument for VDPAU. AMD officially supports it, and there is an unofficial translation layer with limited capabilities for some Intel GPUs. Is VDPAU not a vendor specific API anymore then?

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.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by mikepavone on Tuesday December 19, 2023 @09:23PM (#38704747)
Nouveau supports va-api on Nvidia. Nouveau is not supported by Nvidia of course.
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by tagrun on Tuesday December 19, 2023 @09:37PM (#38704820)
What of it? So does nvidia-vaapi-driver. They're third party projects, that's very different from "supported by the vendor", and doesn't change the fact that NVIDIA as a vendor offers no support for 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.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by mikepavone on Tuesday December 19, 2023 @11:19PM (#38705410)
> What of it?

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.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by account42 on Wednesday December 20, 2023 @03:48AM (#38706626)
Right, this is yet another instance of Nvidia not wanting to play nice with the other kids.
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by kllrnohj on Tuesday December 19, 2023 @10:25PM (#38705106)
> One vendor specific API, not "various OS' native APIs".

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.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by Dalewyn on Tuesday December 19, 2023 @10:59PM (#38705295)
I'm always annoyed how any Linux media player or encoder needs to bring its own entire media operating system, down to each individual nut and bolt.

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.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by shmerl on Tuesday December 19, 2023 @11:12PM (#38705364)
You don't need to implement every nut and bolt in the application. Lot's of useful things can do the heavy lifting (Pipewire, ffmpeg, libplacebo, Mesa and so on). Linux isn't after calling it all using some uniform "DirectFoo" naming scheme, but tools are there.

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.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by pjmlp on Wednesday December 20, 2023 @02:25AM (#38706250)
Hence why it will never be embraced by desktop application developers, and Electron it is.
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by account42 on Wednesday December 20, 2023 @03:58AM (#38706683)
Considering how user hostile most app developers are, I don't miss them.
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by shmerl on Wednesday December 20, 2023 @02:47AM (#38706345)
Yeah, keep complaining about everything not being proprietary enough, while everyone who needs just makes it work (OBS, mpv, etc.).
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by pjmlp on Wednesday December 20, 2023 @02:48AM (#38706348)
Those 2% will appreciate their efforts.
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by shmerl on Wednesday December 20, 2023 @02:49AM (#38706353)
Those who use it appreciate their efforts. You aren't using it, why are you even complaining especially with complete nonsense comments. Anti Linux shilling should be getting old.
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by pjmlp on Wednesday December 20, 2023 @03:55AM (#38706666)
Unfortunely I still have to, from time to time.

Luckly Android, ChromeOS and WebOS as proper Linux distributions have replaced most of it.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by bmicraft on Wednesday December 20, 2023 @05:44AM (#38707226)
Android hasn't displaced Linux on phones, there wasn't any.

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)

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by pjmlp on Wednesday December 20, 2023 @08:22AM (#38708340)
Oh boy, another Linux advocate on the lose.

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.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by arp242 on Wednesday December 20, 2023 @09:12PM (#38716268)
> Android, ChromeOS and WebOS, have replaced most of my needs

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.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by pjmlp on Thursday December 21, 2023 @02:30AM (#38717970)
You can ignore my comments you know.
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by shmerl on Wednesday December 20, 2023 @12:03PM (#38710848)
Stop wasting everyone's time.
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by pjmlp on Thursday December 21, 2023 @02:29AM (#38717966)
Likewise, go do some kernel contributions.
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by pjmlp on Wednesday December 20, 2023 @02:24AM (#38706243)
Yeah on UNIX side, NeXTSTEP, Irix, Solaris had their own thing, as graphical workstation UNIXes, and were great.

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.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by account42 on Wednesday December 20, 2023 @03:57AM (#38706675)
Install ffmpeg and you have all the codec support you need. How is this a real problem?

Yeah, binary software will have to ship its own copy of ffmpeg... This isn't unique to media codecs though.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by arp242 on Wednesday December 20, 2023 @09:21PM (#38716304)
And when someone installs some obscure or outdated and vulnerable codec on these systems, it's then automatically exposed to all sorts of applications to exploit. Maybe Windows sandboxes that these days(?) It was definitely a problem in the past.

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.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by tagrun on Wednesday December 20, 2023 @12:25AM (#38705743)
What is "incorrect"? The full sentence that you conveniently chose to cut in the middle before quoting (apparently to fit into some pessimistic forecast about the significance of Linux desktop) reads

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

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by Dylan16807 on Wednesday December 20, 2023 @02:51AM (#38706356)
> The full sentence that you conveniently chose to cut in the middle before quoting (apparently to fit into some pessimistic forecast about the significance of Linux desktop) reads

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.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by tagrun on Wednesday December 20, 2023 @10:52AM (#38710002)
My original statement above about what the point of Vulkan Video is

> The idea behind Vulkan Video Extensions is to have a vendor independent and cross-platform video API.

(emphasis added)

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by Dylan16807 on Wednesday December 20, 2023 @12:43PM (#38711337)
You did say that, but it's not the part of your post they were responding to.
Re:Vulkan video extensions for accelerated H.264 and H.265 e... by tagrun on Wednesday December 20, 2023 @01:20PM (#38711818)
> You did say that, but it's not the part of your post they were responding to.

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.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by Dylan16807 on Wednesday December 20, 2023 @08:50PM (#38716144)
> 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?

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.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by tagrun on Wednesday December 20, 2023 @01:16PM (#38711758)
> 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.

Obviously, I meant to say statement, not sentence, but I can't edit it anymore.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by vetinari on Wednesday December 20, 2023 @05:55AM (#38707284)
AMD AMF is not open-source; only the SDK part of it is. The runtime part is closed, bundled with the "pro" drivers.

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.

Re:Vulkan video extensions for accelerated H.264 and H.265 e... by geraldhh on Wednesday December 20, 2023 @04:22AM (#38706787)
> Why? They have perfectly great existing hardware decoder offloading APIs via the various OS' native APIs for videos

they are also plentiful, vendor specific and unstable.

a generic solution would be well appreciated