免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1600 | 回复: 0
打印 上一主题 下一主题

编译在ios4.3中使用的ffmpeg库(转) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-23 01:27 |只看该作者 |倒序浏览

编译在ios4.3中使用的ffmpeg库(转)

08.31.2011, Iphone, by , 88 views.

1. 下载:
在终端中输入:git clone git://github.com/lajos/iFrameExtractor.git
注:该文件包中包含ffmpeg库以及demo。
2.编辑:
打开iFrameExtractor文件夹下ffmpeg中的 build_armv6和build_armv7,修改./configure后面的参数,主要是SDK版本.我的是4.3,修改为:
./configure –disable-doc –disable-ffmpeg –disable-ffplay –disable-ffserver –enable-cross-compile –arch=arm –target-os=darwin –cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc –as=’gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc’ –sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk –cpu=arm1176jzf-s –extra-cflags=’-arch armv6′ –extra-ldflags=’-arch armv6′
3. 编译:
出错,提示:
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc is unable to create an executable file.
C compiler test failed.
查看config.err文件,最后提示:
ld: file not found: /usr/lib/system/libcache.dylib for architecture armv7
collect2: ld returned 1 exit status

4. 重新修改build_armv7中的configure参数为:
./configure –disable-doc –disable-ffmpeg –disable-ffplay –disable-ffserver –enable-cross-compile –arch=arm –target-os=darwin –cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc –as=’gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc’ –sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk –cpu=cortex-a8 –extra-cflags=’-arch armv7′ –extra-ldflags=’-arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk’ –enable-pic
5. 编译:
build_armv7
最后生成静态库,在lib目录和armv7目录.
注:build_armv7不能运行,则将该文件的每个命令直接在终端中运行。

6.用xcode(我的是4.0版本)打开iFrameExtractor.xcodeproj,现在编译会出错,需要修改几个地方:
左边选中工程,中间选中target,右面选中Build settings,在Architectures选项卡里面选择Architetures为Optimized(armv7),Base SDK为Latest iOS(iOS 4.3) Valid Architectures填写armv7.
编译目标选择iOS Device,当然,如果有连接电脑的设备,可以选择设备.
编译,提示:

Undefined symbols for architecture armv7:
“_BZ2_bzDecompressInit”, referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
“_BZ2_bzDecompressEnd”, referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
“_BZ2_bzDecompress”, referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)

添加库libbz2.1.0.dylib,再次编译,OK通过.

以下步骤可以忽略:

7. 修改了ffmpeg版本到最新版(0.7),编译的时候需要把common.mak复制到新版本目录.
编译的时候遇到错误:
ERROR: .endm without .macro at /usr/local/bin/gas-preprocessor.pl line 83, line 55
用老版本的libavcodec/arm/asm.S和libavcoec/arm/dsputil_arm.S覆盖新版本(实际上我怀疑只覆盖asm.S即可),重新编译即可.
原文地址:http://blog.csdn.net/tsingien/article/details/6457246

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP