Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Fix the FFmpeg error "libavdevice.so.54"

This guide helps you fix the message "ffmpeg: error while loading shared libraries: libavdevice.so.54".

Dedicated Servers2 min read6 steps

What does this error mean?

A shared library is a file of ready-made code that many programs borrow. FFmpeg needs one called libavdevice. The number 54 is its version. The error says FFmpeg wants version 54, but the server cannot find it.

This usually happens when FFmpeg was built for one version of its libraries, and a different version is installed now. It can also happen when the libraries sit in a folder the system does not search.

You need root access for this guide. Root is the main administrator login of the server.

Steps

  1. Connect to your server with SSH.
  2. See which libraries FFmpeg is missing.
    ldd $(which ffmpeg) | grep "not found"
    This lists each library that cannot be found.
  3. Look for the file on the disk.
    find / -name "libavdevice*" 2>/dev/null
    This searches the server for files with that name.
  4. If you find the file in a folder such as /usr/local/lib, tell the system to look there. Open the file /etc/ld.so.conf and check it has a line like include ld.so.conf.d/*.conf. Then create a small file.
    echo "/usr/local/lib" > /etc/ld.so.conf.d/ffmpeg.conf
    This adds the folder to the search list.
  5. Refresh the library list.
    ldconfig
    This rebuilds the list of known libraries.
  6. Test FFmpeg again.
    ffmpeg -version

If the file is not found at all

The library is missing or has a different version. The cleanest fix is to reinstall FFmpeg with its libraries, so they match.

dnf reinstall ffmpeg ffmpeg-libs

On older systems use yum. On Ubuntu or Debian, use apt install --reinstall ffmpeg.

Warning: Do not make a fake link from a newer file to the name "libavdevice.so.54". It can crash FFmpeg. Matching versions are safer. Take a backup before you change system files.

Quick recap

  • The error means FFmpeg cannot find the library file it wants.
  • Use ldd to see what is missing.
  • Add the library folder to the search list and run ldconfig.
  • If still missing, reinstall FFmpeg so all parts match.