解决ffmpeg执行报错“ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory”的问题

时间:2021-05-22 16:46:17

问题现象:

执行ffmpeg命令后报错:

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

解决ffmpeg执行报错“ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory”的问题

出问题的环境信息为:

Fedora release  (Thirty One)
ffmpeg-4.2. 官方源码编译

看下需要哪些依赖:

ldd ffmpeg

可以看到缺失的依赖

解决ffmpeg执行报错“ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory”的问题

我们找下这些文件在哪里

find /usr -name 'libavdevice.so.58'

应该都在这个目录

/usr/local/lib/

解决ffmpeg执行报错“ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory”的问题

我们export出来:

export LD_LIBRARY_PATH=/usr/local/lib/

然后再尝试执行

/usr/local/bin/ffmpeg

解决ffmpeg执行报错“ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory”的问题

问题解决