`
wenzongliang
  • 浏览: 446754 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

iphone ios sdk6.0编译ffmpeg 我真的编译过去了

 
阅读更多

真机

./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 armv7' \

--extra-ldflags='-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk' \

--enable-pic \

--enable-decoder=rawvideo \

--disable-asm

注意了,上面有--disable-asm \,这是没办法的,禁用了汇编,这样应该是会影响效率的,如果不禁用就编译不通过。谁有更好的办法不禁用,麻烦分享一下。

一般是ok的,如果提示permission deny,那就chmod 777 configure(这个情况是我同事在windows上改了这个文件)

 

测试库是否能用iFrameExtractor这个工程,在网上下载这个工程。在ffmpeg这个文件夹建一个lib文件夹,把之前拷贝(就这个cp -rf lib* /src)出来的.a文件全部丢进去。

 

 

 

模拟器

./configure \

--disable-ffmpeg \

--disable-ffplay \

--disable-ffserver \

--disable-ffprobe \

--disable-doc \

--enable-cross-compile \

--cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \

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

--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk \

--target-os=darwin \

--arch=i386 \

--cpu=i386 \

--extra-cflags='-arch i386' \

--extra-ldflags='-arch i386' \

--extra-ldflags=-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk/usr/lib/system

 

之所以加上--disable-ffprobe是因为本人在编译的时候遇到[ffprobe_p] error。所以干脆将其去掉。

xcode上编译那个下载的iFrameExtractor时还是会出错。因为一些函数被禁用了。用可用的函数替换掉就可以了。

比如:

if(av_open_input_file(&pFormatCtx, [moviePath cStringUsingEncoding:NSASCIIStringEncoding], NULL, 0, NULL)!=0)

替换为 if (avformat_open_input(&pFormatCtx, [moviePath cStringUsingEncoding:NSASCIIStringEncoding],NULL, NULL)!=0)

其他地方如果是警告也可以按照该方法替换。找到有警告的方法,然后到该函数的声明文件找到替代的函数(一般在该被禁用函数的下面)代替即可。

 

下一步研究如何使用,希望能找到比较详细的使用文档之类的东西。

我的话费充值店-各种面额
电信100元仅售98.60 

联通100仅售99.00
移动100仅售99.30

 

 

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics