How to Install mpv Media Player on Ubuntu 22.04 or 20.04

For a superior media experience on Ubuntu, the mpv media player is a compelling choice. This guide will detail how to install mpv on Ubuntu 22.04 Jammy Jellyfish or the older stable release of Ubuntu 20.04 Focal Fossa. Here’s why mpv deserves your consideration:

Key Features of mpv for Ubuntu Users

  • Minimalistic Interface: mpv offers a clean, user-friendly interface focusing on content.
  • Wide Format Support: The player supports various media formats and codecs, ensuring versatility.
  • Customizability: Tailor your user experience through scripts and configuration files.
  • High-Performance Video: Known for advanced video output capabilities, mpv ensures a smooth viewing experience.
  • Configuration Flexibility: Unlike other players where configuration is secondary, mpv makes it a core feature, allowing for fine-tuning to meet specific needs.

By following this guide, you’ll be well-equipped to install mpv on either Ubuntu 22.04 or 20.04. Whether you’re a seasoned media enthusiast or just seeking a reliable player, mpv is designed to meet and exceed your expectations.

Section 1: Install MPV Media Player on Ubuntu 22.04 or 20.04 via APT

In this section, we will delve into the MPV Media Player installation process on your Ubuntu system utilizing the APT (Advanced Packaging Tool). APT is renowned for its reliability and efficiency in handling package installations.

Step 1: Updating Ubuntu System Packages Before MPV Installation

Before embarking on the installation of MPV, it’s prudent to ensure that your system packages are up-to-date. Keeping the system updated minimizes the chances of running into compatibility issues or conflicts with existing libraries. Run the following command in the terminal to update the package lists and upgrade the system:

sudo apt update && sudo apt upgrade

Step 2: Install MPV via APT Command on Ubuntu 22.04 or 20.04

Utilizing APT for installing MPV is advantageous due to its simplicity and speed. However, one should be cognizant of the fact that the version available through APT might not be the latest. Critical security updates are typically swift, but feature updates might not be as prompt.

Execute the command below in your terminal to install MPV:

sudo apt install mpv

If you have a preference for using the newest version of MPV, you might want to consider an alternative installation method, which will be covered in Section 2.

Section 2: Install MPV via Flatpak and Flathub on Ubuntu 22.04 or 20.04

This section will discuss an alternative approach to installing the MPV Media Player on your Ubuntu system, utilizing Flatpak and Flathub. Flatpak is a universal package manager that allows you to run applications in an isolated environment. Flathub serves as the primary repository for distributing applications in Flatpak format. This section assumes that Flatpak is already installed on your system.

Step 1: Enable Flathub Repository for MPV on Ubuntu

Before installing MPV, it’s imperative to make sure that the Flathub repository is enabled on your system. This repository contains an extensive collection of applications packaged in the Flatpak format. Enabling Flathub is crucial for accessing and managing these packages.

To enable Flathub on your Ubuntu system, execute the following command in the terminal:

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

This command verifies if Flathub is in your system’s list of repositories and adds it if it’s not already present.

Step 2: Install MPV via Flatpak on Ubuntu

Now that the Flathub repository is enabled, we can move ahead with installing MPV. Flatpak commands facilitate installing, updating, and removing Flatpak packages.

Run the following command in the terminal to install MPV:

flatpak install flathub io.mpv.Mpv -y

The command tells Flatpak to fetch and install the MPV package from the Flathub repository. The -y flag automates the process by assuming ‘yes’ as the answer to installation prompts.

Opting for Flatpak as the package manager is commendable due to its distribution-agnostic nature. It’s particularly beneficial for those seeking a consistent application environment, irrespective of the underlying system.

Section 3: Initiating the MPV Media Player on Ubuntu 22.04 or 20.04

After successfully installing the MPV Media Player on your Ubuntu system, you’ll want to launch it to explore its functionalities. This section demonstrates different methods to initiate the MPV Media Player on your system.

Launching MPV Through the Command-Line Interface on Ubuntu

The command-line interface (CLI) is a text-based interface that enables you to interact with your system using commands. For those who prefer the precision and control offered by the CLI, launching MPV can be done directly from the terminal.

To launch MPV from the terminal, use the command:

mpv [options] [url|path/]filename

In the above command, replace [options] with any additional parameters you want to use, and [url|path/]filename with the file or stream you wish to play.

To view the extensive list of options that can be used with the MPV command, enter the following command:

mpv --list-options

This command displays all available options along with their descriptions, giving you greater customization possibilities for using the MPV Media Player.

example of mpv in terminal on ubuntu linuxPin
Example of how mpv Media Player looks when operated from the terminal on Ubuntu 22.04 or 20.04 Linux.

Initiating MPV for Flatpak Users on Ubuntu

For those who installed MPV using Flatpak, a different command is needed to launch the media player from the terminal:

flatpak run io.mpv.Mpv

This command specifically tells Flatpak to run the MPV Media Player.

Launching MPV From the Desktop Environment on Ubuntu

