构建 FFMpeg (Windows MSYS2/MinGW-w64)

(一)环境准备

安装 MSYS2

https://github.com/msys2/msys2/wiki/MSYS2-installation

安装 MinGW-w64

打开 MSYS2 MinGW 64bit(只是一个独立环境),用  pacman 安装 MinGW-w64

pacman -S mingw-w64-x86_64-gcc
pacman -S mingw-w64-x86_64-libtool

安装其他工具

pacman -S yasm
pacman -S make
pacman -S autoconf automake
pacman -S pkg-config
pacman -S git

虽然已经安装了git,但是要配置环境变量太麻烦,直接再用 pacman 安装一个独立的

检查安装结果

$ which make
/usr/bin/make
$ which gcc
/mingw64/bin/gcc
$ which git
/usr/bin/git

下载FFMpeg源码

git clone https://github.com/FFmpeg/FFmpeg.git

(二)构建FFMpeg

./configure \
  --prefix=/mingw64/usr/local
make
make install

参考:

https://github.com/opcodevoid/ffmpeg-builder/wiki/Initial-setup-of-MSYS2

https://trac.ffmpeg.org/wiki/CompilationGuide/MinGW

猜你喜欢

转载自blog.csdn.net/luansxx/article/details/89632916