Lua code to control the behaviour of the excellent open source mpv video player.
See the scripts/ directory for the Lua code to control MPV.
mpv.conf- MPV settings such as saving position on quit
Under the scripts/ directory:
resume-conditions.lua- only resume videos that:- are at least 10 minutes long
- have been playing for at least 5 minutes
- have a certain file extension
- are under a specific directory tree
speed.lua- sets playback speed if environment variableMPV_SPEEDis setdelete_on_eof.lua- delete a video after completed playback if environment variableMPV_DELETE_ON_EOFis set to any value- for those videos you downloaded to only watch once
- this automatic cleanup helps to save space and reduces you needing to manually delete the video
The environment variables above are useful when used with direnv for specific video directories (eg. I always watch all YouTube videos at double speed and delete them after one complete play).
Migrated from
DevOps-Bash-tools repo.
Related Docs:
HariSekhon/Knowledge-Base - Lua page
HariSekhon/Knowledge-Base - MPV page
The rest of my original source repos are here.
Pre-built Docker images are available on my DockerHub and can be re-generated using the my Dockerfiles repo.