iOS平台编译FFmpeg最新版

记录以下编译iOS平台ffmepg的脚本
首先需要编译x264编码器,脚本如下:

#!/bin/sh
CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang ./configure --host=arm-apple-darwin --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64 -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk/usr/lib/system' --disable-asm --enable-pic --enable-shared --enable-static --prefix=/Users/lee/Desktop/x264/arm64out

然后编译ffmpeg ,我编译的时候ffmpeg版本为2.7.2
脚本如下:

#!/bin/sh
./configure --enable-libx264 --enable-gpl --extra-cflags=-I/Users/lee/Desktop/x264/arm64out/include --extra-ldflags=-L/Users/lee/Desktop/x264/arm64out/lib --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-avfilter --disable-debug --disable-decoders --enable-cross-compile --disable-encoders --disable-armv5te  --enable-libx264 --enable-encoder=libx264 --enable-pic --cc=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang --as='gas-preprocessor/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang' --extra-ldflags='-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk' --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk --target-os=darwin --arch=arm64 --extra-cflags='-arch arm64' --disable-asm --prefix=/Users/lee/Desktop/ffmpeg-2.7.2/arm64out

然后就是make make install etc..

你可能感兴趣的:(多媒体开发,ios,ffmpeg,编码)