FFMPEG iOS 7 Library

2019-02-01 15:05发布

问题:

I've tried reading many tutorials. I've spent hours on google, and stackoverflow trying answer. So far I've read: Trying to compile the FFMPEG libraries for iPhoneOS platform with armv6 and arv7 architecture FFMPEG integration on iphone/ ipad project and https://github.com/lajos/iFrameExtractor few of the many.

I'm trying to build this library for iOS 7/Xcode 5 compatibility but it's not working. A common error I'd get is:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
yasm/nasm not found or too old. Use --disable-yasm for a crippled build.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.

I'd also get many more once that is finished. Such as:

rm: illegal option -- .
usage: rm [-f | -i] [-dPRrvW] file ...
       unlink file
make: *** [clean] Error 64

I've mostly tried using this command to start, but it always crashes on "make clean":

./configure \
--cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
--as='/usr/local/bin/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/iPhoneOS7.0.sdk \
--target-os=darwin \
--arch=arm \
--cpu=cortex-a8 \
--extra-cflags='-arch armv7' \
--extra-ldflags='-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk' \
--prefix=compiled/armv7 \
--enable-cross-compile \
--enable-nonfree \
--enable-gpl \
--disable-armv5te \
--disable-swscale-alpha \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-asm \
--disable-debug

回答1:

To use the mooncatventures (our) ffmpegdecoderFramework, go into build settings click on the arch and remove the armv7s.

you must also change build active architechure only to no.



回答2:

This answer from mientus worked for me : https://stackoverflow.com/a/19370679/661720

Support universal ffmpeg library for iOS7 and XCode5:

Install gas-preprocessor

Click on the ZIP icon to download https://github.com/mansr/gas-preprocessor. Copy gas-preprocessor.pl to /usr/bin directory. Change permission of gas-preprocessor.pl by setting the privilege to Read & Write for all.

Download my shell script from: https://gist.github.com/m1entus/6983547

Run sh build-ffmpeg.sh.