po5 / thumbfast

High-performance on-the-fly thumbnailer script for mpv
Mozilla Public License 2.0
758 stars 34 forks source link

Ancient mpv support #98

Open po5 opened 1 year ago

po5 commented 1 year ago

An attempt at making thumbfast work on really old mpv versions.
Backported vanilla OSC as well. not everything is implemented as a nice fallback, some newer features are just stripped out for the time being.
I am currently using 0.14 in a Linux VM.

What works: initializing the script, thumbnail placeholders, launching slave process without errors
What's broken: generating thumbnail files (they only get written when the slave process is exited), osc: title bar, osc: warnings for some keybinds

Features to emulate or guard, with what version they become available:
ytdl: 0.7
input-ipc-server: 0.17
mp.get_osd_size: 0.17
(for osc) nil key in mp.add_key_binding: 0.17
timer:is_enabled: 0.18
mp.register_idle: 0.21
utils.subprocess_detached: 0.21
async command flag: 0.25
(for osc) expand-text: 0.25
(for osc) shortened mouse button names: 0.27
(for osc) mp.msg.trace: 0.28
utils.file_info: 0.28
load-stats-overlay: 0.28
utils.getpid: 0.29
load-osd-console: 0.31, oops! did 41c74d0 break 0.29 compat?
load-auto-profiles: 0.33, oops! did 41c74d0 break 0.29 compat?
scale and pad vf without explicit lavfi: ????

Looking at this list, 0.28 support is trivial, 0.27 may introduce issues with our own file_info but should be fine+annoying keybind name changes needed in osc.lua, then 0.21 should be trivial, anything older requires us to find a solution for handling a detached mpv process ourselves

po5 commented 1 year ago

Random isn't being seeded properly for unique.