Skip to content

This is a collection of my own mpv scripts.

License

Notifications You must be signed in to change notification settings

detuur/mpv-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mpv-scripts

This is a collection of my own mpv scripts. Valuable contributions have been made by:

  • @zaza42: Linux implementation of boss-key.lua
  • @microraptor: Bug fixes, streamlining, and features to skiptosilence.lua and histogram.lua
  • @vikas5914: macOS implementation of boss-key.lua

boss-key.lua (updated 2023-06-28)

Instantly pauses and minimises the screen at the push of a button (by default b). Called like that because you'd want to hide whatever you're watching when your boss (or mom) walks in.

Supports Windows, macOS, and Linux (X11 only, see requirements).

The default keybind is b. You can change this by adding the following line to your input.conf:

KEY script-binding boss-key

Requirements:

  • Linux users: xdotool. Wayland is currently unsupported. PRs welcome!

skiptosilence.lua (updated 2022-02-27)

This script skips to the next silence in the file. The intended use for this is to skip until the end of an opening or ending sequence, at which point there's often a short period of silence.

The default keybind is F3. You can change this by adding the following line to your input.conf:

KEY script-binding skip-to-silence

In order to tweak the script parameters, you can place the text below in a new file at script-opts/skiptosilence.conf in mpv's user folder. The parameters will be automatically loaded on start.

# Maximum amount of noise to trigger, in terms of dB.
# The default is -30 (yes, negative). -60 is very sensitive,
# -10 is more tolerant to noise.
quietness = -30

# Minimum duration of silence to trigger.
duration = 0.1

# The fast-forwarded audio can sound jarring. Set to 'yes'
# to mute it while skipping.
mutewhileskipping = no

histogram.lua (updated 2022-02-27)

This script exposes a configurable way to overlay ffmpeg histograms in mpv.
There is a substantial amount of config available, but this script does not support config files, because of the nested options. Please edit the options in the opts array in the script itself.

There are three default keybinds:

  • h: Toggle the histogram on/off
  • H (Shift+h): Cycle between the pixel formats available
  • Alt+h: Toggle between linear and logarithmic levels

These keybinds can be changed by placing the following lines in your input.conf:

KEY script-binding toggle-histogram
KEY script-binding cycle-histogram-pixel-format
KEY script-binding cycle-histogram-levels-mode

A note on hardware decoding

The histogram filter is not compatible with hardware decoding. As a result, the default behaviour is to automatically disable any hardware decoding while the filter is on. This behaviour can be changed in the aforementioned opts array.

Waveform version

A version of this script adapted by @MikelSotomonte for displaying waveforms instead can be found at his repo.

Shamelessly stolen example from ffmpeg's wiki

About

This is a collection of my own mpv scripts.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages