An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# Hari Sekhon - MPV-Scripts

[![GitHub stars](https://img.shields.io/github/stars/HariSekhon/MPV-Scripts?logo=github)](https://github.com/HariSekhon/MPV-Scripts/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/HariSekhon/MPV-Scripts?logo=github)](https://github.com/HariSekhon/MPV-Scripts/network)
[![LineCount](https://sloc.xyz/github/HariSekhon/MPV-Scripts/?badge-bg-color=2081C2)](https://github.com/boyter/scc/)
[![Cocomo](https://sloc.xyz/github/HariSekhon/MPV-Scripts/?badge-bg-color=2081C2&category=cocomo)](https://github.com/boyter/scc/)
[![License](https://img.shields.io/badge/license-MIT-green)](https://github.com/HariSekhon/MPV-Scripts/blob/master/LICENSE)
[![My LinkedIn](https://img.shields.io/badge/LinkedIn%20Profile-HariSekhon-blue?logo=data:image/svg%2bxml;base64,PHN2ZyByb2xlPSJpbWciIGZpbGw9IiNmZmZmZmYiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+TGlua2VkSW48L3RpdGxlPjxwYXRoIGQ9Ik0yMC40NDcgMjAuNDUyaC0zLjU1NHYtNS41NjljMC0xLjMyOC0uMDI3LTMuMDM3LTEuODUyLTMuMDM3LTEuODUzIDAtMi4xMzYgMS40NDUtMi4xMzYgMi45Mzl2NS42NjdIOS4zNTFWOWgzLjQxNHYxLjU2MWguMDQ2Yy40NzctLjkgMS42MzctMS44NSAzLjM3LTEuODUgMy42MDEgMCA0LjI2NyAyLjM3IDQuMjY3IDUuNDU1djYuMjg2ek01LjMzNyA3LjQzM2MtMS4xNDQgMC0yLjA2My0uOTI2LTIuMDYzLTIuMDY1IDAtMS4xMzguOTItMi4wNjMgMi4wNjMtMi4wNjMgMS4xNCAwIDIuMDY0LjkyNSAyLjA2NCAyLjA2MyAwIDEuMTM5LS45MjUgMi4wNjUtMi4wNjQgMi4wNjV6bTEuNzgyIDEzLjAxOUgzLjU1NVY5aDMuNTY0djExLjQ1MnpNMjIuMjI1IDBIMS43NzFDLjc5MiAwIDAgLjc3NCAwIDEuNzI5djIwLjU0MkMwIDIzLjIyNy43OTIgMjQgMS43NzEgMjRoMjAuNDUxQzIzLjIgMjQgMjQgMjMuMjI3IDI0IDIyLjI3MVYxLjcyOUMyNCAuNzc0IDIzLjIgMCAyMi4yMjIgMGguMDAzeiIvPjwvc3ZnPgo=)](https://www.linkedin.com/in/HariSekhon/)
[![GitHub Last Commit](https://img.shields.io/github/last-commit/HariSekhon/MPV-Scripts?logo=github)](https://github.com/HariSekhon/MPV-Scripts/commits/master)

[![Codacy](https://app.codacy.com/project/badge/Grade/2301baad8cde440ea1c27889a936bf28)](https://app.codacy.com/gh/HariSekhon/MPV-Scripts/dashboard)
[![CodeFactor](https://www.codefactor.io/repository/github/harisekhon/MPV-Scripts/badge)](https://www.codefactor.io/repository/github/harisekhon/MPV-Scripts)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=HariSekhon_MPV-Scripts&metric=alert_status)](https://sonarcloud.io/dashboard?id=HariSekhon_MPV-Scripts)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=HariSekhon_MPV-Scripts&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=HariSekhon_MPV-Scripts)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=HariSekhon_MPV-Scripts&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=HariSekhon_MPV-Scripts)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=HariSekhon_MPV-Scripts&metric=security_rating)](https://sonarcloud.io/dashboard?id=HariSekhon_MPV-Scripts)

[![CI Builds Overview](https://img.shields.io/badge/CI%20Builds-Overview%20Page-blue?logo=circleci)](https://harisekhon.github.io/CI-CD/)
[![Linux](https://img.shields.io/badge/OS-Linux-blue?logo=linux)](https://github.com/HariSekhon/DevOps-Bash-tools#hari-sekhon---devops-bash-tools)
[![Mac](https://img.shields.io/badge/OS-Mac-blue?logo=apple)](https://github.com/HariSekhon/DevOps-Bash-tools#hari-sekhon---devops-bash-tools)

[![Mac Homebrew](https://img.shields.io/badge/Mac-Homebrew-999999?logo=apple&logoColor=white)](https://brew.sh/)
[![Alpine](https://img.shields.io/badge/Linux-Alpine-0D597F?logo=alpine%20linux)](https://alpinelinux.org/)
[![CentOS](https://img.shields.io/badge/Linux-CentOS-262577?logo=centos&logoColor=white)](https://www.centos.org/)
[![Debian](https://img.shields.io/badge/Linux-Debian-A81D33?logo=debian)](https://www.debian.org/)
[![Fedora](https://img.shields.io/badge/Linux-Fedora-294172?logo=fedora&logoColor=white)](https://getfedora.org/)
[![Redhat](https://img.shields.io/badge/Linux-Redhat-EE0000?logo=red%20hat)](https://www.redhat.com/en)
[![Rocky](https://img.shields.io/badge/Linux-Rocky-10B981?logo=rockylinux&logoColor=white)](https://rockylinux.org/)
[![Ubuntu](https://img.shields.io/badge/Linux-Ubuntu-E95420?logo=ubuntu&logoColor=white)](https://ubuntu.com/)

[![Repo on GitHub](https://img.shields.io/badge/repo-GitHub-2088FF?logo=github)](https://github.com/HariSekhon/MPV-Scripts)
[![Repo on GitLab](https://img.shields.io/badge/repo-GitLab-FCA121?logo=gitlab)](https://gitlab.com/HariSekhon/MPV-Scripts)
[![Repo on Azure DevOps](https://img.shields.io/badge/repo-Azure%20DevOps-0078D7?logo=azure%20devops)](https://dev.azure.com/HariSekhon/GitHub/_git/MPV-Scripts)
[![Repo on BitBucket](https://img.shields.io/badge/repo-BitBucket-0052CC?logo=bitbucket)](https://bitbucket.org/HariSekhon/MPV-Scripts)

[![Markdown](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/markdown.yaml/badge.svg)](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/markdown.yaml)
[![Validation](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/validate.yaml/badge.svg)](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/validate.yaml)
[![Kics](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/kics.yaml/badge.svg)](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/kics.yaml)
[![Grype](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/grype.yaml/badge.svg)](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/grype.yaml)
[![Semgrep](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/semgrep.yaml/badge.svg)](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/semgrep.yaml)
[![Semgrep Cloud](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/semgrep-cloud.yaml/badge.svg)](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/semgrep-cloud.yaml)
[![SonarCloud](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/sonarcloud.yaml/badge.svg)](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/sonarcloud.yaml)
[![Trivy](https://github.com/HariSekhon/MPV-Scripts/actions/workflows/trivy.yaml/badge.svg)](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

[![Knowledge-Base](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Knowledge-Base&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Knowledge-Base)
[![Diagrams-as-Code](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Diagrams-as-Code&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Diagrams-as-Code)

### DevOps Code

[![DevOps-Bash-tools](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=DevOps-Bash-tools&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/DevOps-Bash-tools)
[![DevOps-Python-tools](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=DevOps-Python-tools&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/DevOps-Python-tools)
[![DevOps-Perl-tools](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=DevOps-Perl-tools&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/DevOps-Perl-tools)
[![DevOps-Golang-tools](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=DevOps-Golang-tools&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/DevOps-Golang-tools)

### Containerization

[![Kubernetes-configs](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Kubernetes-configs&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Kubernetes-configs)
[![Dockerfiles](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Dockerfiles&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Dockerfiles)

### CI/CD

[![GitHub-Actions](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=GitHub-Actions&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/GitHub-Actions)
[![Jenkins](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Jenkins&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Jenkins)

### Databases - DBA - SQL

[![SQL-scripts](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=SQL-scripts&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/SQL-scripts)

### DevOps Reloaded

[![HAProxy-configs](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=HAProxy-configs&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/HAProxy-configs)
[![Terraform](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Terraform&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Terraform)
[![Packer](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Packer&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Packer)
[![Ansible](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Ansible&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Ansible)
[![Environments](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Environments&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Environments)

### Monitoring

[![Nagios-Plugins](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Nagios-Plugins&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Nagios-Plugins)
[![Nagios-Plugin-Kafka](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Nagios-Plugin-Kafka&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Nagios-Plugin-Kafka)
[![Prometheus](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Prometheus&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Prometheus)

### Templates

[![Templates](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Templates&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Templates)
[![Template-repo](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Template-repo&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Template-repo)

### Desktop

[![TamperMonkey](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=TamperMonkey&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/TamperMonkey)
[![Hammerspoon](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Hammerspoon&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Hammerspoon)
[![MPV-Scripts](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=MPV-Scripts&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/MPV-Scripts)

### Spotify

[![Spotify-tools](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Spotify-tools&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Spotify-tools)
[![Spotify-playlists](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Spotify-playlists&theme=ambient_gradient&description_lines_count=3)](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.