FFMpeg
Nevermore 2024-10-10
# 依赖工具
包管理msys2 (opens new window)下载安装
pacman -S nasm pacman -S yasm pacman -S make cmake pacman -S diffutils # 比较工具 pacman -S pkg-config # 库配置工具 pacman -S git
1
2
3
4
5
6x264源码编译
git clone https://code.videolan.org/videolan/x264.git
1编译
- 为了保证环境可用,选择如下shell
- cd C:\msys64 修改msys2_shell.cmd
# 第三行添加 call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" # 修改 set MSYS2_PATH_TYPE=inherit
1
2
3
4
- 运行msys2_shell.cmd -mingw64
CC=cl ./configure --enable-shared Make -j4 Make install
1
2
3
- fdk-acc源码编译
- v2.0.1有Makefile.vc
git clone https://github.com/mstorsjo/fdk-aac.git nmake -f Makefile.vc nmake -f Makefile.vc prefix=.\install install
1
2
3
4
5
6
- 新版本利用cmake和visual studio
- x265
进入msys-cl运行 ./make-Makefiles.sh,注意要先将/user/bin/cmake.exe改名,目的是使用系统安装的cmake进行编译
nmake install
注意修改x265.pc,指定路径
CC=cl.exe ./configure --prefix=./install --toolchain=msvc --enable-shared --disable-programs --disable-ffplay --disable-ffmpeg --disable-ffprobe --enable-libx264 --enable-gpl --enable-libfdk-aac --enable-nonfree --enable-libx265
1编译过程的错误可以在ffbuild/config.log查看
错误
ERROR: libfdk_aac not found
将pkgconfig复制到msys64/usr/lib
ERROR: x264 not found using pkg-config
libx264.dll.lib修改为libx264.lib
ERROR: x265 not found using pkg-config
libx265.lib修改为x265.lib
make -j16
make install