MPV media player has reached version 0.39.0. Here’s how to install it for those sticking to the classic .deb
package format.
MPV does not provide official packages for Ubuntu Linux. It’s however easy to install the latest version via different sources.
Linux Mint 21/22 can directly search for and install MPV Flatpak package from software manager. And, Ubuntu can install the Snap package from Ubuntu Software. Though, both of them run in sandbox.
For those sticking to the classic .deb
package, I’ve upload MPV 0.39.0 into this unofficial PPA. It supports Ubuntu 22.04, Ubuntu 24.04, and Ubuntu 23.10, Ubuntu 20.04 on both x86_64 and arm64/armhf CPU architecture types.
Install MPV 0.39.0 via Ubuntu PPA
NOTE: Ubuntu 22.04 has FFmpeg 4.4.2, but mpv now requires at least v6.1. So, the PPA package for 22.04 now has FFmpeg (7.0) built in bundle. Please leave comment below if there’s any issue due to this change.
1. Add the PPA
Firstly, press Ctrl+Alt+T on keyboard to open a terminal window. When it opens, paste the command below and hit run:
sudo add-apt-repository ppa:ubuntuhandbook1/mpv
Type user password (no asterisk feedback) when it asks and hit Enter to continue.
2. Update package cache
Since Ubuntu 20.04, it automatically updates the package cache while adding PPA. Though, Linux Mint user needs to do it manually.
To do so, run command in terminal:
sudo apt update
3. Install MPV 0.39.0
Finally, install mpv media player v0.38.0 by running command:
sudo apt install mpv
To verify, run mpv --version
command in terminal.
Known Issues
Drag and drop files into mpv app window does not work, due to Wayland. Though, you may right-click on media file to open with mpv.
For hardware video acceleration, first make sure your graphics driver support it, then edit ‘/etc/mpv/mpv.conf
‘ file and add hwdec=auto. And, enable classic header bar via gpu-context=x11egl
.
Uninstall:
You can choose to purge the PPA repository, which will also downgrade mpv to the stock version in system repository. To do so, open terminal and run command:
sudo apt install ppa-purge && sudo ppa-purge ppa:ubuntuhandbook1/mpv
Or, remove PPA by running command:
sudo add-apt-repository --remove ppa:ubuntuhandbook1/mpv
To remove the mpv media player, use command:
sudo apt remove --autoremove mpv
The mpv packages in your repo have been built without libmujs.
So only LUA plugins work.
JS plugins fail with message:
“Cannot find main.* for any supported scripting backend”
Thanks for your feedback. I’ll try to rebuild the package to add mujs support.
Thank you for the quick turnaround!
JS plugins are working as expected with the new mpv build.
Could you consider adding “avif” support?
I suspect it would be enough to consider into account the remarks given at https://github.com/mpv-player/mpv/issues/12881
The AVIF support seems to reply on FFmpeg.
The PPA package is built with FFmpeg from system repository. “AVIF” is supported in Ubuntu 23.10 in my case, but NOT for 22.04 due to different FFmpeg library.
UPDATE: I’ve rebuild MPV 0.37.0 for Ubuntu 22.04 with FFmpeg 6.0 in bundle. It’s moved to this unstable PPA:
https://launchpad.net/~ubuntuhandbook1/+archive/ubuntu/mpv-unstable/
It seems working for me. Wait for your feedback.
Amazing job. Thanks a lot.
I have just checked:
– opening avif images
– taking screenshots using avif format
and both are working great.
The webp support for screenshots has been lost in this version. It is fine to open webp images, but now it is not working “mpv –screenshot-format=webp …”.
Personally I am going to replace webp with avif in my configuration, so your version is OK for my aim. I just say so to let you know (in case you care).
was missing
--enable-libwebp
in the bundled FFmpeg build.The test PPA package you just tried is built with FFmpeg 6.0 (in bundle). Due to outdated dependency libraries in 22.04 repositories, many features may be disabled.
The stable PPA introduced in this tutorial is built with FFmpeg from system repository, but it’s old and lack the feature that you required.
Now, I don’t know which one should be kept in PPA …
may i suggest for stable PPA you retain dependency on older version of the libs in the system repo?
this will keep things simple.
folks who want features based on the latest libs can use your test PPA.
you can probably add a note in the article to indidcate this.
This is your choice.
What I have done is keeping your two “mpv” binary files for ubuntu 22.04 in my /usr/bin/folder . I obviously use different names (while one is “mpv” the other is renamed “mpv-withavifbut”). Depending what I want to do I choose the right one.
Perhaps you could consider including both binaries inside your deb package and inform about this in the documentation (mainly the drawbacks in the version with avif support). Nevertheless, I expect (but I have no idea) that the missing avif support will be solved in the LTS release Ubuntu 24,04
Thank you for this. I have an older MPV installed, apparently from another PPA, here (Des:1 http://ppa.launchpad.net/mc3man/mpv-tests/ubuntu focal/main amd64 mpv amd64 2:0.33.0~focal1 [10,6 MB]), how can I upgrade or install from yours? I tried removing MPV and installing but it didn’t work, it installed again from the older PPA. Thank you for any help.
Try to remove that PPA if you don’t need it anymore, because it has mpv package with higher priority (2:0.33.0~focal1 > 0.39.0):
If you want to keep that PPA but install newer version of MPV, then try using Synaptic package manager (available in Ubuntu Software) to search and highlight ‘mpv’ package and press Ctrl+E to force install desired package version.
BTW: MPV package for Ubuntu 20.04 in the PPA is stuck at version 0.36, because newer versions require libplacebo >= 6.338 that 20.04 (focal) does not meet. If you do need the most recent MPV in 20.04, then try this PPA instead. It however includes tons of dependency library updates, that’s easy to run into dependency hell for beginners.
I think 0.36 would do, I mainly just need the –secondary-sub-pos functionality.
As for removing the PPA, I did, but then when I try to install from the new PPA, it seems to get into errors:
j@j-Inspiron-17-7779:~$ sudo apt install mpv
Leyendo lista de paquetes… Hecho
Creando árbol de dependencias
Leyendo la información de estado… Hecho
No se pudieron instalar algunos paquetes. Esto puede significar que
usted pidió una situación imposible o, si está usando la distribución
inestable, que algunos paquetes necesarios aún no se han creado o se
han sacado de «Incoming».
La siguiente información puede ayudar a resolver la situación:
Los siguientes paquetes tienen dependencias incumplidas:
mpv : Depende: libavcodec60 (>= 7:6.1)
Depende: libavdevice60 (>= 7:6.0) pero no va a instalarse
Depende: libavfilter9 (>= 7:6.0)
Depende: libavformat60 (>= 7:6.0)
Depende: libplacebo338 (>= 6.338.2) pero no es instalable
Depende: libwayland-client0 (>= 1.20.0) pero 1.18.0-1ubuntu0.1 va a ser instalado
Depende: libwayland-cursor0 (>= 1.20.0) pero 1.18.0-1ubuntu0.1 va a ser instalado
Depende: libwayland-egl1 (>= 1.20.0) pero 1.18.0-1ubuntu0.1 va a ser instalado
E: No se pudieron corregir los problemas, usted ha retenido paquetes rotos.
Getting the old PPA back and reinstalling, it does reinstall it correctly, though, only 0.33.
Any ideas?
Either way, thank you for the help so far.
Seems that you also have other PPAs that include other version of MPV package, which has lower priority than
2:0.33.0~focal1
, but higher than the one introduced in this tutorial.Launch “Software & Updates” and navigate to “Updates” tab to list 3rd party PPAs and remove the one that has dependency issue. Or, try the command below to install mpv with version specified.
Thank you. I did try to install a debian .deb provided by debian so that may be the cause of the problem which caused the foray into “dependecy hell” haha. But the code you provided was what I needed, it worked out of the box.
I guess –secondary-sub-pos was still not an option in 0.36 since when trying to use it, it says:
Error parsing option secondary-sub-pos (option not found)
Setting commandline option –secondary-sub-pos=95 failed.
Exiting… (Fatal error)
So, well, I guess that’s about it haha. Thank you very much anyways!