Back to Blog
Install mpv on macOS, Windows, and Linux (And Slice Videos With mpv + FFmpeg)

Install mpv on macOS, Windows, and Linux (And Slice Videos With mpv + FFmpeg)


Most people use VLC. It's fine. It plays everything, it's free, and it's been around forever. But if you've ever wanted to do something slightly more interesting with video like clip a section without opening a whole editor VLC starts to feel clunky fast.

That's where mpv comes in. It's a video player, but calling it that undersells it. It's tiny, it's fast, and it's scriptable. You can extend it with Lua, hook it into FFmpeg, and build little workflows that would normally require a full editing app. I use it every day and I'm not going back.

This post walks through getting mpv installed, making it your default player so you can just double-click files like normal, and setting up a script that lets you slice clips out of a video with two keypresses.

Why bother switching from VLC?

VLC does a lot. mpv does less out of the box, but what it does, it does better.

Playback quality is noticeably cleaner. Hardware acceleration just works without fiddling with settings. And because mpv is built directly on top of FFmpeg rather than bundling its own codec stack, it plays nicely with the rest of your tools. If you already use FFmpeg for anything, mpv fits right into that world.

The real selling point, though, is scripting. mpv supports Lua scripts natively, which means you can add features yourself. Want to auto-skip intros? There's a script for that. Want to slice clips on the fly? That's what we're setting up here. VLC has a plugin system too, but it's nowhere near as clean.

The interface is also stripped down on purpose. No menus, no sidebar, no playlist panel taking up half the screen. Just the video and your keyboard. Everything is configurable through text files, which sounds annoying until you realize how much faster it is than clicking through preferences dialogs.

Installing mpv

macOS

If you have Homebrew:

brew install mpv

That's it.

Windows

The easiest route is through Scoop. If you don't have Scoop yet:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm get.scoop.sh | iex
scoop install mpv

Linux

On Debian or Ubuntu:

sudo apt update && sudo apt install mpv

On Arch:

sudo pacman -S mpv

Making mpv your default player

One thing that trips people up is thinking mpv is a terminal-only tool. It's not. You can absolutely just double-click a video file to open it in mpv you just need to set it as your default player first.

On macOS, right-click any video file, hit Get Info, change the Open with dropdown to mpv, and click Change All. Done.

On Windows, right-click a video, go to Open with → Choose another app, pick mpv, and check Always use this app.

On Linux, right-click, open Properties, and set mpv as the default for that file type.

After that, it works like any other player. Double-click to open, close when you're done. The difference is that any scripts you've installed will quietly be running in the background, ready when you need them.

Slicing clips with mpv_slicing.lua

This is the part that made me fall in love with mpv. There's a Lua script called mpv_slicing.lua by Kagami that turns mpv into a quick clipping tool. You're watching a video, you hit a key to mark where you want the clip to start, hit it again to mark the end, and the script calls FFmpeg to export that segment. The whole thing takes about a second.

A quick heads-up: the original script exports uncompressed RGB video, which is great for editing but produces huge files. There are a bunch of forks that change the default behavior snylonue/mpv_slicing_copy uses stream copy so you get fast, lossless output in the original container, and there are others that re-encode to h264 or tweak the track mapping. Just pick whichever one fits your workflow. The awesome-mpv list is a good place to browse what's out there not just for slicing scripts, but for mpv scripts and tools in general.

The version I use does stream copy (-c copy), so there's no re-encoding happening. The output is the same quality as the source and it's nearly instant. You don't have to wait for a render.

What you need first

FFmpeg has to be installed and on your PATH. You can check with:

ffmpeg -version

If that prints a version number, you're good.

Setting up the script

Grab the script from the repo and drop it into mpv's scripts directory.

On macOS and Linux:

mkdir -p ~/.config/mpv/scripts
curl -L -o ~/.config/mpv/scripts/mpv_slicing.lua \
  https://raw.githubusercontent.com/Kagami/mpv_slicing/master/mpv_slicing.lua

On Windows, download the file and place it in:

C:\Users\<your-user>\AppData\Roaming\mpv\scripts\

Using it

Open a video in mpv, then press c to mark the start of your clip. Press c again to mark the end. That's it the clip gets saved to the same folder as the original file, with a name like video_00-01-10.00-00-01-15.00.mp4.

A couple of other bindings: a toggles audio on or off for the export, and Shift+C cancels the current selection if you marked the wrong spot.

This replaces a lot of busywork

Think about what you'd normally do to grab a clip from a video. Open Premiere or DaVinci or whatever you use. Import the file. Scrub to the right spot. Set your in and out points. Pick your export settings. Wait for the render. Close the project.

Or: play the video in mpv, press c twice, and the clip is already sitting in your folder.

For anything more complex color grading, multi-track editing, effects you obviously still need real editing software. But for quick clips, mpv with this script is hard to beat. It's one of those workflows that feels almost too simple once you've set it up.

And slicing is really just the beginning. Once you start poking around awesome-mpv, you'll find scripts for everything auto-cropping, quality presets, playback history, thumbnail previews, you name it. That's the nice thing about mpv being scriptable: if someone's had the same itch, there's probably already a script for it.