您的位置:首页 > 其它

xcode3.2.6,sdk4.3,ffmpeg0.10.2,编译

2012-10-11 23:05 281 查看
只能编译armv7 and i386

编译ffmepg模拟器版本i386

1. 到https://github.com/gabriel/ffmpeg-iphone-build下载ffmpeg-iphone-build

2.先将gas-preprocessor.pl拷贝到/usr/sbin/目录中。

3.到ffmpeg官网上下载ffmpeg源码

4.在终端下定位到ffmpeg的目录运行

./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-avfilter --disable-debug --disable-encoders --enable-cross-compile --disable-decoders --disable-armv5te --enable-decoder=h264 --enable-pic
--cc=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc --as='gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' --extra-ldflags=-L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/system
--sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk --target-os=darwin --arch=i386 --cpu=i386 --extra-cflags='-arch i386' --extra-ldflags='-arch i386'

5.输入make命令

6.将libavcodec.a,libavdevice.a,libavformat.a,libavutil.a,libswscale.a到对应的目录下拷贝出来。

附注:

//编译日志

在加个 i386的 错误

If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first

解决:

before this cleanAll build then

In xcode go to Project > set active executable > appname - Iphone 4.0 simulator

then open simulator then go to Hardware > version > 4.0.2

then double click urapptarget and in build tab change "ios deployment target = 4.0"

now run in simulator it will work

//遇到sh^M 问题解决:

最近在使用CT++这个软件时遇到这样一个问题:这个软件是在FREEBSD下开发的,虽然提供了C语言源程序,但程序在Visual Studio 2003下编译出现错误。检查原因,主要是因为源程序都是UNIX格式,每行的回车都是用一个0x0a字符表示的,而在WINDOWS/DOS下每行的回车都是用0x0d0a两个字符表示的,而该程序注释为俄文,影响了VS2003的处理,把大量的程序代码都当作注释了,所以编译就不能通过。要编译通过,必须先将UNIX文本格式转换为DOS格式的。UltraEdit的FILE菜单中提供了对单个文件进行这种转换的能力,但是一次只能转换一个文件,比较麻烦。经过一番研究,终于找到了一个批量实现转换的方法。在UE中选择Search
| Search in files菜单,在Find框中填写^n(表示UNIX文件中的回车换行符号),在Replace with中输入^p(表示DOS文件中的回车换行符号),如下图所示。这样就可以实现批量替换了。



编译armv7版本:

./configure \

--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \

--as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \

--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk \

--extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/system \

--target-os=darwin \

--arch=arm \

--cpu=cortex-a8 \

--extra-cflags='-arch armv7' \

--extra-ldflags='-arch armv7' \

--enable-pic \

--enable-cross-compile \

--enable-ffmpeg \

--disable-ffplay \

--disable-ffserver \

--disable-asm \

--disable-encoders \

--disable-decoders \

--enable-decoder=h264 \

--disable-doc
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: