Skip to content

Commit

Permalink
Add third-party/aom.cmd to compile libaom locally
Browse files Browse the repository at this point in the history
  • Loading branch information
wantehchang committed Oct 12, 2022
1 parent 64d4e9a commit 0e1e8fa
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -142,14 +143,24 @@ 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`.
* Install `cargo-c` by executing
```
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`.
Expand All @@ -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`.
Expand All @@ -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`.
Expand Down
20 changes: 20 additions & 0 deletions third-party/aom.cmd
Original file line number Diff line number Diff line change
@@ -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 ..

0 comments on commit 0e1e8fa

Please sign in to comment.