How can I install latest ffmpeg ios libraries armv7, armv7s, i386 and universal on Mac with 10.8?
-
http://stackoverflow.com/questions/22789827/building-ffmpeg-ios-libraries-for-armv7-armv7s-arm64-i386-and-universal – Tarun Seera Apr 15 '14 at 06:16
-
please refer this post github repository it will help you: https://stackoverflow.com/questions/19341770/ffmpeg-ios-7-library/46245639#46245639 – Prabhat Kasera Sep 15 '17 at 18:37
4 Answers
After a couple of days I have made step by step instructions for this install:
FFmpeg Build Instructions MAC 10.8 or better
Copy ffmpeg-2.0.tar.bz2 (https://ffmpeg.org/releases/ffmpeg-1.0.7.tar.bz2, https://ffmpeg.org/download.html) and Unzip to Documents folder
Make sure you have the latest Command Line Tools under Xcode >; Preferences >; Downloads >; Components
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.
Bug in xcrun starting in version 10.8
open terminal and paste in following command and press enter:
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer/"
cd to ffmpeg-2 folder and paste in following command and press enter:
mkdir armv7
mkdir armv7s
mkdir i386
mkdir -p universal/lib
To config armv7s library paste in following command and press enter:
./configure --prefix=armv7s --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 armv7s -mfpu=neon -miphoneos-version-min=6.1" --extra-ldflags="-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -miphoneos-version-min=6.1" --arch=arm --cpu=cortex-a9 --enable-pic
(Note same rule as above: if config fails go to Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ and make sure that the sdk folder is iPhoneOS6.1.sdk, if not change the config command to reflect iPhoneOSx.x.sdk and change all targets to x.x)
To build and install armv7s library paste in following command and press enter:
make clean && make && make install
To config i386 (so simulator will work ) library paste in following command and press enter:
./configure --prefix=i386 --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc" --extra-cflags="-arch i386" --extra-ldflags="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --arch=i386 --cpu=i386 --enable-pic --disable-asm
(Note: this is not the same command as the previous two config commands, if you just arrow up to them this will fail)
To build and install i386 library paste in following command and press enter:
make clean && make && make install
To make universal library ( which is the library added to xcode ) paste in following command and press enter:
cd armv7/lib
for file in *.a
do
cd ../..
xcrun -sdk iphoneos lipo -output universal/lib/$file -create -arch armv7 armv7/lib/$file -arch armv7s armv7s/lib/$file -arch i386 i386/lib/$file
echo "Universal $file created."
cd -
done
cd ../..

- 15,269
- 2
- 94
- 81

- 331
- 1
- 2
- 9
-
1[Formatting the code](http://stackoverflow.com/editing-help#code) will make this easier to read. You can highlight the text and hit ctrl+k or command+k (I think), or click the code button above the text box which looks like `{}`. – llogan Aug 01 '13 at 20:14
-
-
I tried using the above instructions with ffmpeg2.2 from https://ffmpeg.org/releases/ and gas-preprocessor from here https://github.com/michaelni/gas-preprocessor but, i got only static libs files (can i create an executable from this?) also, i don't see the ffmpeg anywhere...? should I have removed the disable-ffmpeg from the configure? can you elaborate what it means each parameter? if i just want to convert from one audio file format to another? (or merge stereo to mono?) what settings should i use to configure the scripts above? i want the binary output to be as small as possible... – Itay Levin Apr 16 '14 at 06:09
Support universal ffmpeg library for iOS7 and XCode5:
Make sure you have the latest Command Line Tools under Xcode >; Preferences >; Downloads >; Components
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
.

- 5,039
- 36
- 35
-
1
-
Also check that path to directory, from which you run this script do not contains whitespaces – Nikolay Shubenkov Nov 21 '13 at 09:28
-
3I'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.` GCC is apparently depreciated in Xcode5. I'm pretty unsure what to do next. – Joseph Toronto Jan 09 '14 at 00:47
-
1Make sure you have the latest Command Line Tools under Xcode >; Preferences >; Downloads >; Components – Michal Zaborowski Jan 09 '14 at 08:30
-
-
1I am also getting Joseph Toronto issue, and I seem to be using the latest 5.1.1 command line tools. I can choose from 4.x and 5.x – Sasho Jun 04 '14 at 14:53
I needed arm64 support and this script worked for me: https://github.com/kewlbear/FFmpeg-iOS-build-script
Use
./build-ffmpeg.sh arm64 x86_64
for iOS 64-bit and simulator architecture. Then copy the contents in the "fat" directory into your Xcode project.
The only modification I made to the script was uncommenting this line:
CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-avresample"
to compile the libavresample library.
Edit: It's not working with armv7 and armv7s however, using iOS 7.1 SDK. If I find a solution I'll post here.

- 954
- 13
- 29
-
shouldn't you just add to the command line script the armv7 and armv7s? – Itay Levin Apr 16 '14 at 06:05
For building ffmpeg iOS libraries you can use this little scripts.
- Download ffmpeg source
- Download https://github.com/wang-bin/build_ffmpeg
- Open terminal and run
export FFSRC=/path/to/ffmpeg
- Goto
build_ffmpeg
folder and run:./ios.sh
- After successful building, result will be in
sdk-ios
folder - Add include folder and lib folder in your Xcode project

- 5,013
- 7
- 44
- 59