Anime4KMetal icon indicating copy to clipboard operation
Anime4KMetal copied to clipboard

Use in MPV

Open hvmzx opened this issue 1 year ago • 8 comments

Hello, is it possible to use these shaders in MPV instead of the glsl ones ? I am having performance issues on MPV on Apple Silicon because it simply uses OpenGL and isn't optimised at all for it.

hvmzx avatar Mar 20 '23 08:03 hvmzx

Did you test this version and verified it's actually faster than OpenGL version?

I doubt if MPV supports any metal shaders. But in any case this is out of scope of this project. I suggest that you create a feature request in MPV.

imxieyi avatar Mar 20 '23 10:03 imxieyi

Yes I understand that isn't what the project is for, just wondering if it was ever done. Nice work !

hvmzx avatar Mar 20 '23 11:03 hvmzx

I am having performance issues on MPV on Apple Silicon

Which version of Apple Silicon are you using: M1, M2, Pro, Max, or Ultra? Are you running the native mpv build or the Intel version? Additionally, are you using shaders optimized for higher or lower-end GPUs? I personally found that the standard M1 and M2 versions hit their limit, so I stuck with the lower-end GPU, which has been working great for me.

Tama47 avatar Mar 21 '23 00:03 Tama47

I am having performance issues on MPV on Apple Silicon

Which version of Apple Silicon are you using: M1, M2, Pro, Max, or Ultra? Are you running the native mpv build or the Intel version? Additionally, are you using shaders optimized for higher or lower-end GPUs? I personally found that the standard M1 and M2 versions hit their limit, so I stuck with the lower-end GPU, which has been working great for me.

Using a M2 Pro right now, going with the low end cpu shaders worked so I'm sticking with that

hvmzx avatar Mar 23 '23 04:03 hvmzx

I did not have an M2 Pro chip to test with when I was writing the instructions for Mac, but I assume it also had performance issue with the higher-end GPUs? I will go back to review and update the instructions. Based on my experience with the normal M2 chip, I could only use the Medium shaders. If you have an M2 Pro, you might be able to try using the Large (L) shaders instead. So it's possible that they could work on an M2 Pro as the shader optimized for higher-end GPUs starts with the Very Large (VL) shaders.

Tama47 avatar Mar 23 '23 05:03 Tama47

I did not have an M2 Pro chip to test with when I was writing the instructions for Mac, but I assume it also had performance issue with the higher-end GPUs? I will go back to review and update the instructions. Based on my experience with the normal M2 chip, I could only use the Medium shaders. If you have an M2 Pro, you might be able to try using the Large (L) shaders instead. So it's possible that they could work on an M2 Pro as the shader optimized for higher-end GPUs starts with the Very Large (VL) shaders.

I will try the Large ones then, VL didn't work. Also, i haven't tried the metal shaders, just the basic anime4k ones.

Did you observe a difference of performance between metal and non metal ?

hvmzx avatar Mar 26 '23 00:03 hvmzx

I will try the Large ones then, VL didn't work. Also, i haven't tried the metal shaders, just the basic anime4k ones.

Give it a try! Apparently, the author of this project, Anime4KMetal, was able to get VL metal shaders working on their M1 Ultra.

Did you observe a difference of performance between metal and non metal ?

My results varied slightly, you can take a look here, if you’re interested.

Tama47 avatar Mar 26 '23 00:03 Tama47

I have added support for chaining multiple shaders as well as all presets as defined in official Anime4K instructions. Feel free to check out this repo or download pre-built binaries from v0.0.2 release. Screenshots can be found in README.md.

From my testing all presets (Fast, HQ) work well on my 48-core M1 Ultra without dropping frames. The results from presets are way better than using individual shaders. Note that no preset is using shaders larger than VL size.

imxieyi avatar Mar 26 '23 09:03 imxieyi