- Advertisement -
HomeSystemsffmpeg: error while loading shared libraries: libavdevice.so.58 

ffmpeg: error while loading shared libraries: libavdevice.so.58 

TL;DR

Export the required library, run:

export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64/:/usr/local/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH

ffmpeg: error while loading shared libraries: libavdevice.so.58

The Background.

Last year, I had a lot of fun testing the new Intel Flex Series GPUs (formerly codenamed Arctic Sound-M).  In particular, I was playing around with the Flex Series 140, for Media Delivery and Transcoding solutions, using FFmpeg. The environment: Ubuntu 20.04. 

It is important to mention, that I am using some kind of special version from Intel, however, I found this error common in FFmpeg.

The Problem.

After installing FFmpeg and running it, (ffmpeg or ffmpeg -version), you receive the following error message:

- Advertisement -

"ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory”

ffmpeg error while loading shared libraries libavdevice.so.58

The cause of this issue is that FFmpeg is unable to load a required shared library file, libavdevice.so.58. And that Ubuntu has not configured the environment variables through the source code installation software; as a result, the startup path cannot be found.

Here are some options you can take to resolve this error on Ubuntu:

Export the required FFmpeg library

Open a terminal window. Run the following command to export the required library to the right path.

export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64/:/usr/local/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH

Try running the FFmpeg command again to confirm that the error has been resolved:

- Advertisement -
ffmpeg

If FFmpeg runs without error, like in the below image, then the issue has been resolved. If not, you may need to try the fix below.

FFmpeg

Configure FFmpeg environment variables

In the Ubuntu terminal, run:

sudo vim /etc/ld.so.conf

Note: This is the default installation path for FFmpeg. If the path is different, you will need to switch to your own installation path and then point to the "lib" folder.

After opening the (VIM) text editor, add the following line.

/usr/local/ffmpeg/lib/
sudo vim etcld.so.conf

Save the file and run:

sudo ldconfig

You're done! Type ffmpeg again to check.

ffmpeg
Juan Mulford
Juan Mulford
I have been active in IT for over fourteen years now. I am a solutions architect, working with storage, virtualization, and VDI solutions. For the past ten years, I have been living and working in Taiwan.

Leave a Reply

- Advertisement -

Popular Articles

mulcas.com-Raspberry-Pi

Raspberry Pi OS in a Virtual Machine with VMware

4
Although the Raspberry Pi OS is designed and optimized for the Raspberry Pi module, it is possible to test and use it without its hardware, with VMware. This solution can be useful if you are a developer (or just a curious guy) and don't have a Raspberry Pi module with you
Unable to delete inaccessible datastore

Unable to delete an "inaccessible" datastore

7
I was switching my storage array, so I migrated the VMs from that old datastore/storage to a new datastore/storage. The old datastore was shared by 3 ESXi hosts, no cluster. After migrating the VMs and unmount/delete the datastore, it was still presented in two of the ESXi hosts and was marked as inaccessible.
This is not a valid source path / URL

This is not a valid source path / URL - SourceTree and Gitlab

0
I have been working on a project with a friend who set up a repository in Gitlab but even though I was able to view all projects on it, I couldn’t really join the repository. I was using SourceTree and Gitlab.
mulcas.com-VMware-OVF-Tool

How to export a Virtual Machine using the VMware OVF Tool

9
The VMware OVF Tool is implemented by VMware for easily importing and exporting virtual machines in Open Virtualization Format (OVF) standard format. Here, I want to show you how to download and install it, and then how to use it from a Windows machine.
Couldn't load private key - Putty key format too new

Couldn't load private key - Putty key format too new

5
couldn't load private key - Putty key format too new.” This issue happens when you use PuTTygen to generate or convert to a ppk key. Here is how to fix it. 
- Advertisement -

Recent Comments