错误:使用 pkg-config 找不到 SvtAv1Enc

Dmi*_*kov 7 linux plugins ffmpeg build

我正在尝试使用 SVT-AV1 编解码器编译 FFmpeg,请按照此处的说明进行操作:https ://github.com/OpenVisualCloud/SVT-AV1/tree/master/ffmpeg_plugin

一切都很顺利,但是当我尝试跑步时

./configure --enable-libsvtav1
Run Code Online (Sandbox Code Playgroud)

我正进入(状态

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.
Run Code Online (Sandbox Code Playgroud)

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

github 上有一个确切的问题: https: //github.com/OpenVisualCloud/SVT-AV1/issues/35,但已解决并关闭。

我已经在 Mac 和 Ubuntu 18.04 的 Docker 容器中进行了尝试,但得到了相同的结果。

有人可以帮忙吗,我做错了什么?

Dmi*_*kov 10

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

安装编译所需的包:

sudo apt-get update
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)

安装一些库使用的汇编器:

sudo apt-get install nasm
sudo apt-get install yasm
Run Code Online (Sandbox Code Playgroud)

构建并安装 SVT-AV1:

git clone --depth=1 https://gitlab.com/AOMediaCodec/SVT-AV1.git
cd SVT-AV1
cd Build
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
make -j $(nproc)
sudo make install
Run Code Online (Sandbox Code Playgroud)

应用 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
Run Code Online (Sandbox Code Playgroud)

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

构建 FFmpeg:

make
make install
hash -r
source ~/.profile
Run Code Online (Sandbox Code Playgroud)

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

ffmpeg -encoders
Run Code Online (Sandbox Code Playgroud)
...
V..... libsvt_av1           SVT-AV1(Scalable Video Technology for AV1) encoder (codec av1)
...
Run Code Online (Sandbox Code Playgroud)

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

  • 该库似乎已移至 https://gitlab.com/AOMediaCodec/SVT-AV1 (3认同)