解决ffmpeg执行报错“ffmpeg: error while loading shared libraries: libavdevice.so.58: 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 31 (Thirty One)
ffmpeg-4.2.1 官方源码编译

 看下需要哪些依赖:

ldd ffmpeg

可以看到缺失的依赖

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

我们找下这些文件在哪里

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”的问题_第2张图片

 我们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”的问题_第3张图片

 

 问题解决

你可能感兴趣的:(解决ffmpeg执行报错“ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory”的问题)