美文网首页
FFMpeg iOS 库生成方式

FFMpeg iOS 库生成方式

作者: woo_5857 | 来源:发表于2020-03-10 15:36 被阅读0次

参考资料

https://daking.tech/ffmpeg/macOS%E4%B8%8A%E7%BC%96%E8%AF%91FFmpeg.html#ffmpeg%E8%B5%84%E6%96%99

https://www.cnblogs.com/XYQ-208910/p/5651166.html

https://www.jianshu.com/p/ecfbebadbe55

//FFMpeg Tool 集入

https://www.jianshu.com/p/299906d4054d

https://dangger.github.io/2015/10/30/index.html

一、编译FFmpeg

1.编译FFmpeg所需的脚本文件gas-preprocessor

下载之后,将 gas-preprocessor.pl 文件复制到 /usr/sbin/ 目录下,如果该目录无法修改,那么可将文件复制到 /usr/local/bin/ 目录下。

2为 gas-preprocessor.pl 文件开启可执行权限,在终端中进行如下命令:

chmod 777 /usr/sbin/gas-preprocessor.pl或者chmod 777 /usr/local/bin/gas-preprocessor.pl

2.yasm 1.2.0 yasm 是一个完全重写的 NASM 汇编。它支持x86和AMD64指令集。

可以使用homebrew来安装,如果没有install yasm,在执行./build-ffmpeg.sh命令的时候,会自动检测并安装。

brew install yasm

3.编译脚本FFmpeg-iOS-build-script

在这个文件中,我们可以对要进行编译的FFmpeg进行一系列的设置。

设置FFmpeg的版本

FF_VERSION="4.0.3"

设置所要支持的架构

ARCHS="arm64 armv7 x86_64 i386"

设置所需要的FFmpeg功能配置

禁用一些不必要的功能,可以有效地减小最终库文件的大小

CONFIGURE_FLAGS="--enable-cross-compile --disable-debug --disable-programs \                --disable-doc --enable-pic"

其中 --disable-cross-compile 禁止交叉编译其中 --enable-cross-compile 支持交叉编译

进入脚本所在文件夹目录,执行脚本

./build-ffmpeg.sh

相关文章

网友评论

      本文标题:FFMpeg iOS 库生成方式

      本文链接:https://www.haomeiwen.com/subject/zwuirhtx.html