Khronos Releases AV1 Decode in Vulkan Video with SDK Support for H.264/H.265
khronos.org
khronos.org
Yes it is. Very useful. The vast majority of people use laptops now, not desktop computers with 120mm tower coolers anymore, and if you want to switch to Linux then not having video decode nuke your battery life and turn your tiny fans into a Pratt & Whitney, then this is another welcome change to closing the gap to Windows.
People, especially on the Linux side, need to stop viewing the world as if everyone still has desktop towers PCs tucked under their desks while disregarding the software issues and deficiencies that only plague laptops, which are the majority of the marketshare and have vastly different constrains than desktops.
The benefits of hardware decoding are lower power consumption (read: electricity bills) and offloading the work to dedicated co-processors freeing up resources on the CPU proper, which are indeed far less relevant on desktops and even laptops which can just pack big batteries.
The biggest beneficiaries are by far mobile devices and really low power hardware. Computers which either cannot practically carry more batteries or which use hardware that simply aren't performant for more important reasons.
Desktops and laptops meanwhile are better geared to benefit from the perks of software decoding: Better quality and versatility, and fine-tuning of filters and rendering paths.
Even on a modern Ryzen laptop APU, if I run H265 or AV1 4k decode in software the CPU usage is vastly noticeable. On my older Intel i5 6300HQ they're pegging it at 100% .
Way back 20 years ago, you would have had a point. But today? CPUs are several orders of magnitudes of overpowered for the task.
I wasn't talking about having problems decoding, I was talking about software decode screwing your battery life due to high CPU usage on certain streams. Which is a problem, but not something most people who don't have laptops care about.
Do you watch your anime on a desktop or a laptop on battery?
The very slight increase in CPU processing and thus power use doesn't bother me at all. The screen takes more power than the CPU.
I habitually have Task Manager minimized in the tray area because I like monitoring my CPU usage at a glance, and decoding video in software simply does not even register as a noticable blip anymore.
Now that I think of it with your claim of it not even registering as a blip in taskmanager I'd actually argue you're probably using hardware decoding without noticing, because I wouldn't know which player (esp if on Windows) wouldn't make use of it.
> Hardware decoding is not enabled by default, to keep the out-of-the-box configuration as reliable as possible. However, when using modern hardware, hardware video decoding should work correctly, offering reduced CPU usage, and possibly lower power consumption. On older systems, it may be necessary to use hardware decoding due to insufficient CPU re‐sources; and even on modern systems, sufficiently complex content (eg: 4K60 AV1) may require it.
My setup is Media Player Classic Home Cinema, splitting and decoding via LAVFilters, then fed through ffdshow for some filters, before finally rendering on Enhanced Video Renderer.
Nowhere in the pipeline is the GPU involved as far as decoding is concerned, it's all deliberately software on the CPU.
You're pretty vague so far, so it could be that you're watching a software decoded 360p h.264 video on a Threadripper, in that case I agree.
It will be a very different situation when you try to watch 4K h.265 / AV1 video on a couple of years old laptop dual-core CPU.
CPU anything ranging from an i7-14700K to an i3-2100 (yes, Sandy Bridge). Seriously, decoding video has never been a significant workload for over a decade.
>4K h.265 / AV1 video on a couple of years old laptop dual-core CPU.
Kindly, why the hell would I even watch 4K video on a laptop? Y'all keep throwing out contrived situations like that, meanwhile I'll be a sane man living in reality and re-encode it (in software, finer tuning of parameters) in my spare time down to 1080p or 720p so I save myself precious disk space and CPU usage while travelling.
Because that's the file I have on hand. Why on earth would I re-encode it if I want to watch it once?
I also connect my laptop to my 32" 4K screen. There the battery life is not a consideration, but the spinning fan is.
> in my spare time down to 1080p or 720p so I save myself precious disk space and CPU usage while travelling.
Your use case might work for you, and that's fine, but you claim that software decoding is universally not a problem. But it is, if you don't limit yourself to 720p h.264 pre-encoded at home. Most people are not fine with having to do this and having to limit themselves to low resolutions / bad IQ.
How about if you have a 4K monitor plugged in? Or if your notebook display is itself 4K (which is a completely valid configuration nowadays)?
I have a pretty beefy laptop with an RTX 3080. I regularly watch BDRips that exceed 50+ Mbps, and software decoding even on my 8-core Intel Xeon will cause some stutters. Hardware decoding is just so much faster.
Just to be clear, 4K is 9 times the load of 720p. 4K60 is 18 times.
Otherwise even my desktop struggles when it comes to 4K60 video decoding on the CPU.
It was also the first to start using 10 bit color profiles.
Some release groups are particularly insistent on producing high quality releases and use FLAC for audio (even if the source tracks were in lossy format), and very high bitrate video.
Battery life is everything, no one cares about electricity bills on a laptop or phone, but they do care if the phone or laptop dies sooner than it has to.
Linux (especially the kernel) isn’t even tuned for towers. It’s tuned for servers.
The defaults make horrible optimizations all in the name of throughput > latency.
Re desktop use - even there the energy efficiency is a win, especially for continuous use. e.g. I've always got YT open
You're still left with the non-lossy compression step, so one could do something like "unzip", repackage data throwing away the high-frequency stuff, "zip".
Wouldn't surprise me if you can do something similar with h264/h265.
AWS sells a $100k 1u encoder box to broadcast companies. They buy that because there's hardly a 2nd best to speak of.
Encoding 15min of 8k source material on i9 9900k (that was 2019 and THE fastest CPU on the market) took me 19h.
Same for decoding, any mobile device will drink battery like it's water on Sahara.
Video is unusable without HW acceleration.
If thats your experience, then something is off with your setup.
Hardware decoding on a modern computer might seem equally fast as software until you look at power usage where hw decode is a hard win. Even so, the resources used to decode modern high end codecs like x265 or av1 will be major and hard to miss.
but anyway discussed are encoding &decoding.
And video encoding goes from like 3 fps in software to 100s of fps in hardware, making it possible at all with any resolution and quality to speak of.
You need encoding to stream your video, like in a video meeting.
Soft: ffmpeg -i {src} -map 0:v -f null -
Hard: ffmpeg -hwaccel cuda -i {src} -map 0:v -f null -
the result I get is: Source Hard Soft
1080p-h264 25.1x 37.1x
1080p-h265 26.4x 36.5x
4k-h264 5.5x 7.1x
4k-h265 5.5x 6.5x
this is on an old CPU (i7-6700K) and a somewhat recent GPU (RTX 2060) and with ffmpeg 6See ffmpeg docs for the hw decoding name, like nvdec iirc for nvidia cards.
I've been working with video transcoding/broadcasts a lot and software decoding was still worth it in large amount of cases - mostly because the CPUs these days (threadrippers & co) can handle significantly more concurrent encodes than the HW decoders.
HW decoders are built to play video on your PC so you can watch a movie and usually don't supoprt all that many concurrent streams and aren't all that fast (they "just" need to be realtime, after all). That's amazing on playback devices (pretty much mandatory for H.265/AV1), but for "2U racks at Amazon" that's not very useful and large cored CPUs are still kings. Especially since software encdoders are still massively winning on visual quality per second per MB of video.
(Why am I talking about servers? Because this thread has started with AWS 2U video racks, not Apple TV boxes.)
NVIDIA for example has specialized (en/de)-coding hardware on their GPUs, which is different. And even that works together with their GPGPU Cuda cores.
(1) if your decoder software runs too slow for real-time decoding. I think it historically has happened every once in a while until CPUs and decoder optimizations catch up again. Eg 4k H.265 was too much for many desktops for a while.
(2) you do a lot of it, in which low power decoding->saving electricity is still good
eg Linux web browsers for ages had sw-only decoding at it worked mostly fine, just laptops having battery eaten in browser apps & electron based apps (videoconferencing).
As codecs are historically a top source of remote code execution vulnerabilities that get our device pwned, the poor sandboxability of hw decoders makes them a security problem as well. eg as a pathway to exploit the flaky and high-privileged GPU driver code paths.
How Nvidia managed to emerge looking good on this PR is a colossal surprise & fucked up-ed-ly inappropriate.
If anything, I think AMD should drop amdvlk on Linux (to collaborate on radv there) and instead try to develop radv for Windows if that's doable to replace amdvlk altogether.
RADV even has big commercial customers now (Valve).
I see the amdvlk/radv drivers a bit like the windows "Radeon Pro"/"Adrenalin" driver split, one is for people who stare at solidworks all day, the other for everyone else.
amdvlk and radv exist for historic reasons since they started independently and amdvlk was designed to support Windows too. But today I don't really see a big point in admvlk except where radv doesn't exist.
So AMD can do what Intel does. Support radv on Linux and amdvlk on Windows for example, or as above, try to make radv work on Windows too.
Maybe I'm missing something, but from what I could dig up it sounds like Firefox only enables va-api on Intel. https://www.phoronix.com/news/Mozilla-Firefox-115
https://goughlui.com/2023/12/31/video-codec-round-up-2023-pa...
https://goughlui.com/2024/01/07/video-codec-round-up-2023-pa...