Closed Yuki-Soul closed 2 years ago
You can use auto-profiles script and conditionally apply settings in mpv.conf
. Here is reduced profile that I use. It's even possible to apply different settings for files depending on their path. In my example all files with "Anime" in path got their own xxx-anime
profiles:
[uhd]
profile-desc=cond:(get('video-params/w', 0)>=3840 or get('video-params/h', 0)>=2160)
glsl-shaders="..." #uhd shaders
[fhd]
profile-desc=cond:(((get('video-params/w', 0)>=1920 or get('video-params/h', 0)>=1080) and get('video-params/w', 0)<3840 and get('video-params/h', 0)<2160) and get('path', ''):find('Anime') == nil)
glsl-shaders="..." #non-anime fullhd shaders
[fhd-anime]
profile-desc=cond:(((get('video-params/w', 0)>=1920 or get('video-params/h', 0)>=1080) and get('video-params/w', 0)<3840 and get('video-params/h', 0)<2160) and get('path', ''):find('Anime') ~= nil)
glsl-shaders="..." #anime fullhd shaders
[hd]
profile-desc=cond:(((get('video-params/w', 0)>=1280 or get('video-params/h', 0)>=720) and get('video-params/w', 0)<1920 and get('video-params/h', 0)<1080) and get('path', ''):find('Anime') == nil)
glsl-shaders="..." #non-anime hd shaders
[hd-anime]
profile-desc=cond:(((get('video-params/w', 0)>=1280 or get('video-params/h', 0)>=720) and get('video-params/w', 0)<1920 and get('video-params/h', 0)<1080) and get('path', ''):find('Anime') ~= nil)
glsl-shaders="..." #anime hd shaders
[sd]
profile-desc=cond:((get('video-params/w', 0)~=0 and get('video-params/h', 0)~=0 and get('video-params/w', 0)<1280 and get('video-params/h', 0)<720) and get('path', ''):find('Anime') == nil)
glsl-shaders="..." #non-anime sd shaders
[sd-anime]
profile-desc=cond:((get('video-params/w', 0)~=0 and get('video-params/h', 0)~=0 and get('video-params/w', 0)<1280 and get('video-params/h', 0)<720) and get('path', ''):find('Anime') ~= nil)
glsl-shaders="..." #anime sd shaders
In my example I use original video width (video-params/w
) and height (video-params/h
). For display width/height you can use display-width
and display-height
properties. Full list of properties is here: https://mpv.io/manual/master/#property-list
You are using the deprecated (by upstream) script, mpv has its implement https://mpv.io/manual/master/#conditional-auto-profiles
Hi, I made a mpv Lua script to enable Anime4K depending on video resolution, check it out!
Hi, I made a mpv Lua script to enable Anime4K depending on video resolution, check it out!
https://github.com/mhtvsSFrpHdE/AnimeAnyK-mpv Looks Great, I will try it.
Is there anyway to change shader based on screen resolution?