ERROR: SvtAv1Enc not found using pkg-config

ERROR: SvtAv1Enc not found using pkg-config

我正在尝试使用 SVT-AV1 编解码器编译 FFmpeg,遵循此处的说明:https://github.com/OpenVisualCloud/SVT-AV1/tree/master/ffmpeg_plugin

一切顺利,但是当我尝试 运行

./configure --enable-libsvtav1

我得到

ERROR: SvtAv1Enc not found using pkg-config

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

ffbuild/config.log 的内容:https://pastebin.com/euPriFAp

github 上确实存在一个问题:https://github.com/OpenVisualCloud/SVT-AV1/issues/35,但已解决。

我在我的 Mac 和 Docker 容器中都尝试过 Ubuntu 18.04,但得到的结果相同。

谁能帮忙,我做错了什么?

问题在于缺少所需的库。请在下面找到完整的安装说明。

正在安装编译所需的包:

sudo apt-get update
sudo apt-get install \
  autoconf \
  automake \
  build-essential \
  cmake \
  git-core \
  libass-dev \
  libfreetype6-dev \
  libsdl2-dev \
  libtool \
  libva-dev \
  libvdpau-dev \
  libvorbis-dev \
  libxcb1-dev \
  libxcb-shm0-dev \
  libxcb-xfixes0-dev \
  pkg-config \
  texinfo \
  wget \
  zlib1g-dev

正在安装一些库使用的汇编程序:

sudo apt-get install nasm
sudo apt-get install yasm

构建并安装 SVT-AV1:

git clone --depth=1 https://github.com/OpenVisualCloud/SVT-AV1
cd SVT-AV1
cd Build
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
make -j $(nproc)
sudo make install

应用 SVT-AV1 插件并启用 libsvtav1 到 FFmpeg:

cd ~
git clone -b release/4.2 --depth=1 https://github.com/FFmpeg/FFmpeg ffmpeg
cd ffmpeg
export LD_LIBRARY_PATH+=":/usr/local/lib"
export PKG_CONFIG_PATH+=":/usr/local/lib/pkgconfig"
git apply ../SVT-AV1/ffmpeg_plugin/0001-Add-ability-for-ffmpeg-to-run-svt-av1.patch
./configure --enable-libsvtav1

(注意:如果您希望支持其他编解码器,请在 ./configure 命令中添加所需的标志)

构建 FFmpeg:

make
make install
hash -r
source ~/.profile

现在您应该可以使用 ffmpeg 命令并在编码器列表中包含 svt-av1:

ffmpeg -encoders
...
V..... libsvt_av1           SVT-AV1(Scalable Video Technology for AV1) encoder (codec av1)
...

我使用下一个文档作为参考: