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

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

问题描述

我正在使用 iFrameExtractor示例中的make和build文件来编译ffmpeg。首先我试图按照github上的自述文件进行操作,该文件只是在ffmpeg文件夹中运行 ./ build_universal 。它没有工作



然后,我尝试在INSTALL中关注信息,没有成功。然后,我尝试在INSTALL中执行这些操作,然后再执行 ./ build_universal 。导入项目的所有* .a文件存在,直到生成序列结束。当运行build_universal中的 lipo 命令时,我猜这是不同的架构(?)的.a文件。无论如何,这些会丢失以下错误:

  lipo:指定的文件架构类型(armv6)(armv6 / libavcodec.a)匹配它的cputype(16777223)和cpusubtype(3)(应该是cputype(12)和cpusubtype(6))
lipo:指定的文件架构类型(armv6)(armv6 / libavdevice.a)不匹配它的cputype (16777223)和cpusubtype(3)(应该是cputype(12)和cpusubtype(6))
lipo:指定的文件架构类型(armv6)(armv6 / libavformat.a)不匹配它的cputype(16777223)和cpusubtype(3)(应该是cputype(12)和cpusubtype(6))
lipo:指定的文件架构类型(armv6)(armv6 / libavutil.a)与cputype(16777223)和cpusubtype( 3)(应为cputype(12)和cpusubtype(6))
lipo:指定的文件架构类型(armv6)(armv6 / libswscale.a)与cputype(16777223)和cpusubtype(3)(应该是cputype(12)和cpusubtype(6))

我如果我只使用 ./ build_armv7 ,但是如果我运行通用的.a文件最后被删除,可以获得该模拟器的编译。并且只使用不能为iPhone 4构建。

解决方案

经过一周的试用和错误,我终于可以创建ffmpeg通用库,并成功编译和运行iFrameExtractor for设备以及模拟器。



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



1)打开终端



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



3)转到项目中的ffmpeg文件夹:cd iFrameExtractor / ffmpeg



4)运行:./configure



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



这些脚本假设您在Xcode上使用iOS SDK 5.0 $。
$ b

build_armv6: f

如果(!-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 //开发人员/平台/ 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 / *。lib /

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手臂v7 /
mv libswscale / libswscale.a armv7 /

rm lib / *。a

cp armv7 / *。lib /

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 //开发人员/平台/ 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 = hidde n -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 / *。lib /

6)构建ffmpeg库:./build_universal



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



这些步骤对我来说是完美的。我希望这将有助于其他人努力使ffmpeg图书馆为iOS工作。


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

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))

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 .

解决方案

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.

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

1) open Terminal

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

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

4) run: ./configure

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

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

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:

#!/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:

#!/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) build the ffmpeg libraries: ./build_universal

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

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天全站免登陆