windows下ffmpeg源码编译

 参考:windows上使用vs2019和msys64编译 ffmpeg 4.3 | 码农家园 (codenong.com)

windows下ffmpeg源码编译_第1张图片

windows下ffmpeg源码编译_第2张图片

 windows下ffmpeg源码编译_第3张图片

安装命令:

pacman -S nasm
pacman -S yasm
pacman -S make
pacman -S cmake
pacman -S diffutils
pacman -S pkg-config
pacman -S git

1.编译 x264
将 x264放到home文件下

进入x264目录下

/home/x264

设置编译工具 CC=cl ./configure --enable-shared

编译 make -j16

windows下ffmpeg源码编译_第4张图片

2. 编译 fdk-aac

使用vc进行编译

nmake -f Makefile.vc 

windows下ffmpeg源码编译_第5张图片

指定安装目录:nmake -f Makefile.vc prefix=.\install install

将生成的install

windows下ffmpeg源码编译_第6张图片

粘贴到 

windows下ffmpeg源码编译_第7张图片

中并修改 (fdk-aac.pc 由 fdk-aac.pc.in得到)

prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: Fraunhofer FDK AAC Codec Library
Description: AAC codec library
Version:
Libs: -L${libdir} -lfdk-aac
Libs.private:
Cflags: -I${includedir}

3.编译h265

其它可以检测到的cmake 可以换一个名字

windows下ffmpeg源码编译_第8张图片

编译(出行权限问题,重新用管理员打开vs, 进入msys2重新编译)

./make-Makefiles.sh

windows下ffmpeg源码编译_第9张图片

同理将目录复制到msys64\usr\local 下

4.编译ffmpeg

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


make -j16
make install

你可能感兴趣的:(施磊,ffmpeg)