CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc ./configure --host=arm-apple-darwin --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk --prefix=/usr/local --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/lib/system' --enable-pic
成功后运行 make 命令
最后需要将对应头文件和静态库文件拷贝到 /usr/local/include和 /usr/local/lib下
配置完x264后再配置ffmpeg
对ffmpeg的配置选项如下:最后链接的地址就是上面x264拷贝的路径
./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile --enable-libx264 --enable-gpl --enable-pthreads --arch=arm --target-os=darwin --cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk --cpu=cortex-a8 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk' --enable-pic --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib
成功后运行 make
编译成功后会在响应文件夹下生成对应库文件
最后可以使用开源范例iFrameExtractor测试,不过此范例中只能测试解码部分。