首先要安裝各種解碼器
1、lame
lame-3.99.5.tar.gz
Url:http://sourceforge.net/project/showfiles.php?group_id=290&package_id=309
wget http://sourceforge.net/projects/lame/files/latest/download?source=files
tar -zxvf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure --enable-shared
make
make install
cd ../
2、libogg
libogg-1.3.1.tar.gz
Url:http://www.xiph.org/downloads/
wget http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz
tar -zxvf libogg-1.3.2.tar.gz
cd libogg-1.3.2
./configure
make
make install
cd ../
3、libvorbis
libvorbis-1.3.4.tar.gz
Url:http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gz
(libvorbis依賴於libogg, 所以libogg必須先於libvorbis安裝)
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gz
tar -zxvf libvorbis-1.3.4.tar.gz
cd libvorbis-1.3.4
./configure
make
make install
cd ../
4、xvid
xvidcore-1.3.2.tar.gz
Url:http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz
wget http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz
tar -zxvf xvidcore-1.3.2.tar.gz
cd xvidcore
cd build/generic/
./configure
make
make install
cd ../../../
5、x264
latest_x264.tar.bz2 (其中包含的目錄是 x264-snapshot-20141218-2245)
Url:http://www.videolan.org/developers/x264.html
wget ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
tar -jxvf last_x264.tar.bz2
cd x264-snapshot-20141218-2245/
./configure
出現如下的報錯,
Found no assembler
Minimum version is yasm-1.2.0
If you really want to compile without asm, configure with --disable-asm.
這個時候需要先安裝yasm
cd ../
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar -zxvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure
make
make install
cd ../
cd x264-snapshot-20141218-2245/
./configure
make
make install
cd ../
6、libdts
libdca-0.0.5.tar.bz2
Url: http://www.videolan.org/developers/libdca.html
wget http://download.videolan.org/pub/videolan/libdca/0.0.5/libdca-0.0.5.tar.bz2
tar -jxvf libdca-0.0.5.tar.bz2
cd libdca-0.0.5
./configure
make
make install
cd ../
7、a52
a52dec-0.7.4.tar.gz (這個庫從2002年就沒有更新過了)
http://liba52.sourceforge.net/downloads.html
wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz (這個需要翻牆才能下載)
現在的做法是,通過chrome瀏覽器下載后,再rz到服務上:
瀏覽器下載的地址為:http://liba52.sourceforge.net/downloads.html
tar -zxvf a52dec-0.7.4.tar.gz
cd a52dec-0.7.4
./configure
make
make install
cd ../
8、faad2
faad2-2.7.tar.gz (要選擇這個擴展名的文件)
http://www.audiocoding.com/downloads.html
wget http://downloads.sourceforge.net/faac/faad2-2.7.tar.gz
tar -zxvf faad2-2.7.tar.gz
cd faad2-2.7
autoreconf -vif
出現這樣的錯誤
[root@Csss faad2-2.7]# autoreconf -vif
autoreconf: Entering directory `.'
autoreconf: configure.in: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.in: tracing
autoreconf: configure.in: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
configure.in:14: error: possibly undefined macro: AC_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
出現這樣的錯誤,解決辦法:
yum install libtool
繼續安裝:
autoreconf -vif
./configure --with-mp4v2 --enable-shared
出現了如下的錯誤:
configure: WARNING: unrecognized options: --with-mp4v2
解決辦法,通過./configure --help 查看並沒有--with-mp4v2 這個編譯參數,找到一個類似的--with-mpeg4ip;
./configure --with-mpeg4ip --enable-shared (編譯成功)
make
make install
cd ../
9、faac
faac-1.28.tar.gz (要選擇這個擴展名的文件)
http://www.audiocoding.com/downloads.html
wget http://downloads.sourceforge.net/faac/faac-1.28.tar.gz
tar zxvf faac-1.28.tar.gz
cd faac-1.28
./bootstrap
./configure
make
make install
安裝出現如下的錯誤:
make[2]: Leaving directory /software/faac-1.28/libfaac' Making all in common make[2]: Entering directory
/software/faac-1.28/common'
Making all in mp4v2
make[3]: Entering directory /software/faac-1.28/common/mp4v2' g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -Wall -g -O2 -MT 3gp.o -MD -MP -MF .deps/3gp.Tpo -c -o 3gp.o 3gp.cpp In file included from mp4common.h:29, from 3gp.cpp:28: mpeg4ip.h:126: error: new declaration ‘char* strcasestr(const char*, const char*)’ /usr/include/string.h:369: error: ambiguates old declaration ‘const char* strcasestr(const char*, const char*)’ make[3]: *** [3gp.o] Error 1 make[3]: Leaving directory
/software/faac-1.28/common/mp4v2'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory /software/faac-1.28/common' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory
/software/faac-1.28'
make: *** [all] Error 2
根據提示信息,解決辦法是:
vim /software/faac-1.28/common/mp4v2/mpeg4ip.h 126刪除掉
然后再執行如下的命令:
make clean
make
make install
cd ../
10、amr-nb
amrnb-10.0.0.0.tar.bz2
http://ftp.penguin.cz/pub/users/utx/amr/ ( 該鏈接已經forbidden 了 )
重新找了一個連接,需要翻牆才可以下載;
https://code.google.com/p/ostube/downloads/detail?name=amrnb-10.0.0.0.tar.bz2&can=2&q=amrnb
我是通過瀏覽器下載,然后再傳到服務器上;
tar -jxvf amrnb-10.0.0.0.tar.bz2
cd amrnb-10.0.0.0
./configure
make
出現報錯,連接服務器進行下載26104-a00.zip;顯示連接不上服務器,還是需要用瀏覽器下載,然后傳到服務器上;
26104-a00.zip
下載地址為 https://code.google.com/p/ostube/downloads/detail?name=26104-a00.zip&can=2&q=26104-a00.zip
下載完成之后,將此壓縮包放到跟make同一級的目錄中
繼續安裝:
make
make install
cd ../
11、amr-wb
https://code.google.com/p/ostube/downloads/detail?name=amrwb-10.0.0.0.tar.bz2&can=2&q=amrwb (該地址可以下載)
tar -jxvf amrwb-10.0.0.0.tar.bz2
cd amrwb-10.0.0.0
./configure
make
make出現如下的報錯:
make ./26204-a00_ANSI-C_source_code.zip
make[1]: Entering directory `/software/amrwb-10.0.0.0'
cd . && /usr/bin/wget -N http://ostube.googlecode.com/files/26204-a00.zip
--2015-02-08 20:44:09-- http://ostube.googlecode.com/files/26204-a00.zip
Resolving ostube.googlecode.com... 74.125.203.82, 2404:6800:4008:c07::52
Connecting to ostube.googlecode.com|74.125.203.82|:80... ^Cmake[1]: *** [26204-a00.zip] Interrupt
make: *** [readme.txt] Interrupt
根據報錯信息,解決辦法:
https://code.google.com/p/ostube/downloads/detail?name=26204-a00.zip&can=2&q=26204-a00.zip 通過這個地址下載26204-a00.zip壓縮包傳到跟make同一級目錄;
繼續安裝
make
make install
cd ../
12、最后一步,安裝ffmpeg
wget http://www.ffmpeg.org/releases/ffmpeg-2.5.3.tar.gz
./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
編譯這條語句出錯,去掉三個參數,可以成功編譯;
./configure --enable-shared --prefix=/usr/local/ffmpeg2 --enable-libmp3lame --enable-libvorbis --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-ffserver --enable-ffplay
才可以編譯通過
make
make install
測試報錯:
[root@C21318 ffmpeg-2.5.3]# /usr/local/ffmpeg2/bin/ffmpeg --help
/usr/local/ffmpeg2/bin/ffmpeg: error while loading shared libraries: libavdevice.so.56: cannot open shared object file: No such file or directory