[Guide] Installing av1an on Ubuntu 22.04

originally posted on r/av1 by u/mrmanwhatisthis on 11 Jan 2023 @ 18:41:17 EST (edited 16 Feb 2023 @ 19:13:01)

This is really more of a guide on installing VapourSynth and zimg, since installing av1an is the ez part.

Based on this https://www.reddit.com/r/AV1/comments/rd5loo/guide_how_to_compile_av1an_on_ubuntu_2104/

I'm using Pop OS 22.04, but this will also work on other Debian-based distros. Installing VapourSynth is not as easy on Ubuntu because the deb-multimedia repo, which provides a prebuilt version of it, is incompatible with Ubuntu as far as I've tested and tried. (Please correct me if I am wrong)

  1. Install dependencies
sudo apt install build-essential aom-tools nasm libtool python3-pip cython3 python3 clang autoconf ffmpeg libavformat-dev libavfilter-dev libavdevice-dev
  1. Compile zimg
git clone https://github.com/sekrit-twc/zimg
cd zimg
git submodule update --init --recursive
./configure
make
sudo make install
  1. Compile VapourSynth
git clone https://github.com/vapoursynth/vapoursynth
cd vapoursynth
./configure
make
sudo make install
Now here is where most people get stuck, since VapourSynth's installation path is non-standard. One way to get around this is to set envars, but I've found the laziest way is to just symlink the libraries to `/usr/lib`.
sudo ln -s /usr/local/lib/libvapour* /usr/lib
Finally, install the Python library. (weirdly, they don't state this in the docs)
pip install vapoursynth
  1. Compile av1an

    Install rustup

     curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    

    Compile

     git clone https://github.com/master-of-zen/Av1an
     cd Av1an
     cargo build --release
     sudo ldconfig
    

    You will find the binary in target/release/. From there, I would advise creating /opt/av1an, copying over the built files, and symlinking the binary to your /usr/bin, or your preferred way of placing your binary on your PATH.

Please bring up any mistakes or corrections. Thank you for reading and I hope this helps you out.