https://github.com/harisekhon/mpv-scripts
Lua scripts to enhance the behaviour of the excellent open source MPV video player
https://github.com/harisekhon/mpv-scripts
lua lua-script lua-scripting mplayer mpv
Last synced: about 16 hours ago
JSON representation
Lua scripts to enhance the behaviour of the excellent open source MPV video player
- Host: GitHub
- URL: https://github.com/harisekhon/mpv-scripts
- Owner: HariSekhon
- License: mit
- Created: 2026-02-03T06:59:37.000Z (5 days ago)
- Default Branch: main
- Last Pushed: 2026-02-04T03:52:36.000Z (5 days ago)
- Last Synced: 2026-02-06T05:53:45.717Z (2 days ago)
- Topics: lua, lua-script, lua-scripting, mplayer, mpv
- Language: Shell
- Homepage:
- Size: 43.9 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hari Sekhon - MPV-Scripts
[](https://github.com/HariSekhon/MPV-Scripts/stargazers)
[](https://github.com/HariSekhon/MPV-Scripts/network)
[](https://github.com/boyter/scc/)
[](https://github.com/boyter/scc/)
[](https://github.com/HariSekhon/MPV-Scripts/blob/master/LICENSE)
[](https://www.linkedin.com/in/HariSekhon/)
[](https://github.com/HariSekhon/MPV-Scripts/commits/master)
[](https://app.codacy.com/gh/HariSekhon/MPV-Scripts/dashboard)
[](https://www.codefactor.io/repository/github/harisekhon/MPV-Scripts)
[](https://sonarcloud.io/dashboard?id=HariSekhon_MPV-Scripts)
[](https://sonarcloud.io/dashboard?id=HariSekhon_MPV-Scripts)
[](https://sonarcloud.io/dashboard?id=HariSekhon_MPV-Scripts)
[](https://sonarcloud.io/dashboard?id=HariSekhon_MPV-Scripts)
[](https://harisekhon.github.io/CI-CD/)
[](https://github.com/HariSekhon/DevOps-Bash-tools#hari-sekhon---devops-bash-tools)
[](https://github.com/HariSekhon/DevOps-Bash-tools#hari-sekhon---devops-bash-tools)
[](https://brew.sh/)
[](https://alpinelinux.org/)
[](https://www.centos.org/)
[](https://www.debian.org/)
[](https://getfedora.org/)
[](https://www.redhat.com/en)
[](https://rockylinux.org/)
[](https://ubuntu.com/)
[](https://github.com/HariSekhon/MPV-Scripts)
[](https://gitlab.com/HariSekhon/MPV-Scripts)
[](https://dev.azure.com/HariSekhon/GitHub/_git/MPV-Scripts)
[](https://bitbucket.org/HariSekhon/MPV-Scripts)
[](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/markdown.yaml)
[](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/validate.yaml)
[](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/kics.yaml)
[](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/grype.yaml)
[](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/semgrep.yaml)
[](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/semgrep-cloud.yaml)
[](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/sonarcloud.yaml)
[](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/trivy.yaml)
- [Summary](#summary)
- [MPV](#mpv)
- [MPV Config](#mpv-config)
- [MPV Scripts](#mpv-scripts)
## Summary
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
[:octocat: mpv-player/mpv](https://github.com/mpv-player/mpv)
## MPV Config
- `mpv.conf` - MPV settings such as saving position on quit
## MPV Scripts
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 variable `MPV_SPEED` is set
- `delete_on_eof.lua` - delete a video after completed playback if environment variable `MPV_DELETE_ON_EOF` is 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 [:octocat: DevOps-Bash-tools](https://github.com/HariSekhon/DevOps-Bash-tools) repo.
Related Docs:
[:octocat: HariSekhon/Knowledge-Base - Lua page](https://github.com/HariSekhon/Knowledge-Base/blob/main/lua.md)
[:octocat: HariSekhon/Knowledge-Base - MPV page](https://github.com/HariSekhon/Knowledge-Base/blob/main/mpv.md)
## More Core Repos
### Knowledge
[](https://github.com/HariSekhon/Knowledge-Base)
[](https://github.com/HariSekhon/Diagrams-as-Code)
### DevOps Code
[](https://github.com/HariSekhon/DevOps-Bash-tools)
[](https://github.com/HariSekhon/DevOps-Python-tools)
[](https://github.com/HariSekhon/DevOps-Perl-tools)
[](https://github.com/HariSekhon/DevOps-Golang-tools)
### Containerization
[](https://github.com/HariSekhon/Kubernetes-configs)
[](https://github.com/HariSekhon/Dockerfiles)
### CI/CD
[](https://github.com/HariSekhon/GitHub-Actions)
[](https://github.com/HariSekhon/Jenkins)
### Databases - DBA - SQL
[](https://github.com/HariSekhon/SQL-scripts)
### DevOps Reloaded
[](https://github.com/HariSekhon/HAProxy-configs)
[](https://github.com/HariSekhon/Terraform)
[](https://github.com/HariSekhon/Packer)
[](https://github.com/HariSekhon/Ansible)
[](https://github.com/HariSekhon/Environments)
### Monitoring
[](https://github.com/HariSekhon/Nagios-Plugins)
[](https://github.com/HariSekhon/Nagios-Plugin-Kafka)
[](https://github.com/HariSekhon/Prometheus)
### Templates
[](https://github.com/HariSekhon/Templates)
[](https://github.com/HariSekhon/Template-repo)
### Desktop
[](https://github.com/HariSekhon/TamperMonkey)
[](https://github.com/HariSekhon/Hammerspoon)
[](https://github.com/HariSekhon/MPV-Scripts)
### Spotify
[](https://github.com/HariSekhon/Spotify-tools)
[](https://github.com/HariSekhon/Spotify-playlists)
The rest of my original source repos are
[here](https://github.com/HariSekhon?tab=repositories&q=&type=source&language=&sort=stargazers).
Pre-built Docker images are available on my [DockerHub](https://hub.docker.com/u/harisekhon/)
and can be re-generated using the my [Dockerfiles](https://github.com/HariSekhon/Dockerfiles) repo.