There is any way with MPV to activate and deactivate the shader with one button?
I have another MPV player without shaders, but it is annoying to switch player all the times.
I mainly use 2 shaders, Anime4K and Ravu.
I'm doing a lua script for that, but without result. I don't understand how to detect the function for the shader.
function shader_toggle(shader_status)
if shader_status == "shader-ON" then
mp.set_property_number("glsl-shaders", 1)
else
mp.set_property_number("glsl-shaders", 0)
end
mp.osd_message("Shader: " .. shader_status)
end
mp.add_key_binding(nil, "Shared_Toggle", shader_toggle)
With this on the input.conf
Alt+UP script-message Shared_Toggle "shader-ON"
Alt+DOWN script-message Shared_Toggle "shader-OFF"
I want this feature for 2 reasons:
I'm using lines like this in input.conf:
CTRL+2 change-list glsl-shaders toggle "~/.mpv/shaders/ravu-r3-rgb.hook"
This allows to switch a shader on and off.
As for your script, you can use the property glsl-shaders to check which shaders are active.
Thank you Argon! I didn't know it was possible with a single line in the input.conf, my script is totally useless now XD
Most helpful comment
I'm using lines like this in input.conf:
This allows to switch a shader on and off.
As for your script, you can use the property
glsl-shadersto check which shaders are active.