compile ffmpeg for armv7 armv7s[通俗易懂]

1.下载ffmpeggitclonegit://source.ffmpeg.org/ffmpeg.gitffmpeg2.下载gas-preprocessor地址: https://github.com/yuvi/gas-preprocessor下载完后把gas-preprocessor.pl复制到/usr/bin/目录下,修改权限 chmod7773.解压ffm

大家好,又见面了,我是你们的朋友全栈君。

1.下载ffmpeg

git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg

2.下载gas-preprocessor

地址: https://github.com/yuvi/gas-preprocessor

下载完后把gas-preprocessor.pl 复制到 /usr/bin/ 目录下,修改权限  chmod 777

3.解压ffmpeg,并进入ffmpeg文件夹:

a.编译armv7

./configure –cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc –as=’/usr/bin/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc’ –sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk –extra-ldflags=-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/lib/system –target-os=darwin –arch=arm –cpu=cortex-a8 –extra-cflags=’-arch armv7′ –extra-ldflags=’-arch armv7′ –extra-cflags=’-mfpu=neon’ –extra-cflags=’-mfloat-abi=softfp’ –enable-pic –enable-cross-compile –enable-ffmpeg  –enable-decoder=h264 –disable-doc

b.编译完后,make , sudo make install

c.可以在/usr/local/目录下看到lib inlucde文件夹都有新增文件,将/usr/local/lib/下的.a文件复制到随便新建一个文件夹,命名文件夹armv7


4.编译armv7s

a. ./configure –disable-doc –disable-ffmpeg –disable-ffplay –disable-ffserver –enable-cross-compile –arch=arm –target-os=darwin –cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc –as=’gas-preprocessor/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc’ –sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk –cpu=cortex-a8 –extra-cflags=’-arch armv7s’ –extra-ldflags=’-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk’ –enable-pic –enable-decoder=rawvideo –disable-asm

b.编译完后,make , sudo make install

c.可以在/usr/local/目录下看到lib inlucde文件夹都有新增文件,将/usr/local/lib/下的.a文件复制到随便新建一个文件夹,命名文件夹armv7s


5.合并两个版本

a.去掉重复的log2_tab.o

ar -dv armv7s/libavutil.a log2_tab.o

ar -dv armv7/libavutil.a log2_tab.o

ar -dv armv7s/libswresample.a log2_tab.o

ar -dv armv7/libswresample.a log2_tab.o

ar -dv armv7s/libavformat.a log2_tab.o

ar -dv armv7/libavformat.a log2_tab.o

b.合并

xcrun -sdk iphoneos lipo -create -arch armv7 armv7/libavcodec.a -arch armv7s armv7s/libavcodec.a -output libavcodec.a

xcrun -sdk iphoneos lipo -create -arch armv7 armv7/libavdevice.a -arch armv7s armv7s/libavdevice.a -output libavdevice.a

xcrun -sdk iphoneos lipo -create -arch armv7 armv7/libavfilter.a -arch armv7s armv7s/libavfilter.a -output libavfilter.a

xcrun -sdk iphoneos lipo -create -arch armv7 armv7/libavformat.a -arch armv7s armv7s/libavformat.a -output libavformat.a

xcrun -sdk iphoneos lipo -create -arch armv7 armv7/libavutil.a -arch armv7s armv7s/libavutil.a -output libavutil.a

xcrun -sdk iphoneos lipo -create -arch armv7 armv7/libswresample.a -arch armv7s armv7s/libswresample.a -output libswresample.a

xcrun -sdk iphoneos lipo -create -arch armv7 armv7/libswscale.a -arch armv7s armv7s/libswscale.a -output libswscale.a

6.添加到xcode

新建文件夹ffmpeg,将合并后的.a文件和/usr/local/include/*的文件复制到ffmpeg夹下,把ffmpeg复制到工程下,并add

7.在工程的build phase引入libz.dylib和libbz2.dylib两个库

8.在Build Settings, 搜索header search paths, 加上ffmpeg

编译运行。。



版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/127466.html原文链接:https://javaforall.net

赞 (0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 移动硬盘提示格式化解决的方法,未正确删除导致不能读取文件提示格式化解决方式

    移动硬盘提示格式化解决的方法,未正确删除导致不能读取文件提示格式化解决方式

    2021年12月14日
  • [基础控件]—状态切换控件CompoundButton及其子类CheckBox、RadioButton、ToggleButton、switch事件监听与场景使用…[通俗易懂]

    [基础控件]—状态切换控件CompoundButton及其子类CheckBox、RadioButton、ToggleButton、switch事件监听与场景使用…[通俗易懂]一、事件监听对于普通的Button,对其进行事件监听Google官方给出了常见的三种监听方式:1、对每一个button设置事件监听器button.setOnClickListener(View.OnclickListenerlistener);此种方法当button按钮较多时代码显得多、乱、不够简洁明了。2、在Activity中实现接口View.OnclickListener,然后重写…

    2022年7月18日
  • WPF Visifire.Charts4.6.1使用教程 附含源码

    WPF Visifire.Charts4.6.1使用教程 附含源码原因:前段时间,公司项目中用到Visifire.Charts4.5.6控件,项目中要求随时可以控制动画效果,用于在大屏上面展示,很酷炫。过程:但是没有源码,于是写了一个方法用动画去控制数量动态增长,无奈效率太低,多实例几个Chart就卡到爆,放弃。没有源码,怎么办呢,无奈之下反编译了一下dll,刚开始用reflector反编译,发现编译出来的大部分都用不了。然后又用ILSpy反编译…

    2022年7月21日
  • Identity标识列

    SQLServer中,经常会用到Identity标识列,这种自增长的字段操作起来的确是比较方便。但它有时还会带来一些麻烦。示例一:当表中被删除了某些数据的时候,自增长列的编号就不再是一个连线的数

    2021年12月22日
  • DeepLab系列学习

    DeepLab系列文章目录DeepLab系列DeepLabV1简介atrousalgorithm利用全卷积增加感受野并加速运算条件随机场CRF实验结果多尺度预测VOC数据集上对比DeepLabV2主要改进简介模型主体ASPP实验结果DeepLabV3相应的改进实验DeepLabV3+(DeepLabV3plus)相应改进整体结构解码器结构modifiedXception实验参考DeepLabV1DeepLabV1github简介DeepLab系列在2015年的ICLR上被提出,主要是使用D

    2022年4月15日
  • 2022年G3锅炉水处理找解析及G3锅炉水处理考试试卷[通俗易懂]

    题库来源:安全生产模拟考试一点通公众号小程序安全生产模拟考试一点通:G3锅炉水处理找解析是安全生产模拟考试一点通生成的,G3锅炉水处理证模拟考试题库是根据G3锅炉水处理最新版教材汇编出G3锅炉水处理仿真模拟考试。2022年G3锅炉水处理找解析及G3锅炉水处理考试试卷1、【多选题】水垢对锅炉的危害主要有浪费燃料()。(ABD)A、.损坏锅炉受热面B、.降低锅炉出力C、.减少供汽时间D、.缩短锅炉使用寿命E、.提高了环境温度2、【多选题】特种设备作业人员应当遵守()规…

    2022年4月14日

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号