为 iFrameExtractor 编译 ffmpeg 的问题 [英] problem compiling ffmpeg for iFrameExtractor

查看:21
本文介绍了为 iFrameExtractor 编译 ffmpeg 的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 iFrameExtractor 示例中的 make 和 build 文件来编译 ffmpeg.首先,我尝试遵循 github 上的自述文件,它只说在 ffmpeg 文件夹中运行 ./build_universal .它没有用

I'm trying to compile the ffmpeg by using the make and build files in iFrameExtractor example. firstly i tried to follow the readme file on the github, which only says to run the ./build_universal in ffmpeg folder. it did not work

然后我尝试按照 INSTALL 中的信息进行操作,但没有成功.然后我尝试在 INSTALL 中做这些事情,然后是 ./build_universal 这不起作用.导入到项目中的所有 *.a 文件都存在,直到构建序列结束.当 build_universal 中的 lipo 命令运行时,我猜这会连接不同架构的 .a 文件(?).无论如何,这些都会留下以下错误:

i then tried to follow the info in INSTALL without success. i then tried doing the stuff in INSTALL followed by the ./build_universal which didn't work. All the *.a files that are imported to the project exists until the end of the build sequence. when the lipo commands in build_universal are run, which i guess concat the .a files for the different architectures(?). anyhow these leave the following errors:

lipo: specifed architecture type (armv6) for file (armv6/libavcodec.a) does not match it's cputype (16777223) and cpusubtype (3) (should be cputype (12) and cpusubtype (6))
lipo: specifed architecture type (armv6) for file (armv6/libavdevice.a) does not match it's cputype (16777223) and cpusubtype (3) (should be cputype (12) and cpusubtype (6))
lipo: specifed architecture type (armv6) for file (armv6/libavformat.a) does not match it's cputype (16777223) and cpusubtype (3) (should be cputype (12) and cpusubtype (6))
lipo: specifed architecture type (armv6) for file (armv6/libavutil.a) does not match it's cputype (16777223) and cpusubtype (3) (should be cputype (12) and cpusubtype (6))
lipo: specifed architecture type (armv6) for file (armv6/libswscale.a) does not match it's cputype (16777223) and cpusubtype (3) (should be cputype (12) and cpusubtype (6))

如果我只使用 ./build_armv7,我可以让项目为模拟器编译,但如果我运行通用的 .a 文件最终会被删除.并且仅使用不适用于为 iphone 4 构建.

i can get the project to compile for simulator if i only use ./build_armv7 but if i run the universal the .a files are removed in the end. and only using doesn't work to build for iphone 4 .

推荐答案

经过一周的反复试验,我终于能够创建 ffmpeg 通用库,并成功地为设备和模拟器编译和运行 iFrameExtractor.

After a week of trial and error, I was finally able to create the ffmpeg universal libraries and successfully compile and run iFrameExtractor for the device as well as the simulator.

要在您的 iPhone 设备或模拟器上编译和运行项目:

To compile and run the project on your iPhone device OR simulator:

1) 打开终端

2) 克隆仓库:git clone git://github.com/lajos/iFrameExtractor.git

2) clone the repository: git clone git://github.com/lajos/iFrameExtractor.git

3)进入项目中的ffmpeg文件夹:cd iFrameExtractor/ffmpeg

3) go to the ffmpeg folder in the project: cd iFrameExtractor/ffmpeg

4) 运行:./configure

4) run: ./configure

5) 编辑构建脚本(build_armv6、build_armv7、build_i386)如下:

5) Edit the build scripts (build_armv6, build_armv7, build_i386) as follows:

这些脚本假设您在 Xcode 4.2 上使用 iOS SDK 5.0.

These scripts assume you are using iOS SDK 5.0 on Xcode 4.2.

build_armv6:

build_armv6:

#!/bin/tcsh -f

if (! -d armv6) mkdir armv6
if (! -d lib) mkdir lib

rm armv6/*.a

make clean

./configure 
--disable-bzlib --disable-doc 
--disable-ffmpeg --disable-ffplay 
--disable-ffserver --disable-mmx 
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc 
--as='gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' 
--enable-cross-compile --target-os=darwin 
--arch=arm --cpu=arm1176jzf-s 
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk 
--extra-ldflags="-arch armv6 -L//Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/system" 
--extra-cflags="-arch armv6"

make

mv libavcodec/libavcodec.a armv6/
mv libavdevice/libavdevice.a armv6/
mv libavformat/libavformat.a armv6/
mv libavutil/libavutil.a armv6/
mv libswscale/libswscale.a armv6/

rm lib/*.a

cp armv6/*.a lib/

build_armv7:

build_armv7:

#!/bin/tcsh -f

if (! -d armv7) mkdir armv7
if (! -d lib) mkdir lib

rm armv7/*.a

make clean

./configure 
--disable-bzlib --disable-doc 
--disable-ffmpeg --disable-ffplay 
--disable-ffserver --disable-mmx 
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc 
--as='gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' 
--enable-cross-compile --target-os=darwin 
--arch=arm --cpu=cortex-a8 --enable-pic 
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk 
--extra-ldflags="-arch armv7 -    L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/system" 
--extra-cflags="-arch armv7"

make

mv libavcodec/libavcodec.a armv7/
mv libavdevice/libavdevice.a armv7/
mv libavformat/libavformat.a armv7/
mv libavutil/libavutil.a armv7/
mv libswscale/libswscale.a armv7/

rm lib/*.a

cp armv7/*.a lib/

build_i386:

build_i386:

#!/bin/tcsh -f

if (! -d i386) mkdir i386
if (! -d lib) mkdir lib

rm i386/*.a

make clean

./configure 
--disable-bzlib --disable-doc 
--disable-ffmpeg --disable-ffplay 
--disable-ffserver --disable-mmx 
--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/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk 
--extra-ldflags="-arch i386 -L//Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/system" 
--extra-cflags="-arch i386 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -O0 -fasm-blocks -Wreturn-type -Wunused-variable -D__IPHONE_OS_VERSION_MIN_REQUIRED=40000 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -fvisibility=hidden -mmacosx-version-min=10.5 -gdwarf-2"

make

mv libavcodec/libavcodec.a i386/
mv libavdevice/libavdevice.a i386/
mv libavformat/libavformat.a i386/
mv libavutil/libavutil.a i386/
mv libswscale/libswscale.a i386/

rm lib/*.a

cp i386/*.a lib/

6) 构建 ffmpeg 库:./build_universal

6) build the ffmpeg libraries: ./build_universal

7) 打开 xcode 项目并在您的 iPhone 设备或模拟器上运行它

7) open the xcode project and run it on your iPhone device or simulator

这些步骤非常适合我.我希望这能帮助其他努力使 ffmpeg 库适用于 iOS 的人.

These steps work perfectly for me. I hope this will help others struggling to get the ffmpeg libraries working for iOS.

这篇关于为 iFrameExtractor 编译 ffmpeg 的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