windows下ffmpeg源码编译

下载必备

https://www.msys2.org/
https://github.com/FFmpeg/FFmpeg.git
https://code.videolan.org/videolan/x264.git

在以下文件开头加一行数据

/etc/pacman.d/mirrorlist.mingw32
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/i686
/etc/pacman.d/mirrorlist.mingw64
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/x86_64
/etc/pacman.d/mirrorlist.ucrt64
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/ucrt64
/etc/pacman.d/mirrorlist.clang64
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/clang64
/etc/pacman.d/mirrorlist.msys
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/$arch

安装环境

打开msys2
然后打命令

#更新包
pacman -Syu
#安装必备
pacman -S base-devel
#64位
pacman -S mingw-w64-x86_64-toolchain
#32位
pacman -S mingw-w64-i686-toolchain
#依赖
pacman -S yasm
pacman -S nasm
pacman -S make

windows下设置环境变量MSYS2_PATH_TYPE为inherit

编译安装脚本

x264

basepath=$(cd `dirname $0`;pwd)
echo ${basepath}
cd ${basepath}/x264-master
pwd
./configure --host=i686-w64-mingw32 --prefix=${basepath}/x264_install --enable-static --enable-shared \
--extra-ldflags=-Wl,--output-def=libx264.def
make -j8
make install

ffmpeg

basepath=$(cd `dirname $0`;pwd)
echo ${basepath}
cd ${basepath}/FFmpeg-master
 
 
#添加x264 x265 pkg路径
x264_pkg_path=/home/Administrator/x264_install/lib/pkgconfig
export PKG_CONFIG_PATH=$x264_pkg_path:$PKG_CONFIG_PATH
 
 
./configure --arch=x86 --target-os=mingw32 --prefix=${basepath}/ffmpeg_install --disable-static --enable-shared \
--enable-libx264 --enable-gpl
make -j8
make install

然后运行,完事,home的用户目录下就有了。
编译不同自行改脚本。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值