- 首先安裝系統(tǒng)編譯環(huán)境
yum install -y automake autoconf libtool gcc gcc-c++
- 編譯所需源碼包
yasm:匯編器幽告,新版本的ffmpeg增加了匯編代碼
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar -xzvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure
make
make install
lame:Mp3音頻解碼
wget http://jaist.dl.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar -xzvf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure
make
make install
amr支持
wget http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.3.tar.gz
tar -xzvf opencore-amr-0.1.3.tar.gz
cd opencore-amr-0.1.3
./configure
make
make install
amrnb支持
wget http://www.penguin.cz/~utx/ftp/amr/amrnb-11.0.0.0.tar.bz2
tar -xjvf amrnb-11.0.0.0.tar.bz2
cd amrnb-11.0.0.0
./configure
make
make install
amrwb支持
wget http://www.penguin.cz/~utx/ftp/amr/amrwb-11.0.0.0.tar.bz2
tar -xjvf amrwb-11.0.0.0.tar.bz2
cd amrwb-11.0.0.0
./configure
make
make install
ffmpeg
wget http://ffmpeg.org/releases/ffmpeg-2.5.3.tar.bz2
tar -xjvf ffmpeg-2.5.3.tar.bz2
cd ffmpeg-2.5.3
./configure --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-shared
make
make install
3.加載配置
在/etc/ld.so.conf文件末尾加上:/usr/local/lib
[root@localhost aaa]# more /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib
執(zhí)行命令:
ldconfig
4.使用方法
ffmpeg -i 1.mp3 -ac 1 -ar 8000 1.amr #MP3轉(zhuǎn)換AMR
ffmpeg -i 1.amr 1.mp3 #AMR轉(zhuǎn)換MP3