Errors compiling ffmpeg for iPhone

2019-09-01 06:46发布

I'm on OS X Lion and I'm trying to compile the armv7 libraries of ffmpeg for the iPhone. I'm using ffmpeg 0.10.

Here's my configure line:

./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-ffprobe --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/iPhoneOS5.0.sdk --cpu=cortex-a8 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk' --enable-pic --disable-avdevice --disable-avfilter --disable-zlib --disable-bzlib

Configure runs fine although it ends with: WARNING: Compiler does not indicate floating-point ABI, guessing soft.

Here are my make results:

Users-MacBook-Pro:ffmpeg-0.10 user$ make
CC    libavformat/4xm.o
CC    libavformat/a64.o
CC    libavformat/aacdec.o
CC    libavformat/ac3dec.o
CC    libavformat/act.o
CC    libavformat/adtsenc.o
CC    libavformat/adxdec.o
CC    libavformat/aea.o
CC    libavformat/aiffdec.o
CC    libavformat/aiffenc.o
CC    libavformat/allformats.o
CC    libavformat/amr.o
CC    libavformat/anm.o
CC    libavformat/apc.o
CC    libavformat/ape.o
CC    libavformat/apetag.o
CC    libavformat/applehttp.o
CC    libavformat/applehttpproto.o
CC    libavformat/asf.o
CC    libavformat/asfcrypt.o
error: invalid operand in inline asm: 'ldr   ${0:Q}, $1 
    ldr   ${0:R}, $2 
    '
make: *** [libavformat/asfcrypt.o] Error 1
Users-MacBook-Pro:ffmpeg-0.10 user$

Any ideas? Thanks!

2条回答
你好瞎i
2楼-- · 2019-09-01 07:37

There is a problem with inline assembler. I do not know why but you have to disable assembler optimization when compiling ffmpeg (--disable-asm in your configure line).

However, I did not try yet to compile this version of ffmpeg. => I did try to compile FFmpeg v0.10 with disabling asm and it works. However, I think that it will slow on device.

查看更多
贼婆χ
3楼-- · 2019-09-01 07:39

You would need to have a very good reason for using ffmpeg libs in an iOS app as the performance would be very poor as compared to the hardware h.264 solutions already provided with iOS by default. Also, there are real legal issues with including a LGPL library in an iOS app, see this answer for more on that.

查看更多
登录 后发表回答