How to Install mpv Media Player on Linux Mint 21 LTS


MPV is a highly versatile media player that supports various video and audio codecs. It has comprehensive playback, audio, and video control options, as well as support for different input URL types for reading input from a variety of sources other than disk files. MPV is available on Microsoft Windows, macOS, Linux, and BSD operating systems and is often used to play YouTube videos or be a client for streaming services such as Twitch.tv. Thanks to its wide range of features and compatibility with many different operating systems, MPV has become one of the most popular media players available today.

In the following tutorial, you will learn how to install mpv Media Player on Linux Mint 21 LTS using three different methods using the command line terminal.

Update Linux Mint

First, update your system to ensure all existing packages are up to date to avoid conflicts.

sudo apt update && sudo apt upgrade -y

Install mpv Media Player – APT Default Method

The first installation option is to use the APT manager, the easiest and quickest method, but it often falls behind in updates unless it is an urgent security matter.

Run the following command to install the software.

sudo apt install mpv libmpv1 -y

Install mpv Media Player – APT PPA Method

The second and probably best method to utilize the APT package manager is to install the PPA by Rob Savoury.

Use the following command to install or check if the packages are installed before importing the PPA.

sudo apt install dirmngr ca-certificates software-properties-common gnupg gnupg2 apt-transport-https -y

Next, import the GPG key needed for all the repositories.

If you have issues importing the GPG key, please see the end section on GPG troubleshooting at the end of the article.

sudo gpg --no-default-keyring --keyring /usr/share/keyrings/rob-savoury.gpg --keyserver keyserver.ubuntu.com --recv-keys E996735927E427A733BB653E374C7797FB006459

Next, import the MPV repository, and the two recommended FFMPEG repositories to accompany it.

Before importing these PPAs, backup if you have a critical system; they will make many changes/upgrades. For the most part, it should be fine, but as always, backups play a crucial role when installing any packages.

echo 'deb [signed-by=/usr/share/keyrings/rob-savoury.gpg] https://ppa.launchpadcontent.net/savoury1/mpv/ubuntu jammy main' | sudo tee -a /etc/apt/sources.list.d/mpv-rob-savoury.list
echo 'deb [signed-by=/usr/share/keyrings/rob-savoury.gpg] https://ppa.launchpadcontent.net/savoury1/ffmpeg4/ubuntu jammy main' | sudo tee -a /etc/apt/sources.list.d/ffmpeg-4-rob-savoury.list
echo 'deb [signed-by=/usr/share/keyrings/rob-savoury.gpg] https://ppa.launchpadcontent.net/savoury1/ffmpeg5/ubuntu jammy main' | sudo tee -a /etc/apt/sources.list.d/ffmpeg-5-rob-savoury.list

Next, run an APT update to reflect the new additions.

sudo apt-get update

Before you continue, run an APT upgrade as many dependencies will need to be upgraded, it is best to do this before the installation.

sudo apt upgrade

Now install mpv.

sudo apt install mpv libmpv1 -y

Install mpv Media Player – Flatpak Method

The third option is to use the Flatpak package manager. Flatpak is installed natively on Linux Mint, so the installation should be straightforward.

See also
How to Install Waterfox Browser on Linux Mint 21 or 20

First, re-install the Flatpak manager if it was removed previously.

sudo apt install flatpak -y

For users re-installing Flatpak, it is often recommended to reboot your system. Failure to do this can occur with odd issues, such as paths not being generated for icons.

sudo reboot

SKIP THE REBOOT IF FLATPAK IS INSTALLED.

Next, you need to enable Flatpack using the following command in your terminal.

sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Now install the software using the following flatpak command.

flatpak install flathub io.mpv.Mpv -y

How to Launch mpv Media Player

Launching can be done in a few ways now that you have the software installed.

First, in your terminal, you can use the media player using the cli commands; the basic function is the following command.

mpv [options] [url|path/]filename

For more information, use the following command.

mpv --list-options

Alternatively, Flatpak users will need to launch using the command below from a terminal instance.

flatpak run io.mpv.Mpv

However, this is not practical, and you would use the following path on your desktop.

Taskbar > Sound & Audio > mpv Media Player.

Example:

You can open or drag/copy URLs such as Youtube directly into the mpv Media Player window for desktop users.

Example:

How to Install mpv Media Player on Linux Mint 21 LTSPin

Once done, your selection can play.

Example:

For more information, visit the mpv manual.

How to Update/Upgrade mpv Media Player

Depending on the method of installation used, the following commands can be used to update.

APT Update Method

sudo apt upgrade && sudo apt upgrade

Flatpak Update Method

flatpak update

How to Remove (Uninstall) mpv Media Player

Use one of the following commands to suit the original installation method for users who no longer require the application.

APT Remove Method

sudo apt autoremove mpv libmpv1 -y

For users that installed the other repositories from Rob Savory, I would suggest keeping them as he constantly maintains them. If you are using any other installations from his PPAs.

Flatpak Remove Method

flatpak uninstall --delete-data io.mpv.Mpv

Next, run the following command for any leftover clean-up.

flatpak remove --unused

How to Fix Broken GPG Import

Users that have installed Linux Mint for the first time or have not imported a GPG key before using the command line terminal will often have issues importing GPG keys from LaunchPAD PPAs due to the directories not being created. This is an easy fix. Use the following command that will, in turn, generate the directories.

sudo gpg --list-keys

Example output:

As above, the necessary directories have been created. This can be skipped, and use the following GPG import command below. If you have any issues with directories missing for this and any other PPA GPG key in the future, just run the above command.

See also
How to Install ExifTool on Linux Mint 21 or 20

Comments and Conclusion

MPV is an open-source and cross-platform media player with many features. It has extensive support for various video and audio formats and subtitle types. Additionally, it supports different input URL methods to give users multiple options for watching videos or listening to music. Depending on the platform, MPV may have other output methods for video and audio. Overall, MPV is a powerful media player worth trying out for anyone looking for an alternative to commercial players.

Leave a Comment

Share to...