Software⏱️ 3 min read📅 2026-06-15

How to Fix: mpv: error while loading shared libraries: libavcodec.so.59: cannot open shared object file: No such file or directory

mpv error while loading shared libraries: libavcodec.so.59: cannot open shared object file: No such file or directory

Quick Answer: Try updating mpv to the latest version, which may include a fix for the libavcodec issue.

The error 'mpv: error while loading shared libraries: libavcodec.so.59: cannot open shared object file: No such file or directory' affects users of mpv media player on Linux systems. This issue typically arises after a system update or upgrade, which may have changed the version of ffmpeg used by mpv.

This problem is particularly frustrating for users who rely on mpv for their video playback needs, as it prevents them from accessing their media files. In this troubleshooting guide, we will explore the root causes of this error and provide step-by-step solutions to resolve the issue.

🔍 Why This Happens

  • The primary reason for this error is that mpv is using an older version of libavcodec (libavcodec.so.59) which is no longer compatible with the newer version used by ffmpeg (libavcodec.so.60). This incompatibility can be resolved by updating mpv to a version that supports the new libavcodec version.
  • An alternative reason for this error could be that the system's package manager has not updated mpv to include the latest libavcodec version, or that there are issues with the system's package management system.

🛠️ Step-by-Step Verified Fixes

Update mpv to a compatible version

  1. Step 1: Open a terminal and update all packages: sudo pacman -Syu
  2. Step 2: Install the latest ffmpeg package: sudo pacman -S ffmpeg
  3. Step 3: Verify that the libavcodec.so.60 file exists in the system's library directory: ls /usr/lib/libavcodec.so.60

Use a different version of mpv

  1. Step 1: Download and install an older version of mpv that is compatible with libavcodec.so.59: wget https://mpv.io/downloads/latest/mpv-0.34.1.tar.gz && tar xvfz mvp-0.34.1.tar.gz -C ~/
  2. Step 2: Change the ownership of the downloaded mpv executable to the current user: chown -R $USER:$USER ~/mvp

✨ Wrapping Up

To resolve the 'mpv: error while loading shared libraries' issue, it is recommended to update mpv to a version that supports libavcodec.so.60. If this is not possible, using a different version of mpv that is compatible with libavcodec.so.59 can be an alternative solution.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions