I'm looking for a way to change the subtitle style with a key. Editing mpv.conf every time I want to do so is hell, and that's rather frequently, as I've found that the style that works for animation looks really off putting when applied to the rest of films/series since bold cartoon-like edges contrast too much with real-life people.
These are the options that I'm interested on modifying upon a key press (from mpv.conf):
sub-text-border-size=
sub-text-font=
sub-text-shadow-offset=
I tried looking into making a .lua script, but I don't know anything about coding.
cycle-values <property> "<value1>" "<value2>"
The above caught my attention, but there's no property that refers to the parameters I want to change, so I'm stuck.
I think you are correct that these don't have properties associated with them. However, a workaround I use for any option that I want changed is a binding like this:
J cycle_values options/ass-force-style "style1" "style2"; write-watch-later-config; loadfile ${path}
It will set the option then reload the video at whatever time you were at.
That's fantastic!!! Wouldn't thought this had an answer. It works as intended, although I'm having trouble assigning more than one set of cycles per key. For example, I want Ctrl+1 to change both the font and border size, neither does
Ctrl+1 no-osd cycle_values options/sub-text-font "Arial Bold" "Arial"; options/sub-text-border-size "1" "2"; write-watch-later-config; loadfile ${path}
nor
Ctrl+1 no-osd cycle_values options/sub-text-font "Arial Bold" "Arial"; sub-text-border-size "1" "2"; write-watch-later-config; loadfile ${path}
nor these two together
Ctrl+1 no-osd cycle_values options/sub-text-font "Arial Bold" "Arial"; write-watch-later-config; loadfile ${path}
Ctrl+1 no-osd cycle_values options/sub-text-border-size "1" "2"; write-watch-later-config; loadfile ${path}
work.
you need the "cycle_values" command for each option:
Ctrl+1 no-osd cycle_values options/sub-text-font "Arial Bold" "Arial"; cycle_values options/sub-text-border-size "1" "2"; write-watch-later-config; loadfile ${path}
Reloading the file shouldn't be needed. Toggling fullscreen twice is probably enough to force it to rerender the subtitles.
@wm4 This isn't true for me at least (Win10)
I have to reload
Thank you so much, it's perfect now.
And indeed it works without the last two lines that make it reload the file (no need to toggle fullscreen, even), although I am running Windows 8 so it's possible that it varies from OS to OS.