While the command line is a powerful tool, it’s not always the most convenient way to launch applications. Ubuntu also allows you to start the MPV Media Player directly from the desktop environment.

Navigate to the MPV Media Player by following this path:

Activities > Show Applications > MPV Media Player

Additionally, here’s where an example image of the MPV Media Player application icon on the Ubuntu desktop taskbar can be placed:

mpv Media Player application icon on Ubuntu 22.04 or 20.04 Linux desktopPin
The application icon for mpv Media Player as it appears on Ubuntu 22.04 or 20.04 Linux.

Section 4: Tips for Getting Started with MPV Media Player on Ubuntu Linux

Embarking on your experience with MPV Media Player on Ubuntu Linux can be exhilarating. This section aims to equip you with essential tips that can improve your initial interaction with this versatile media player. By understanding these tips, you’ll be able to utilize the MPV Media Player more efficiently and adapt it to your preferences.

Tip 1: Utilizing Keyboard Shortcuts

Keyboard shortcuts are indispensable for a streamlined experience. MPV has a plethora of keyboard shortcuts that allow for easy navigation and control. For instance, using the arrow keys, you can seek through a video. Pressing f toggles fullscreen, while m mutes the audio.

mpv --input-keylist

This command lists all the keyboard shortcuts that are available. Mastering these shortcuts can vastly improve your productivity and control while using MPV Media Player.

Tip 2: Customizing the Configuration File

You can tailor your MPV user experience by modifying the configuration file. The configuration file lets you set default options for the media player.

On Ubuntu Linux, the configuration file is located at:

~/.config/mpv/mpv.conf

You can edit this file with any text editor. For instance, to set the default volume at 50%, you can add the line volume=50 to the mpv.conf file.

Tip 3: Streaming Online Videos

MPV isn’t limited to playing local media files; you can also use it to stream online videos. To stream a video, you only need the video’s URL. For example, to stream a YouTube video, you can use the following command:

Replace URL with the actual video link.

Tip 4: Taking Screenshots

MPV allows you to take screenshots of the media you are playing. By pressing s, you can save a screenshot of the current frame. The screenshots are typically saved in your Pictures directory.

Tip 5: Adding Subtitles

If you’re watching a movie in a foreign language, you might need subtitles. You can load a subtitle file by pressing j. MPV supports various subtitle formats.

Tip 6: Adjusting Audio and Video Sync

Sometimes, the audio and video tracks might be out of sync. You can use the + and - keys to adjust the audio delay in real-time.

Screenshot of mpv Media Player loaded and ready to play media on Ubuntu 22.04 or 20.04 LinuxPin
Example of mpv Media Player fully loaded and operational on Ubuntu 22.04 or 20.04 Linux.

Section 5: Managing MPV Media Player on Ubuntu

When utilizing open-source software such as the MPV Media Player on Ubuntu, it’s crucial to ensure that your applications are current. This involves regular updates for optimized performance and robust security. This section will guide you through updating and uninstalling the MPV Media Player on Ubuntu based on your method of installation.

How to Update MPV Media Player on Ubuntu 22.04 or 20.04

Staying up-to-date with the latest versions is important. The steps to update the MPV Media Player differ based on whether you installed it using APT or Flatpak.

APT Update Command Method for MPV on Ubuntu

If you employed the APT package manager to install MPV, you can update it alongside other system packages. Use the terminal and enter the following commands:

sudo apt update
sudo apt upgrade

The first command updates the package list, and the second one upgrades all the outdated software, including MPV.

Flatpak Update Command Method for MPV on Ubuntu

In case you used Flatpak for installation, the update process is slightly different. Input the following command in the terminal:

flatpak update

This command specifically updates the MPV Media Player without affecting other applications.

How to Remove MPV Media Player on Ubuntu 22.04 or 20.04

There could be various reasons for wanting to uninstall MPV, such as preference for another media player or troubleshooting. Similar to updating, the uninstallation process also depends on the installation method.

APT Remove Command Method for MPV on Ubuntu

If MPV was installed via APT, use the following commands in the terminal for uninstallation:

sudo apt remove mpv

Flatpak Remove Command Method for MPV on Ubuntu

For those who have installed MPV through Flatpak, the command to uninstall it is:

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

This command will effectively remove MPV Media Player from your Ubuntu system.

Conclusion

In this tutorial, we walked through the steps to install the MPV Media Player on Ubuntu, ranging from version 20.04 to 22.04. We explored different installation methods, such as APT and Flatpak, which offer flexibility depending on your preferences or system requirements. Subsequently, we examined how to launch the MPV Media Player through the Command-Line Interface and the Desktop Environment. Additionally, we delved into essential tips for getting started, ensuring a seamless experience with the player. Finally, we discussed how to efficiently manage the MPV Media Player by keeping it updated and the uninstallation process when necessary.

As a final recommendation, I would emphasize the importance of regularly updating the MPV Media Player for optimal performance and security. The MPV Media Player is a powerful, versatile, robust, open-source tool. Following this guide will equip you with the knowledge to install, use, and manage it effectively on your Ubuntu system.

Share to...