github code下载地址:
本文配置环境是Visual studio 2022 + cmake 3.23.0 + gcc/g++ 9.2.0 + nasm 2.15.05
1.下载 Visual Studio 2022 community版本:下载 Visual Studio Tools - 免费安装 Windows、Mac、Linux (microsoft.com)
(1)点击VisualStudioSetup.exe
(2)点击安装,选择“使用C++的桌面开发”和“使用C++进行Linux和嵌入式开发”
(3)可以切换安装位置:
(4)进行安装即可。
2.下载CMake 3.23.0 Download | CMake
(1) 需要下载比较新的CMake,之前就是因为下载了CMake 3.14.0,导致一直出现编译错误:
Building shared CMake Error: Could not create named generator Visual Studio 17 2022
(2)使用下面命令确认是否安装成功
#cmake --version
D:\2022\AV1\SVT-AV1\Build\windows>cmake --version
cmake version 3.23.0
CMake suite maintained and supported by Kitware (kitware.com/cmake).
3.下载mingw MinGW - Minimalist GNU for Windows Project Top Page - OSDN
(1)安装后,需要配置环境变量:windows10下搜索“查看高级系统设置”
(2)使用命令查看是否配置成功:
D:\2022\AV1\SVT-AV1\Build\windows>gcc --version
gcc (MinGW.org GCC Build-2) 9.2.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
D:\2022\AV1\SVT-AV1\Build\windows>g++ --version
g++ (MinGW.org GCC Build-2) 9.2.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
4.下载nasm并安装:Index of /pub/nasm/releasebuilds/2.15.05/win64
(1)之前只是安装vcyasm,编译时候出现下面错误
-- Looking for a ASM_NASM compiler - NOTFOUND
-- The ASM_NASM compiler identification is unknown
-- Didn't find assembler
CMake Error at CMakeLists.txt:72 (enable_language):
No CMAKE_ASM_NASM_COMPILER could be found.
5.进入到AV1的Build/windows目录,执行下面的命令编译出SvtAv1EncApp.exe、SvtAv1DecApp.exe:
D:\2022\AV1\SVT-AV1\Build\windows>build.bat 2022