IOS系统配置FFMEPG

在FFMPEG的官网上可以找到标准的配置文档...http://ffmpeg.org/trac/ffmpeg/wiki/MacOSXCompilationGuide

在开始前确保安装了XCODE而且也将Components中的CommandLine Tools安装了

1、安装Homebrew.

  通过在命令终端执行以下命令行即可

ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)

  HomeBrew的作用有点类似linux的apt-get,可以通过命令的形式下载其他依赖项的安装包并安装

2、安装FFMPEG需要的依赖项

  通过在命令终端分别执行以下命令

brew install automake celt faac fdk-aac git lame libass libtool libvorbis libvpx 
libvo-aacenc opencore-amr openjpeg opus sdl schroedinger shtool speex texi2html 
theora wget x264 xvid yasm

    上面安装需要点时间,接着安装libaacplus..

wget http://217.20.164.161/~tipok/aacplus/libaacplus-2.0.2.tar.gz
tar xzf libaacplus-2.0.2.tar.gz
cd libaacplus-2.0.2
# libtool on osx is quite different from the gnu libtool, which is called glibtool on osx
sed -i '.bck' -e 's/libtool/glibtool/' autogen.sh
./autogen.sh
make && make install
cd ..

   这里有错误的可以看下原文。。。貌似新版本的autoconf需要修改configure.ac

3、上面都没问题就可以开始准备安装FFMEPG

  1)  先下载gas-preprocessor.pl  并且cp到/usr/sbin/目录下

    然后给下权限

 sudo chmod 777 gas-preprocessor.pl

    2)  下载最新ffmpeg并安装

    同样在命令终端执行以下命令

git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg

   然后cd到ffmpeg目录下,执行下面安装指令,PS:这里是相对于arm7架构安装指令....

./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile --arch=arm --target-os=darwin --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='gas-preprocessor/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk --cpu=cortex-a8 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk' --enable-pic --enable-decoder=rawvideo --disable-asm
make clean && make && make install

   这里我加上了make clean可以避免之前安装失败残留的问题。。。

原文地址:https://www.cnblogs.com/stratrail/p/3208972.html