之前都是看别人的,转载别人的,今天终于要自己亲自操刀啦。哎。
废话少说,入正题
我的环境:
xcode 6.1 sdk6.1
真机armv7 和 i386
X264 最新的
ffmpeg 1.2.1
一,x264库的编译
首先到http://www.videolan.org/developers/x264.html下载x264的库,然后解压。
我是在根目录下新建H264目录,解压后的代码放入H264目录。然后打开终端
cd H264 然后
i386 下命令
CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc ./configure --host=i386-apple-darwin --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk --extra-cflags='-arch i386' --extra-ldflags='-arch i386 -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/usr/lib/system -arch i386 ' --disable-asm --enable-shared --enable-static --disable-asm
armv7 下命令
CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc ./configure --host=arm-apple-darwin --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/lib/system' --enable-pic --enable-shared --enable-static --disable-asm
后回车,正常情况是如下:
fatal: Not a git repository (or any of the parent directories): .git
platform: ARM
system: MACOSX
cli: yes
libx264: internal
shared: yes
static: yes
asm: yes
interlaced: yes
avs: avxsynth
lavf: no
ffms: no
gpac: no
gpl: yes
thread: posix
opencl: yes
filters: crop select_every
debug: no
gprof: no
strip: no
PIC: yes
visualize: no
bit depth: 8
chroma format: all<