linux - 错误:使用 pkg-config 找不到 dav1d >= 0.2.1
问题描述
我正在尝试使用 dav1d 构建 ffmpeg。我已经使用以下命令成功构建了 davit:
git clone --depth=1 https://code.videolan.org/videolan/dav1d.git && \
cd dav1d && \
mkdir build && cd build && \
meson .. && \
ninja
之后,我正在为 FFmpeg 运行配置命令并收到错误消息:
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
(如果我省略了所有其他库,FFmpeg 会使用它们正确配置和构建--enable-libdav1d
,但如果是上述命令,我会得到):
ERROR: dav1d >= 0.2.1 not found using pkg-config
我认为原因可能是介子将 bin 文件放在错误的目录中。有人可以帮忙吗?
PS 我使用的是 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"
推荐阅读
- mysql - 如何在mysql备份文件中添加“创建数据库”命令
- python - 抓取问题 HTTPSConnectionPool(host='ar.wikipedia.orghttps', port=443): url 超出最大重试次数:
- r - 如何迭代地对索引之前的所有值求和,直到 R 中的向量结束
- python - 有什么方法可以确保您的 CNN 模型在某些阈值之后预测输出?
- sql-server - SQL:从巨大的列表性能中显示块数据
- azure - 持续部署触发器中“构建分支过滤器”的目的是什么?
- python - 你能解释一下双端队列中 np.array 内容的这种奇怪的“更新”吗?
- php - 外键过滤的雄辩方式
- python - 如何根据条件在分类列上绘图
- powershell - 如何抑制powershell runas确认弹出窗口