4

I'm trying to compile the FFMPEG Libraries for IOS platform with arm7 architecture. I downloaded the FFMPEG libraries from http://www.ffmpeg.org.

I'm successfully able to build the static libraries for the i386 architecture for the iPhoneSimulator. But I need the libraries for iPhoneOS. Using the configure command I'm getting an error. Below are my command details.

For i386(which is error free):

./configure  --enable-cross-compile --disable-debug --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-doc --disable-network  --disable-everything  --enable-protocol=file --enable-demuxer=mov  --enable-muxer=mpegts --enable-bsf=h264_mp4toannexb   --arch=i386 --target-os=darwin --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc --as='./gas-preprocessor/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneOS6.1.sdk --cpu=i386 --extra-cflags='-arch i386' --extra-ldflags='-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk' --prefix="/Users/amit/Desktop/LivuLib-master/LivuLIb/ffmpeg/bin/newLib"

For armv7:

./configure  --enable-cross-compile --disable-debug --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-doc --disable-network  --disable-everything  --enable-protocol=file --enable-demuxer=mov  --enable-muxer=mpegts --enable-bsf=h264_mp4toannexb   --arch=armv7 --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=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk --cpu=cortex-a9 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk' --prefix="/Users/amit/Desktop/LivuLib-master/LivuLIb/ffmpeg/bin/newLib"

For above command for Arm7 I'm getting this error:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc is unable to create an executable file.
C compiler test failed.

If you think configure made a mistake, make sure you are using the latest
version from SVN.

So please suggest me a possible solution. Why is it not working? Or do I need to update anything. Thanks.

Omega
  • 1,101
  • 9
  • 14
iDevAmit
  • 1,550
  • 2
  • 21
  • 33
  • See this page for info about LGPL and iOS incompatibility, you need to think about this before attempting to use ffmpeg in an iOS app: [compatibility-between-the-iphone-app-store-and-the-lgpl](http://multinc.com/2009/08/24/compatibility-between-the-iphone-app-store-and-the-lgpl/). – MoDJ Jun 19 '13 at 22:05
  • Here's a script to build FFmpeg for iOS 6.1+ based on iOS 7.0 SDK (Xcode 5) : https://github.com/renebigot/build_FFmpeg_for_iOS It'll build universal (armv7, armv7s and i386) static libraries. – Massale Oct 09 '13 at 00:11
  • For those looking for answers to cross-compile ffmpeg library for iOS platform using Xcode 5, study the build script from http://www.ffmpeg4ios.org/ and modify the SDK for the latest version. similar question http://stackoverflow.com/questions/19092796/build-ffmpeg-with-xcode-5 – Sany Liew Oct 01 '13 at 15:17

1 Answers1

2

I realize this question was asked about ~2.5 months ago, so the asker may have moved on, but I came across it while searching for an answer to the same issue. So, hopefully, this will be of help to someone out there!

All I really had to do was verify that ALL the paths I was using were actually pointing to something that existed.

Specifically, I was trying to run:

./configure \
--prefix=armv7 \
--disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver \
--enable-avresample --enable-cross-compile \
--sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk" \
--target-os=darwin \
--cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" \
--extra-cflags="-arch armv7 -mfpu=neon -miphoneos-version-min=6.0" \
--extra-ldflags="-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -miphoneos-version-min=6.0" \
--arch=arm --cpu=cortex-a9 --enable-pic

^ from http://www.tangentsoftworks.com/2012/11/12/how-to-prepare-your-mac-for-ios-development-with-ffmpeg-libraries/

When I couldn't get it to work, I decided to stop being lazy and actually checked the directories listed in the paths: anything that starts with "/Applications/...". What I found is that I didn't have "iPhoneOS6.0.sdk" (it's referenced above in the paths) installed.

Changing the script to this worked:

./configure \
--prefix=armv7 \
--disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver \
--enable-avresample --enable-cross-compile \
--sysroot="/applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk" \
--target-os=darwin --cc="/applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" \
--extra-cflags="-arch armv7 -mfpu=neon -miphoneos-version-min=6.0" \
--extra-ldflags="-arch armv7 -isysroot /applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -miphoneos-version-min=6.0" \
--arch=arm --cpu=cortex-a9 --enable-pic 

In short, just double-check your paths. Hope that helps!

u2Fan
  • 1,161
  • 10
  • 15
  • Thanks for Answer. Right now I'm unable to check the code again, because of unavailability of code. But one thing I want to mention, I have tried with every sdk files i.e 6.0, 6.1 and others and I also tried on multiple systems. but still i was unable to do. – iDevAmit Jun 06 '13 at 03:51
  • Let me know if/when you try the above, working (at least for me), build routine. Hopefully, you have success then. Also, did you actually look at your paths, so you could see which SDKs actually exist on your computer? – u2Fan Jun 06 '13 at 13:16