首先要安装各种解码器

1、lame
lame-3.99.5.tar.gz?
Url:http://sourceforge.net/project/showfiles.php?group_id=290&package_id=309
安装方法如下:

<span style="color: #008080;line-height: 1.5 !important">1</span>     tar -zxvf lame-<span style="color: #800080;line-height: 1.5 !important">3.99.5</span><span style="color: #000000;line-height: 1.5 !important">.tar.gz  
</span><span style="color: #008080;line-height: 1.5 !important">2</span>     cd lame-<span style="color: #800080;line-height: 1.5 !important">3.99.5</span>  
<span style="color: #008080;line-height: 1.5 !important">3</span>     ./configure --enable-shared
<span style="color: #008080;line-height: 1.5 !important">4</span> <span style="color: #000000;line-height: 1.5 !important">    make  
</span><span style="color: #008080;line-height: 1.5 !important">5</span>     make install

2、libogg
libogg-1.3.1.tar.gz
Url:http://www.xiph.org/downloads/?
安装方法如下:

<span style="color: #008080;line-height: 1.5 !important">1</span>     ./configure
<span style="color: #008080;line-height: 1.5 !important">2</span> <span style="color: #000000;line-height: 1.5 !important">    make  
</span><span style="color: #008080;line-height: 1.5 !important">3</span>     make install

3、libvorbis
libvorbis-1.3.3.tar.gz
Url:http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz

(libvorbis依赖于libogg, 所以libogg必须先于libvorbis安装)
安装方法如下:

<span style="color: #008080;line-height: 1.5 !important">1</span>     ./configure
<span style="color: #008080;line-height: 1.5 !important">2</span> <span style="color: #000000;line-height: 1.5 !important">    make  
</span><span style="color: #008080;line-height: 1.5 !important">3</span>     make install

4、xvid
xvidcore-1.3.2.tar.gz
Url:http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz
安装方法如下:

1     tar zvxf xvidcore-1.3.2.tar.gz  
2     cd xvidcore-1.3.2/build/generic  
3     ./configure<span style="color: #008080;line-height: 1.5 !important">4</span> <span style="color: #000000;line-height: 1.5 !important">    make  
</span><span style="color: #008080;line-height: 1.5 !important">5</span>     make install

5、x264
latest_x264.tar.bz2 (其中包含的目录是 x264-snapshot-20131023-2245)
Url:http://www.videolan.org/developers/x264.html
ftp://ftp.videolan.org/pub/videolan/x264/snapshots/
安装方法如下:

1
2
3
4
1
tar -jxvf latest_x264.tar.bz2
2
./configure?
3
make?
4
make install?

补充如果遇到yasm错误需要安装yasm如下

?# cd /usr/local/src/video
# wget?http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
# tar xzvf yasm-0.7.1.tar.gz
# cd yasm-0.7.1
# ./configure –prefix=/usr/local/yasm
# make && make install

6、libdts
libdca-0.0.5.tar.bz2
Url:?http://www.videolan.org/developers/libdca.html
安装方法:

<span style="color: #008080;line-height: 1.5 !important">1</span>     tar -jxvf <span style="color: #000000;line-height: 1.5 !important">libdca-0.0.5.tar.bz2 
</span><span style="color: #008080;line-height: 1.5 !important">2</span>     cd libdca-<span style="color: #800080;line-height: 1.5 !important">0.0</span>.<span style="color: #800080;line-height: 1.5 !important">5</span>  
<span style="color: #008080;line-height: 1.5 !important">3</span>     ./configure
<span style="color: #008080;line-height: 1.5 !important">4</span> <span style="color: #000000;line-height: 1.5 !important">    make  
</span><span style="color: #008080;line-height: 1.5 !important">5</span>     make install

7、a52
a52dec-0.7.4.tar.gz?????????? (这个库从2002年就没有更新过了)
http://liba52.sourceforge.net/downloads.html
安装方法:

<span style="color: #008080;line-height: 1.5 !important">1</span>     ./configure
<span style="color: #008080;line-height: 1.5 !important">2</span> <span style="color: #000000;line-height: 1.5 !important">    make  
</span><span style="color: #008080;line-height: 1.5 !important">3</span>     make install

