先申明本机环境html
dev-mini:ffmpeg devone$ sw_vers
ProductName: Mac OS X
ProductVersion:
10.9.
2
BuildVersion: 13C1021
dev-mini:ffmpeg devone$ xcodebuild -version
Xcode
5.1.
1
Build version 5B1008
## IOS7.
1
http:
//
ffmpeg.org/releases/ffmpeg-2.2.2.tar.bz2
sudo
wget http:
//
ffmpeg.org/releases/ffmpeg-2.2.2.tar.bz2
sudo
wget https:
//
github.com/yuvi/gas-preprocessor/blob/master/gas-preprocessor.pl
sudo
cp gas-preprocessor.pl /usr/bin/
sudo
chmod a+rwx /usr/bin/gas-preprocessor.pl
Xcode path
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/c++
参考编译选项
http://www.cnblogs.com/gugupluto/p/3404512.html 特此感谢
## 这里是模拟器I386版本编译
## 完美经过git
sudo ./configure --prefix=../i386 --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-mmx --enable-cross-compile --sysroot=
"
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk
" --target-os=darwin --
cc=
"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
" --extra-cflags=
"
-arch i386 -mfpu=neon -miphoneos-version-min=7.0
" --extra-ldflags=
"
-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk -miphoneos-version-min=7.0
" --arch=i386 --cpu=i386 --disable-asm --disable-everything --enable-decoder=h264 --enable-decoder=rv40 --enable-decoder=aac
sudo make
sudo make installgithub
## 编译ffmpeg armv7(iPhone 3GS以上)
## 完美经过xcode
sudo ./configure --prefix=../armv7 --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-cross-compile --sysroot=
"
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk
" --target-os=darwin --
cc=
"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
" --extra-cflags=
"
-arch armv7
" --extra-ldflags=
"
-arch armv7
" --extra-ldflags=-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.
1.sdk/usr/lib/system --arch=arm --cpu=cortex-a8 --enable-pic --disable-asm --disable-everything --enable-decoder=h264 --enable-decoder=rv40 --enable-decoder=aac
## 编译ffmpeg armv7s(iPhone5)
## 完美经过app
sudo ./configure --prefix=../armv7s --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-cross-compile --sysroot=
"
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk
" --target-os=darwin --
cc=
"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
" --extra-cflags=
"
-arch armv7s -mfpu=neon -miphoneos-version-min=7.0
" --extra-ldflags=
"
-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -miphoneos-version-min=7.0
" --arch=arm --cpu=cortex-a9 --enable-pic --disable-asm --disable-everything --enable-decoder=h264 --enable-decoder=rv40 --enable-decoder=aac
## 说明
1. 之前须要gas-preprocessor.pl这个文件,但通过测试,在XCode4环境下是须要的,XCode5环境下已经不须要了。
2. /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc 这里cc c++ clang++ 都是clang的软链接
3. 多了一个-miphoneos-version-min=7.0,没有这个字段会出错:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc is unable to create an executable file.
C compiler test failed.
仅仅是针对I386模拟器版本编译参数 --extra-ldflags 后面的那个-miphoneos-version-min=7.0。其余版本不须要。iphone
## to do
## 参数优化
## http://blog.csdn.net/whf727/article/details/18089261测试