User Scripts

JulianLai edited this page Jan 12, 2017 · 131 revisions

User Scripts

Here is a list of scripts that users of mpv have published, adding functionality that is not part of the core mpv player. Most of these scripts are unofficial 3rd party scripts. Anyone can add their own script by editing this wiki.

Lua Scripts

  • autocrop
    Automatically crop the video by using lavfi's cropdetect filter to detect black bars.

  • autospeed
    To adjust monitor refresh rate and video speed for almost 1:1 playback. (*nix)

  • autospeedwin
    To adjust monitor refresh rate and video speed for almost 1:1 playback. (Windows)

  • autodeint
    Automatically deinterlace the video by using lavfi's idet filter to detect interlaced content.

  • auto-keep-gui-open
    Intelligently switches mpv's "keep-open" behavior based on whether you are running in video-mode or audio-only mode.

  • autoload
    Automatically load playlist entries before and after the currently playing file, by scanning the directory.

  • auto-profiles
    Automatically apply profiles based on predicates written as Lua expressions.

  • autosub
    Automatically download subtitles using subliminal.

  • betterchapters
    Loads the next or previous playlist entry if there are no more chapters in the seek direction.

  • convert_script
    Script to quickly convert and crop videos from within mpv, with a GUI.

  • cycle-deinterlace-pullup
    Cycle between deinterlacing, pullup (IVTC), and both filters off.

  • cycle_messages
    Cycle between custom OSD messages.

  • cycle-video-rotate
    Allows you to perform video rotation which perfectly cycles through all 360 degrees without any glitches.

  • drc-control
    Cycle through DRC (dynamic range compression) modes during runtime.

  • dessubdb
    Download automatically subtitles from the using DESSubdb.

  • delogo
    It removes the logo of the channels in a video (press n)

  • deframe
    It removes the frame of youtube videos (press g)

  • easycrop
    Manually crop a video during playback.

  • equalizer
    5-bands equalizer with colorful display.

  • excerpt
    Allows you to quickly create excerpts from media files, you just have to set begin and end markers.

  • Filenavigator
    Navigate directories and open files from your system.

  • find_subtitles
    (Down)load subtitles with subliminal.

  • fpsadjust
    Automatically adjust playback speed to synchronize the video to the display if possible (eg. by adjusting 23.976 Hz to 24 Hz for better compatibility with a 60 Hz display). Obsolete: mpv now has a native display-sync option.

  • scrobbler
    Sends the information about playing tracks to, see for more info.

  • lua-mpris
    Adds mpris support to mpv.

  • minesweeper
    Minesweeper game.

  • mpv-Change-OSD-Media-Title
    Displays filename, percentage watched, current chapter, and number of frames dropped in the OSD media title and updates it whenever one of the values has changed.

  • mpv_frame_info
    Show frame info, similar to ffdshow's OSD.

  • mpv_slicing
    Cut uncompressed fragments of the video.

  • mpvmenu
    Adds a pop-up menu to mpv, which can be bound to a key or button

  • multi-command-if
    Very powerful conditional logic and multiple action engine for your keybindings, without having to write a single line of code!

  • myshows
    Marks currently watched episode on MyShows website.

  • nextfile
    Force opens next or previous file in the currently playing files folder.

  • notify
    Adds desktop notifications to the mpv media player, which show metadata like artist, album name and track name when the track changes.

  • ontop-playback
    Disables the ontop property when pausing, and enables it again when unpausing the video, if it was disabled.

  • ontop-playback
    Disables the ontop property when pausing, and enables it again when unpausing the video, if it was disabled. Change it only when the player is not in fullscreen to prevent screen flickering.

  • open-file-dialog
    (Windows) Launches a regular Windows file open dialog for loading videos.

  • pause-when-minimize
    Pauses the player video when minimizing, and unpauses it when brought up again.

  • peerflix-hook
    Allows streaming of magnet links using peerflix, similar to youtube-dl.

  • pitchcontrol
    Adjusts audio pitch in half-tone steps.

  • Playlistmanager
    Helps with creating playlists, saving them and modifying your current playlist.

  • progressbar
    A minimalistic OSC replacement. It provides a small, unintrusive progress bar that persists at the bottom of the video window.

  • quick-scale
    Quickly scale the video player to a target size, with full control over target scale and max scale. Helps you effortlessly resize a video to fit on your desktop, or any other video dimensions you need!

  • reload
    This script provides automatic reloading of videos that doesn't have buffering progress for some time while keeping the current time position. It also adds a keybinding to reload video manually.

  • repl
    A REPL for input commands that is displayed on the video window.

  • seek-to
    Seek to an absolute timestamp specified via keyboard input.

  • skipchapters
    Automatically skip chapters matching a given list of regular expressions (eg. "OP" or "Opening").

  • skiptofade
    Seeks forward until a black screen appears. Built to skip openings. Uses the lavfi blackdetect filter.

  • stats
    Display some statistics about the currently played file on-screen.

  • streamcache
    Provides for more network-glitch-robust caching of live streams by adjusting replay speed.

  • unseen-playlistmaker
    Keeps track of watched files locally, and creates playlists of unwatched files.

  • vo_battery
    (OS X) Choose the VO based on if the laptop is on battery or not.

  • vo_battery
    (Linux) Choose the VO based on if the laptop is on battery or not.

  • waifu2x
    Take screenshots and convert images with waifu2x.

  • xrandr
    Automatically sets the display refresh rate to the one best suitable for the video played

  • zones
    Handles commands depending on where the mouse pointer is at, mostly for mouse wheel handling.

  • addfile
    (OS X) Add subtitle or audio track to playing video file

  • simple-loader
    (Linux) Browse dirs and files on OSD, and launch them with mpv.

If you want to write your own Lua scripts, have a look at the documentation of mpv's Lua interface.

Pixel Shaders

  • LumaSharpenHook
    A sharpen filter similar to using Unsharp Mask in Photoshop ported from SweetFX shader pack.

  • FineSharp
    FineSharp by Didée converted from mpc-hc shaders. Tuned to work with opengl-hq. More info

  • Adaptive Sharpen
    A two-pass sharpen filter to sharpen medium sharp edges the most. Ported from a HLSL shader. Tuned to work with opengl-hq.

  • One-Pass Adaptive Sharpen
    One-pass version of adaptive sharpen shader. Has built-in anti-ringing filter.

  • KrigBilateral
    Chroma scaler that uses luma information for high quality upscaling.

  • SSimSuperRes
    The aim of this shader is to make corrections to the upscaled image. Works with regular scalers only, not prescalers.

  • Noise
    Adds a tunable amount of grayscale noise to the output.

  • Antiringing
    This is basically the equivalent (with some caveats) of mpv's built-in antiringing shader.

  • SuperXBR and Nnedi3
    User shaders for prescaling. These shaders should cover most functionality that prescale-luma= used to provide.

VapourSynth Scripts

  • mvtools
    Use MVTools's BlockFPS function to perform motion interpolation on the video in realtime.

  • nnedi3
    Use NNEDI3 to double the resolution of the video. This always performs a single doubling. Note that the vapoursynth-nnedi3 filter is so slow that this practically can't be used in realtime, so it's not much use in practice.

  • flash3kyuu
    Use flash3kyuu to deband the video, with reasonable (mildly grainy) default settings. Obsolete: mpv now ships with a similar debanding filter as shader.