Complete guide to using mpv on Linux: advanced playback and customization

Introduction

mpv is an open-source media player that has earned a reputation for its lightweight performance, broad codec support, and focus on playback via the command line. Unlike players with heavy graphical interfaces, mpv focuses on delivering a minimal yet highly configurable experience, ideal for Linux users who prefer to control their environment from the terminal. In this article we will explore how to install mpv on the most popular distributions, its basic playback options, and how to customize it to suit your daily needs.

Installation

Installing mpv is straightforward thanks to its presence in the official repositories of most Linux distributions. On Ubuntu and its derivatives, simply run sudo apt update followed by sudo apt install mpv. On Fedora use sudo dnf install mpv, while on Arch Linux the command is sudo pacman -S mpv. For those who prefer the latest version, it is possible to compile from the source code available on GitHub, which allows enabling specific compile-time options such as Vulkan support or integration with libplacebo. After installation, checking the version with mpv –version ensures everything is ready to go.

Basic Usage

Once installed, playing a file is as simple as typing mpv path/to/file.mkv in the terminal. mpv automatically detects the file type and selects the best available decoder. Options can be passed directly on the command line, for example –fs for fullscreen, –scale=ewa_lanczossharp for high-quality scaling, or –vo=gpu to use the GPU backend. Moreover, mpv supports playback of DVDs, Blu‑rays, and network streams such as YouTube via helper scripts like youtube-dl or ytdl-patch. The lower status bar shows useful information such as elapsed time, bitrate, and FPS, while the Space bar toggles between pause and playback.

Shortcuts and Input Configuration

mpv comes with a set of intuitive keyboard shortcuts that allow controlling playback without leaving the keyboard. The left and right arrow keys rewind or advance 5 seconds, while Shift+left/right arrow jumps one minute. The 9 and 0 keys decrease and increase volume, and m mutes audio. To switch audio or subtitle tracks, # and * are used respectively. Fullscreen mode is toggled with f, and the options menu can be shown or hidden with i. These shortcuts can be redefined by editing the input.conf file, providing an additional layer of customization to adapt the player to specific workflows.

Video Filters and Scaling

Image quality is one of mpv’s strengths thanks to its wide range of video filters and scaling algorithms. The –vf parameter allows chaining filters such as scaling, cropping, color correction, and blurring. For example, –vf=scale=1920:1080:filter=lanczos,eq=brightness=0.1:saturation=1.2 adjusts the resolution, applies a Lanczos filter, and modifies brightness and saturation. Users seeking the latest in processing can enable the GPU backend with –vo=gpu and combine it with shaders like deband or upscale-spline36 to reduce banding artifacts and improve detail. Furthermore, the frame interpolation mode (–interpolation) can produce a smoother experience in low-frame-rate content, while the tone‑mapping mode (–tone-mapping) helps preserve dynamic range in HDR content.

Audio Options

In the audio realm, mpv does not lag behind. The player supports a wide variety of codecs, from AAC and MP3 to lossless formats like FLAC and DSD. Volume can be adjusted with the 9 and 0 keys, but there is also a 10‑band equalizer accessible via the –af=equalizer=… filter. For example, –af=equalizer=11:5:0:0:0:0:0:0:0:0 boosts the bass. Audio channels can be reordered or downmixed using options such as –audio-channels=stereo or –audio-channels=5.1. For those using advanced audio setups, mpv allows passthrough output of formats like Dolby TrueHD and DTS‑HD via –audio-spdif=dts-hd, sending the signal undecoded to a compatible receiver. Additionally, predefined equalizer files can be loaded via the mpv.conf file or via Lua scripts that dynamically adjust the equalizer according to the music genre.

Playlists, Streams, and Network

mpv also stands out for its ability to handle playlists and network streams without complications. A simple playlist can be created in a text file with one path per line and passed with –playlist=playlist.txt. To play content from services like YouTube, Vimeo, or Twitch, simply install an extraction script such as youtube-dl and then use the URL directly: mpv https://www.youtube.com/watch?v=ID. The player will recognize the script call, download the best available format, and then start playback. Moreover, mpv supports protocols such as HTTP, HLS, DASH, and RTSP, making it a viable option for watching live streams or security cameras. The –ytd