From 0e1e8fa49b4ae6c968a5fe3e58c984756e26dd12 Mon Sep 17 00:00:00 2001 From: Wan-Teh Chang Date: Wed, 12 Oct 2022 15:54:46 -0700 Subject: [PATCH] Add third-party/aom.cmd to compile libaom locally --- README.md | 21 +++++++++++++++++---- third-party/aom.cmd | 20 ++++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 third-party/aom.cmd diff --git a/README.md b/README.md index da39b5e34a..b5c3668ec4 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,8 @@ Preferably, download the `frame-parallel` branch of libde265, as this uses a more recent API than the version in the `master` branch. Also install x265 and its development files if you want to use HEIF encoding. -For AVIF support, make sure that libaom is installed. +For AVIF support, make sure that libaom is installed in the system or compiled +in the `third-party` directory. ### macOS @@ -142,6 +143,15 @@ cd vcpkg The libheif port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. +### Adding libaom encoder/decoder for AVIF + +* Run the `aom.cmd` script in the `third-party` directory to download libaom and + compile it. + +When running `cmake` or `configure`, make sure that the environment variable +`PKG_CONFIG_PATH` includes the absolute path to `third-party/aom/dist/lib/pkgconfig`. + + ### Adding rav1e encoder for AVIF * Install `cargo`. @@ -149,7 +159,8 @@ The libheif port in vcpkg is kept up to date by Microsoft team members and commu ``` cargo install --force cargo-c ``` -* Run the `rav1e.cmd` script in directory `third-party` to download rav1e and compile it. +* Run the `rav1e.cmd` script in the `third-party` directory to download rav1e + and compile it. When running `cmake` or `configure`, make sure that the environment variable `PKG_CONFIG_PATH` includes the absolute path to `third-party/rav1e/dist/lib/pkgconfig`. @@ -158,7 +169,8 @@ When running `cmake` or `configure`, make sure that the environment variable ### Adding dav1d decoder for AVIF * Install [`meson`](https://mesonbuild.com/). -* Run the `dav1d.cmd` script in directory `third-party` to download dav1d and compile it. +* Run the `dav1d.cmd` script in the `third-party` directory to download dav1d + and compile it. When running `cmake` or `configure`, make sure that the environment variable `PKG_CONFIG_PATH` includes the absolute path to `third-party/dav1d/dist/lib/x86_64-linux-gnu/pkgconfig`. @@ -169,7 +181,8 @@ When running `cmake` or `configure`, make sure that the environment variable You can either use the SVT-AV1 encoder libraries installed in the system or use a self-compiled current version. If you want to compile SVT-AV1 yourself, -* Run the `svt.cmd` script in directory `third-party` to download SVT-AV1 and compile it. +* Run the `svt.cmd` script in the `third-party` directory to download SVT-AV1 + and compile it. When running `cmake` or `configure`, make sure that the environment variable `PKG_CONFIG_PATH` includes the absolute path to `third-party/dav1d/dist/lib/x86_64-linux-gnu/pkgconfig`. diff --git a/third-party/aom.cmd b/third-party/aom.cmd new file mode 100644 index 0000000000..64504718b6 --- /dev/null +++ b/third-party/aom.cmd @@ -0,0 +1,20 @@ +: # This install script was originally taken from libavif but might have been modified. + +: # If you want to use a local build of libaom, you must clone the aom repo in this directory first, then enable CMake's WITH_AOM option. +: # The git SHA below is known to work, and will occasionally be updated. Feel free to use a more recent commit. + +: # The odd choice of comment style in this file is to try to share this script between *nix and win32. + +: # cmake and ninja must be in your PATH. + +: # If you're running this on Windows, be sure you've already run this (from your VC2019 install dir): +: # "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat" + +git clone -b v3.5.0 --depth 1 https://aomedia.googlesource.com/aom + +cd aom + +cmake -S . -B build.libavif -G Ninja -DCMAKE_INSTALL_PREFIX="$(pwd)/dist" -DCMAKE_BUILD_TYPE=Release -DENABLE_DOCS=0 -DENABLE_EXAMPLES=0 -DENABLE_TESTDATA=0 -DENABLE_TESTS=0 -DENABLE_TOOLS=0 +ninja -C build.libavif +ninja -C build.libavif install +cd ..