错误:使用 pkg 配置找不到 dav1d >= 0.2.1



我正在尝试用dav1d构建ffmpeg。我已经使用以下命令成功构建了吊柱:

git clone --depth=1 https://code.videolan.org/videolan/dav1d.git && 
cd dav1d && 
mkdir build && cd build && 
meson .. && 
ninja

在那之后,我正在为FFmpeg运行一个config命令,并得到错误:

PKG_CONFIG_PATH="/app/ffmpeg_build/lib/pkgconfig" ./configure 
--prefix="/app/ffmpeg_build" 
--pkg-config-flags="--static" 
--extra-cflags="-I/app/ffmpeg_build/include" 
--extra-ldflags="-L/app/ffmpeg_build/lib" 
--extra-libs="-lpthread -lm" 
--bindir="/usr/local/bin" 
--enable-gpl 
--enable-libass 
--enable-libmp3lame 
--enable-libfreetype 
--enable-libopus 
--enable-libvorbis 
--enable-libx264 
--enable-libdav1d 
--enable-nonfree

(如果我省略了--enable-libdav1d,则安装了所有其他库,并且FFmpeg使用它们正确配置和构建,但在使用上述命令的情况下,我会得到(:

ERROR: dav1d >= 0.2.1 not found using pkg-config

我认为原因可能是介子把bin文件放错了目录。有人能帮忙吗?

附言:我使用的是Ubuntu 18.04。

其他库的构建命令示例:

git -C x264 pull 2> /dev/null || git clone --depth 1 https://code.videolan.org/videolan/x264.git && 
cd x264 && 
PKG_CONFIG_PATH="/app/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/app/ffmpeg_build" --bindir="/usr/local/bin" --enable-static --enable-pic && 
make && 
make install

要通过构建,必须添加ninja install:

git clone --depth=1 https://code.videolan.org/videolan/dav1d.git && 
cd dav1d && 
mkdir build && cd build && 
meson --bindir="/usr/local/bin" .. && 
ninja && 
ninja install

但这还不够,如果你在之后运行FFmpeg,你会得到:

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

要解决此问题,请将/usr/local/lib/x86_64-linux-gnu添加到LD_LIBRARY_PATH:

export LD_LIBRARY_PATH+=":/usr/local/lib/x86_64-linux-gnu"

最新更新