Search code examples
linuxpluginsffmpegbuild

ERROR: SvtAv1Enc not found using pkg-config


I am trying to compile FFmpeg with SVT-AV1 codec, following instructions from here: https://github.com/OpenVisualCloud/SVT-AV1/tree/master/ffmpeg_plugin

Everything goes well, but when I try to run

./configure --enable-libsvtav1

I am getting

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
[email protected] 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.

The content of the ffbuild/config.log: https://pastebin.com/euPriFAp

There is an exact issue on the github: https://github.com/OpenVisualCloud/SVT-AV1/issues/35, but is closed as solved.

I have tried both on my Mac and in the Docker container with Ubuntu 18.04, but getting the same result.

Could anyone please help, what am I doing wrong?


Solution

  • The problem was in the lack of required libraries. Please find the complete installation instruction below.

    Installing packages required for compiling:

    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
    

    Installing assemblers used by some libraries:

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

    Build and install 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
    

    Apply SVT-AV1 plugin and enable libsvtav1 to 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
    

    (Note: if you want other codecs to be supported please add the required flags to the ./configure command)

    Build FFmpeg:

    make
    make install
    hash -r
    source ~/.profile
    

    Now you should have ffmpeg command working and have svt-av1 in encoders list:

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

    I used next docs a reference: