Skip to content

Instantly share code, notes, and snippets.

@Aaron2550
Last active February 24, 2023 12:43
Show Gist options
  • Save Aaron2550/3bd29b9315f37194f25aee3e83853de4 to your computer and use it in GitHub Desktop.
Save Aaron2550/3bd29b9315f37194f25aee3e83853de4 to your computer and use it in GitHub Desktop.
Build and Install LibAVIF on Windows
"C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Auxiliary\Build\vcvars64.bat"
git clone --depth 1 https://github.com/AOMediaCodec/libavif.git
cd libavif
cd ext
libjpeg.cmd
zlibpng.cmd
set "CC=clang-cl"
set "CXX=clang-cl"
libyuv.cmd
set "CC="
set "CXX="
libsharpyuv.cmd
aom.cmd
dav1d.cmd
libgav1.cmd
rav1e.cmd
svt.cmd
cd ..
mkdir build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DAVIF_CODEC_AOM=ON -DAVIF_LOCAL_AOM=ON -DAVIF_CODEC_DAV1D=ON -DAVIF_LOCAL_DAV1D=ON -DAVIF_CODEC_LIBGAV1=ON -DAVIF_LOCAL_LIBGAV1=ON -DAVIF_CODEC_RAV1E=ON -DAVIF_LOCAL_RAV1E=ON -DAVIF_CODEC_SVT=ON -DAVIF_LOCAL_SVT=ON -DAVIF_LOCAL_JPEG=ON -DAVIF_LOCAL_ZLIBPNG=ON -DAVIF_LOCAL_LIBYUV=ON -DAVIF_BUILD_APPS=ON ..
ninja
mkdir C:\Stuff\AVIF
copy avifenc.exe C:\Stuff\AVIF\avifenc.exe
copy avifdec.exe C:\Stuff\AVIF\avifdec.exe
setx /M path "%path%;C:\Stuff\AVIF"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment