运行应用程序时遇到以下错误:
./Application: /lib/x86_64-linux-gnu/libavutil-ffmpeg.so.54: version `LIBAVUTIL_FFMPEG_54' not found (required by /usr/local/lib/libopencv_videoio.so.3.3)
./Application: /lib/x86_64-linux-gnu/libswscale-ffmpeg.so.3: version `LIBSWSCALE_FFMPEG_3' not found (required by /usr/local/lib/libopencv_videoio.so.3.3)
./Application: /lib/x86_64-linux-gnu/libavcodec-ffmpeg.so.56: version `LIBAVCODEC_FFMPEG_56' not found (required by /usr/local/lib/libopencv_videoio.so.3.3)
./Application: /lib/x86_64-linux-gnu/libavformat-ffmpeg.so.56: version `LIBAVFORMAT_FFMPEG_56' not found (required by /usr/local/lib/libopencv_videoio.so.3.3)
ffmpeg
ffmpeg version 4.2 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8 (Ubuntu 8.3.0-6ubuntu1)
configuration: --enable-shared
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
ldd $(which ffmpeg) 似乎没问题:
linux-vdso.so.1 (0x00007ffc726da000)
libavdevice.so.58 => /usr/local/lib/libavdevice.so.58 (0x00007feed0645000)
libavfilter.so.7 => /usr/local/lib/libavfilter.so.7 (0x00007feed0374000)
libavformat.so.58 => /usr/local/lib/libavformat.so.58 (0x00007feed012a000)
libavcodec.so.58 => /usr/local/lib/libavcodec.so.58 (0x00007feecec71000)
libswresample.so.3 => /usr/local/lib/libswresample.so.3 (0x00007feecec53000)
libswscale.so.5 => /usr/local/lib/libswscale.so.5 (0x00007feecebc7000)
libavutil.so.56 => /usr/local/lib/libavutil.so.56 (0x00007feeceabd000)
libm.so.6 => /usr/lib/x86_64-linux-gnu/libm.so.6 (0x00007feece96f000)
libpthread.so.0 => /usr/lib/x86_64-linux-gnu/libpthread.so.0 (0x00007feece94e000)
libc.so.6 => /usr/lib/x86_64-linux-gnu/libc.so.6 (0x00007feece763000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007feece73a000)
libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007feece735000)
libxcb-shape.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shape.so.0 (0x00007feece72e000)
libxcb-xfixes.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-xfixes.so.0 (0x00007feece724000)
libz.so.1 => /usr/lib/x86_64-linux-gnu/libz.so.1 (0x00007feece708000)
liblzma.so.5 => /usr/lib/x86_64-linux-gnu/liblzma.so.5 (0x00007feece6e1000)
/lib64/ld-linux-x86-64.so.2 (0x00007feed06ca000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007feece4dd000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007feece2d5000)
libbsd.so.0 => /usr/lib/x86_64-linux-gnu/libbsd.so.0 (0x00007feece2bb000)
librt.so.1 => /usr/lib/x86_64-linux-gnu/librt.so.1 (0x00007feece2b0000)
有谁知道如何解决它?
您的应用程序很旧,正在寻找一个非常旧的 FFmpeg 版本。
问题:
.so
错误位置查找文件。您的应用程序正在寻找/lib/x86_64-linux-gnu/libavutil-ffmpeg.so.54
等,但您的 FFmpeg 可能只提供/usr/local/lib/libavutil.so.56
.libavutil-ffmpeg
是旧 Ubuntu 版本中 ffmpeg 包使用的旧命名方案。54
和56
代表每个 FFmpeg 库的主要版本。主要版本之间的 API 不兼容。根据您的主要版本号,该应用程序看起来像是为 FFmpeg 2.8 发布分支编写的。这是很古老的。您编译并安装了 FFmpeg 4.2。更新应用程序代码以使用 FFmpeg 4.2 发布分支,或者安装 FFmpeg 2.8。谢谢@llogan!正如你所解释的那样,这是我的想法。
解决方案:我删除了所有旧库,并从 Ubuntu 存储库中准确下载了所需 .lib 的每个 .deb 包并手动安装它们。