-
Notifications
You must be signed in to change notification settings - Fork 2.9k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vulkan Video Decoding: Usage Guide and FAQ #11739
Comments
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: |
Reliably crashes driver for me with this sample: https://0x0.st/HbHJ.mkv |
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. |
@aufkrawall AMD currently needs https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23227 to avoid crashes, which also fixes quite a lot of bugs |
what does this error mean, my device has amd and i used the following config |
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. |
Yeah, I've reported to nvidia months ago that their descriptor buffer implementation is broken, but they haven't fixed it yet. |
Github claims you attached an audio-only file... |
That file is also broken on anv, it's glitchy and the decode is very slow while utilizing 100% of Render/3D engine. |
It's an HEVC file. My experience on ANV is that any HEVC playback pegs the GPU at 100% |
Also:
This is a highly questionable sample. |
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
|
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/ |
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 |
I enabled them. Check the vulkaninfo log, it shows the extension but mpv does not recognizes it. This is what I used to compile it
|
@lavilao i assume you're using Shinchiro's windows build? I haven't tried using mpv through wine, you may need to recompile. |
what does this error mean, my device has intel gpu, and i used the following config |
Intel on Windows does not support Vulkan hwdec, read the OP |
Might be mistaken, but this appears to have allowed zero copy hwacceleration on my polaris on radv. seems like preformance is a bit better too |
I recompiled on a arch distrobox and the good news is it detects it. The bad news are that the logs show a driver bug:
|
Ah, hasvk (old Intel GPUs) has a PR to implement video decoding that hasn't been merged yet: |
@cyanreg thats the version I am using |
i use i3-10110u's gpu. so I still use d3d11va now. it works well. |
I usually use Happy to use gpu-next but thought I should note this bug. But also curious if this will work with dmabuf-wayland in the future? |
Someone make this into a Wiki entry so I can stop get notifications. Clearly not shithub issue material. |
Believe me, I've thought about it. If it was a wiki page, it would still need an issue to be able to pin to the issues page. If locked, it would lead to people filing new issues. You can unsubscribe from this one more easily than unsubscribing from newly filed ones. |
I believe you, which is really sad. These web-based git front-ends have nothing new to offer nowadays in terms of usability, every shithub new "feature" for the past 4yrs or so is nothing more than a detriment for browser performance and with questionable interface changes... but I digress. Will unsubscribe from this issue and everyone can carry on. |
It's a bug, and I've pushed a fix. Thanks for reporting. |
Did you set |
yes I have, on both Fedora and Windows. But before and after setting it, hwdec enabled or not with vulkan or vaapi, i get this console line:
But only HW: vaapi appears with hwdec=api, with hwdec=vulkan it does not, although frame timings are the same. |
I just tried with 550.40.07 and it worked fine, including passing validation with |
With the latest Nvidia 550 build on Windows, I am able to play video using Vulkan on the latest main branch mpv build (with a custom ffmpeg build). |
The basic filters you want for the input.conf |
A couple of months ago these didn't work but they all work for me now on Windows 10 with: Nvidia driver 551.23. Latest MPV build from 2 days ago but with older ffmpeg libraries. |
Can someone with contact to AMD let them know about this crash. This file, if this matters https://archive.org/download/BBC_Top_of_the_Pops_1979_11_01/BBC_Top_of_the_Pops_1979_11_01.mkv Happens on 24.1.1 driver.
|
Thanks for reporting it, will look into it. I remember seeing this stream before, it should have been fixed... |
FYI, mesa mainlined |
Since
Then
back to THANKS NVIDIA |
AV1 decode on nvidia doesn't work because the ffmpeg code is written against the pre-standardised MESA extension, but presumably if we adjust it to use the official KHR one, it should work. |
Have you enabled it? Currently it not enabled in mpv until final version is merged upstream and considered safe to enable. diff --git a/video/out/vulkan/context.c b/video/out/vulkan/context.c
index 3def7bd213..9f74adbd29 100644
--- a/video/out/vulkan/context.c
+++ b/video/out/vulkan/context.c
@@ -208,6 +208,9 @@ bool ra_vk_ctx_init(struct ra_ctx *ctx, struct mpvk_ctx *vk,
VK_KHR_VIDEO_QUEUE_EXTENSION_NAME,
// This is a literal string as it's not in the official headers yet.
"VK_MESA_video_decode_av1",
+#ifdef VK_KHR_VIDEO_DECODE_AV1_EXTENSION_NAME
+ VK_KHR_VIDEO_DECODE_AV1_EXTENSION_NAME,
+#endif
};
VkPhysicalDeviceDescriptorBufferFeaturesEXT descriptor_buffer_feature = { |
It also doesn't work on radv's implementation of the protocol because there were changes that it hasn't updated for yet. Just wait for it to be merged |
#11739 (comment) << same happens with 550.40.53 (aka the current vulkan beta driver) maybe the resulting coredump info helps a little -> https://paste.rs/4S1iz |
FYI- VK_EXT_descriptor_buffer support has been merged into mesa (git/mainline) for Intel/anv, and vulkan filters appear to be working now. |
I tried to use vulkan video on my Manjaro linux system. Manjaro is stable repo and everything should be working. Everything is set as in the FAQ / Guide. [ffmpeg/video] hevc: Device does not support decoding hevc! I still get an image of course, but i assume that with this error decoding is done by the cpu. |
Manjaro doesn't build their Mesa with patented codecs, hence why you're missing H264 and HEVC codecs. You can check which codecs are supported for your hardware with |
AV1 decoding now works with the following branch on both RADV and Nvidia: https://github.com/cyanreg/FFmpeg/tree/av1dec |
For me personally, the whole vulkan situation has been quite painful - not sure if this is nvidia related (I have a cheap, crappy nvidia card) or not. High quality information is in general highly appreciated, because right now, even after reading the initial intro on top of this thread, I still don't really know how to solve the problems I have. I can no longer play anything right now via mpv, e. g. getting errors such as
This is all quite painful because I know it all works in theory (default manjaro proprietary |
Hi ! Could you tell me how to build mpv with your ffmpeg repo ? |
I tried changing the repo url ... but I missed the "GIT_TAG av1dec" + "GIT_REMOTE_NAME origin" then it failed at ffmpeg prefix. |
@cyanreg ffmpeg repo does not work for me |
Try https://github.com/cyanreg/FFmpeg/tree/av1dec2 |
getting same old |
AV1 should work on NVIDIA now with git master of ffmpeg. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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 decodingThe text was updated successfully, but these errors were encountered: