vlc 3.0 ./configure 给出 "Missing libav or FFmpeg" 尽管我有

vlc 3.0 ./configure gives "Missing libav or FFmpeg" despite I have them

我正在尝试从源代码构建最新开发版本的 vlc-3.0(git 克隆),但是 运行 ./configure 给我以下错误:

configure: error: Missing libav or FFmpeg

尽管我已经从源代码构建并安装了具有以下配置的全新 ffmpeg-3.2.2,包括 --enable-shared(见下文)。此外,在我的 /usr/lib 目录中有一个库 libavcodec.a , libavcodec.so.57.64.101 带有指向它的符号链接 libavcodec.so 和 libavcodec.so.57

刚看了https://github.com/videolan/vlc/blob/master/configure.ac源代码,需要libavcodec >=57.16.0 或ffmpeg >=57.37.100,而57.64.101满足这个要求所以还是不明白是什么是错的。

也许我需要将一些额外的标志传递给 vlc-3.0 以强制它注意到我的 libavcodec 库?如果是,我应该尝试哪些标志?

ffmpeg 配置选项(以防万一):

--prefix=/usr --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --disable-libebur128 --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-libopencv --enable-frei0r --enable-libx264 --enable-chromaprint --enable-shared

我从 Rémi Denis-Courmont 在 VLC 论坛帖子中得到了非常有用的建议 - https://forum.videolan.org/viewtopic.php?f=13&t=137096

Make sure that "pkg-config --modversion libavcodec" works.
If not, then FFmpeg is essentially not installed.

这个命令给我以下错误信息:

Package libavcodec was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavcodec.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavcodec' found

检查了我的 PKG_CONFIG_PATH 变量 - 它是空的 :

echo $PKG_CONFIG_PATH

然后我在 /usr 目录中搜索 libavcodec.pc ,找到了:

find /usr -name "libav*.pc"
/usr/lib/pkgconfig/libavutil.pc
/usr/lib/pkgconfig/libavcodec.pc
/usr/lib/pkgconfig/libavfilter.pc
/usr/lib/pkgconfig/libavformat.pc
/usr/lib/pkgconfig/libavdevice.pc
/usr/lib/pkgconfig/libavresample.pc
/usr/lib64/pkgconfig/libavc1394.pc

现在我需要做的就是添加这些路径: /usr/lib/pkgconfig/ 和 /usr/lib64/pkgconfig/ 以防万一,到 PKG_CONFIG_PATH (可以通过 bashrc 或任何另一种方式)。之后,"pkg-config --modversion libavcodec"输出的是libavcodec的版本号,而不是error,vlc就可以正常配置构建了! ^_^