编译最新版本ffmpeg 提供给CentOS Mono调用

由于工作原因,需要使用ffmpeg在Linux下进行处理音频或视频文件

下面是整个编译过程,这里特把一般步骤写下来,以做个记录。

 

#!/bin/sh
#pathDir="/usr/local/src/ffmpeg"
pathDir=$(cd `dirname $0`; pwd)

yum –y update
yum -y install gcc gcc-c++ bison pkgconfig glib2-devel gettext make libpng-devel libjpeg-devel libtiff-devel libexif-devel giflib-devel libX11-devel freetype-devel fontconfig-devel  cairo-devel

yum install -y automake autoconf make gcc gcc-c++ libtool zlib zlib-devel curl curl-devel alsa-lib alsa-lib-devel gettext gettext-devel expat expat-devel

echo "faac install ..."
sleep 1
cd ${pathDir}/faac/
./bootstrap
./configure --prefix/usr/local/ --enable-shared
make && make install
echo "faac installed"
sleep 1


echo "lame install ..."
sleep 1
cd ${pathDir}/lame-3.98.4/
./configure --prefix=/usr/local/ --enable-shared
make && make install
echo "lame installed"
sleep 1


echo "libogg install ..."
sleep 1
cd ${pathDir}/libogg-1.3.0/
./configure --prefix=/usr/local/ --enable-shared
make && make install
echo "libogg installed"
sleep 1


echo "libtheora install ..."
sleep 1
cd ${pathDir}/libtheora-1.1.1/
./configure --prefix=/usr/local/ --enable-shared
ldconfig -v
make && make install
echo "libtheora installed"
sleep 1


echo "libvorbis install ..."
sleep 1
cd ${pathDir}/libvorbis-1.3.3/
./configure --prefix=/usr/local/ --enable-shared
make && make install
echo "libvorbis installed"
sleep 1



echo "vo-aacenc install ..."
sleep 1
cd ${pathDir}/vo-aacenc-0.1.2/
./configure --prefix=/usr/local/ --enable-shared
make && make install
echo "vo-aacenc installed"
sleep 1


echo "xvidcore install ..."
sleep 1
cd ${pathDir}/xvidcore/build/generic/
./configure --prefix=/usr/local/ --enable-shared
make && make install
echo "xvidcore installed"
sleep 1


echo "yasm install ..."
sleep 1
cd ${pathDir}/yasm-1.2.0/
./configure --prefix=/usr/local/ --enable-shared
make && make install
echo "yasm installed"
sleep 1


echo "x264 install ..."
sleep 1
cd ${pathDir}/x264-snapshot-20130505-2245-stable/
./configure --prefix=/usr/local/ --enable-shared --enable-pic
make 
make install
echo "x264 installed"
sleep 1


echo "libraw1394 install ..."
sleep 1
cd ${pathDir}/libraw1394-2.0.5/
./configure --prefix=/usr/local/ --enable-shared
make && make install
echo "libraw1394 installed"
sleep 1


echo "libdc1394 install ..."
sleep 1
cd ${pathDir}/libdc1394-2.2.1/
./configure --prefix=/usr/local/ --enable-shared
make && make install
echo "libdc1394 installed"
sleep 1


echo "libfreetype install ..."
sleep 1
cd ${pathDir}/libfreetype2-master/
./configure --prefix=/usr/local/ --enable-shared
make && make install
echo "libfreetype installed"
sleep 1


echo "fribidi install ..."
sleep 1
cd ${pathDir}/fribidi-0.19.4/
./configure --prefix=/usr/local/ --enable-shared
make && make install
echo "fribidi installed"
sleep 1


echo "fontconfig install ..."
sleep 1
cd ${pathDir}/fontconfig-2.9.0/
./configure --prefix=/usr/local/ --enable-shared
make && make install
echo "fontconfig installed"
sleep 1


echo "libass install ..."
sleep 1
cd ${pathDir}/libass-0.10.1/
export PKG_CONFIG=/usr/bin/pkg-config
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig 
./configure --prefix=/usr/local/ --enable-shared
make && make install
echo "libass installed"
sleep 1


echo "openssl install ..."
sleep 1
cd ${pathDir}/openssl-1.0.1c/
./config --prefix=/usr/local/ --openssldir=/usr/local/openssl threads zlib-dynamic shared
make && make install
echo "openssl installed"
sleep 1


echo "librtmp install ..."
sleep 1
cd ${pathDir}/rtmpdump-2.3/
make #SYS=posix
make install
echo "librtmp installed"
sleep 1


echo "speex install ..."
sleep 1
cd ${pathDir}/speex-1.2rc1/
./configure --prefix=/usr/local/ --enable-shared --enable-sse
make && make install
echo "speex installed"
sleep 1



echo "twolame install ..."
sleep 1
cd ${pathDir}/twolame-0.3.13/
./configure --prefix=/usr/local/ --enable-shared
make && make install
echo "twolame installed"
sleep 1


echo "ffmpeg install ..."
sleep 2
cd ${pathDir}/ffmpeg-2.6.3/
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
./configure --prefix=/usr/local/ --enable-gpl --enable-version3 --enable-nonfree --enable-shared --enable-zlib --enable-bzlib --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvo-aacenc --enable-libvorbis --enable-libx264 --enable-libxvid --enable-pic --enable-pthreads --enable-libdc1394 --enable-libass --enable-pic --enable-openssl --enable-libtwolame --enable-libspeex --enable-libfreetype 
#./configure --prefix=/usr/local/ --enable-gpl --enable-version3 --enable-nonfree --enable-shared --enable-zlib --enable-bzlib --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvo-aacenc --enable-libvorbis --enable-libx264 --enable-libxvid --enable-pic --enable-pthreads --enable-libdc1394 --enable-libass --enable-pic --enable-openssl --enable-libtwolame --enable-libspeex --enable-librtmp --enable-libfreetype 
make
make install
echo "安装完成"
echo "/usr/local/lib/" >> /etc/ld.so.conf
echo "/usr/local/lib64/" >> /etc/ld.so.conf
echo "/usr/lib64/" >> /etc/ld.so.conf
ldconfig

  

posted @ 2015-09-01 17:15  张永存(Jerry)  阅读(239)  评论(0编辑  收藏  举报