Ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file

The “loading shared libraries” error message is received when ffmpeg is not able to locate the file libavdevice.so.52. This happens when either the file is missing from the server OR ffmpeg is not looking at the path the file is in. You see the following error while executing the ‘ffmpeg’ command:

[root@server ~]# ffmpegffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory

Solution:Search the file libavdevice.so.52 on the server using the ‘find’ command

# find / -name libavdevice.so.52

You need to add the path to the directory the file is in, in the ‘ld.so.conf’ file. If for example the file is located under “/usr/local/lib” directory, execute

# vi /etc/ld.so.conf

and add the following at the bottom of the file

/usr/local/lib

Save the file and for the new changes to take effect, execute

# ldconfig

2 thoughts on “Ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file

Leave a comment