Vulkan Video Decoding: Usage Guide and FAQ #13909
Replies: 232 comments 29 replies
-
AMD on Windows appears to be 5000/6000 series according to https://www.amd.com/en/support/kb/release-notes/rn-rad-win-22-11-2-vlk-video-code-decode (possibly 7000 works?). It doesn't work on Polaris: |
Beta Was this translation helpful? Give feedback.
-
After bc28dce, you need to patch your Mesa with this PR to get AV1 decoding on radv. |
Beta Was this translation helpful? Give feedback.
-
Reliably crashes driver for me with this sample: https://0x0.st/HbHJ.mkv |
Beta Was this translation helpful? Give feedback.
-
Sounds like you probably need to file a mesa issue for that - and even if it was an mpv issue, please open a separate one. This FAQ isn't the place to report it. |
Beta Was this translation helpful? Give feedback.
-
@aufkrawall AMD currently needs https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23227 to avoid crashes, which also fixes quite a lot of bugs |
Beta Was this translation helpful? Give feedback.
-
what does this error mean, my device has amd and i used the following config |
Beta Was this translation helpful? Give feedback.
-
I don't know if that specific driver is required, they may have been included in 23.2.1 where they added other extensions, the driver notes aren't clear. 7000 series wasn't launched when the 22-11-2 Vulkan video drivers were released so that driver doesn't officially support them. If they did include the video extensions in newer drivers then they may support 7000 series but someone with those GPUs will need to test. |
Beta Was this translation helpful? Give feedback.
-
Yeah, I've reported to nvidia months ago that their descriptor buffer implementation is broken, but they haven't fixed it yet. |
Beta Was this translation helpful? Give feedback.
-
Github claims you attached an audio-only file... |
Beta Was this translation helpful? Give feedback.
-
That file is also broken on anv, it's glitchy and the decode is very slow while utilizing 100% of Render/3D engine. |
Beta Was this translation helpful? Give feedback.
-
It's an HEVC file. My experience on ANV is that any HEVC playback pegs the GPU at 100% |
Beta Was this translation helpful? Give feedback.
-
Also:
This is a highly questionable sample. |
Beta Was this translation helpful? Give feedback.
-
Will this work with hasvk in the future? I tried using it through wine (I dont want to have to compile everything) and got this error
|
Beta Was this translation helpful? Give feedback.
-
NVIDIA 1650 Super, Tested on windows with: mpv --vo=gpu-next --gpu-api=vulkan --hwdec=vulkan --gpu-context=winvk This video has problem: https://4kmedia.org/sony-whale-in-tonga-hdr-uhd-4k-demo/ |
Beta Was this translation helpful? Give feedback.
-
for fedora, you need to edit mesa.spec and rebuild with codecs enabled https://themaister.net/blog/2023/01/05/vulkan-video-shenanigans-ffmpeg-radv-integration-experiments/ https://forum.endeavouros.com/t/compiling-mesa-22-2-with-codec-support-the-easy-way/30390 |
Beta Was this translation helpful? Give feedback.
-
Hi ! Could you tell me how to build mpv with your ffmpeg repo ? |
Beta Was this translation helpful? Give feedback.
-
I tried changing the repo url ... but I missed the "GIT_TAG av1dec" + "GIT_REMOTE_NAME origin" then it failed at ffmpeg prefix. |
Beta Was this translation helpful? Give feedback.
-
@cyanreg ffmpeg repo does not work for me |
Beta Was this translation helpful? Give feedback.
-
Try https://github.com/cyanreg/FFmpeg/tree/av1dec2 |
Beta Was this translation helpful? Give feedback.
-
getting same old |
Beta Was this translation helpful? Give feedback.
-
AV1 should work on NVIDIA now with git master of ffmpeg. |
Beta Was this translation helpful? Give feedback.
-
The patch worked for me. |
Beta Was this translation helpful? Give feedback.
-
vulkan renderer working good (except green screen with mpv N-115189-g0664cbd73 (May 13) libplacebo version: v7.349.0 (v6.338.0-130-gbf1855c-dirty) Good job! |
Beta Was this translation helpful? Give feedback.
-
but |
Beta Was this translation helpful? Give feedback.
-
@cyanreg the attached file fails to display properly on nvidia gpus, with Tested configurations:
out.mp4 |
Beta Was this translation helpful? Give feedback.
-
This is great! But why do I need to set special flags for this to work? |
Beta Was this translation helpful? Give feedback.
-
Is it just me or does this results in a vsync error where video is delayed by a few frames from the audio (the audio comes first and then the video)? |
Beta Was this translation helpful? Give feedback.
-
radv now enabled Vulkan video by default for RDNA 3 (you need latest firmware). |
Beta Was this translation helpful? Give feedback.
-
Vulkan video decoding not working with RDNA2. I am using latest Mesa 24.3-devel:
And I can see the Vulkan video extensions:
However,
According to
|
Beta Was this translation helpful? Give feedback.
-
Vulkan Video Decoding: Usage Guide and FAQ
On the 28th of May, we reached the significant milestone of finally merging all the required functionality into ffmpeg, libplacebo, and mpv to do end-to-end Vulkan video decoding and presentation. Although the functionality is now all there, we still have a complex landscape in terms of what is supported on what hardware and with what drivers. This document attempts to lay out all the requirements and limitations, so you have a chance of successfully using the feature.
Why should I even care about Vulkan video decoding?
It's a fair question. Right now, the actual functionality you gain access to is not terribly different from what you would get with existing video decoding APIs that ffmpeg and mpv already support. However, Vulkan video decoding has the potential to be a credible cross-vendor, cross-platform API that is well supported, and can work efficiently with Vulkan based filtering and post-processing. In the short term, there will be rough edges, and only a narrow set of supported codecs (only H.264 and H.265 are standardised today, with AV1 still a work in progress), but in the future, it will hopefully be the most performant and capable way to do hardware decoding and processing.
Software Requirements
We have finally reached the point where all the required components have made official releases. Ensure you are running with the following releases or newer:
These requirements mean you will likely have to compile everything for yourself (especially on Linux), but Shinchiro's windows builds appear to be functional.
Hardware and Driver Requirements
Usage
The basic command line arguments:
Depending on your system configuration, you may additionally need to force the right
gpu-context
:--gpu-context=winvk
--gpu-context=x11vk
--gpu-context=waylandvk
Capabilities
ANV_VIDEO_DECODE=1
in your environment to expose video decodingRADV_PERFTEST=video_decode
in your environment to expose video decodingBeta Was this translation helpful? Give feedback.
All reactions