8、faad2
faad2-2.7.tar.gz?(要选择这个扩展名的文件)
http://www.audiocoding.com/downloads.html
安装方法

<span style="color: #008080;line-height: 1.5 !important">1</span>     autoreconf -<span style="color: #000000;line-height: 1.5 !important">vif  
</span><span style="color: #008080;line-height: 1.5 !important">2</span>     ./configure  --with-mp4v2 --enable-<span style="color: #000000;line-height: 1.5 !important">shared  
</span><span style="color: #008080;line-height: 1.5 !important">3</span> <span style="color: #000000;line-height: 1.5 !important">    make  
</span><span style="color: #008080;line-height: 1.5 !important">4</span>     make install

9、faac
faac-1.28.tar.gz??(要选择这个扩展名的文件)
http://www.audiocoding.com/downloads.html
安装方法:

<span style="color: #008080;line-height: 1.5 !important">1</span>     tar zxvf faac-<span style="color: #800080;line-height: 1.5 !important">1.28</span><span style="color: #000000;line-height: 1.5 !important">.tar.gz  
</span><span style="color: #008080;line-height: 1.5 !important">2</span> <span style="color: #000000;line-height: 1.5 !important">    cd faac-1.28  
</span><span style="color: #008080;line-height: 1.5 !important">3</span>     ./<span style="color: #000000;line-height: 1.5 !important">bootstrap  
</span><span style="color: #008080;line-height: 1.5 !important">4</span>     ./configure
<span style="color: #008080;line-height: 1.5 !important">5</span> <span style="color: #000000;line-height: 1.5 !important">    make   
</span><span style="color: #008080;line-height: 1.5 !important">6</span>     make install

10、amr-nb
amrnb-10.0.0.0.tar.bz2
http://ftp.penguin.cz/pub/users/utx/amr/?( 从此处下载最新版本 )
安装方法:

<span style="color: #008080;line-height: 1.5 !important">1</span>     ./configure
<span style="color: #008080;line-height: 1.5 !important">2</span> <span style="color: #000000;line-height: 1.5 !important">    make  
</span><span style="color: #008080;line-height: 1.5 !important">3</span>     make install

11、amr-wb
amrwb-7.0.0.1.tar.bz2
http://ftp.penguin.cz/pub/users/utx/amr/?( 从此处下载最新版本 )
安装方法:

<span style="color: #008080;line-height: 1.5 !important">1</span>     ./configure
<span style="color: #008080;line-height: 1.5 !important">2</span> <span style="color: #000000;line-height: 1.5 !important">    make  
</span><span style="color: #008080;line-height: 1.5 !important">3</span>     make install

12、最关键的一步, 安装ffmpeg


1
2
3
1
./configure --enable-shared --prefix=/usr/local/ffmpeg2 --enable-libmp3lame --enable-libvorbis --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libxvid
--enable-postproc --enable-ffserver --enable-ffplay
2
make?
3
make install
后来又折腾一遍然后遇到了新的问题:“error while loading shared libraries: xxx.so.x
解决方案见:http://blog.csdn.net/sahusoft/article/details/7388617
?
安装完成后会在/usr/local/ffmpeg2中出现 bin、include、share、lib目录,验证ffmpeg是否安装成功,/usr/local/ffmpeg2/bin/ffmpeg –help ?(注意这里是绝对路径)
因为$PATH中没有添加/usr/local/ffmpeg2/bin 这个路径,永久添加方法:
#vim /etc/profile
在适当位置添加PATH=$PATH:/usr/local/ffmpeg2/bin
编辑结束后在/etc目录下执行source profile即可生效

其他类似错误用同样的方法解决,之后就成功啦!^_^解决方法:ln -s /usr/local/lib/libx264.so.142 /usr/lib/libx264.so.142我的当时报了错:ffmpeg:error while loading shared libraries:libx264.so.142 cannot open shared object file:No such file or director
结果如下图:

linux