linux 下安裝 ffmpeg

Linux下ffmpeg的完整安裝  http://www.cnblogs.com/wanghetao/p/3386311.html

首先要安裝各種解碼器 


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

1     tar -zxvf lame-3.99.5.tar.gz  
2     cd lame-3.99.5  
3     ./configure --enable-shared 
4     make  
5     make install  

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

1     ./configure 
2     make  
3     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安裝)
安裝方法如下:

1     ./configure 
2     make  
3     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     ./configure4     make  
5     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
安裝方法:

1     tar -jxvf libdca-0.0.5.tar.bz2 
2     cd libdca-0.0.5  
3     ./configure 
4     make  
5     make install  

7、a52 
a52dec-0.7.4.tar.gz           (這個庫從2002年就沒有更新過了)
http://liba52.sourceforge.net/downloads.html       
安裝方法:

1     ./configure 
2     make  
3     make install  

8、faad2 
faad2-2.7.tar.gz (要選擇這個擴展名的文件)
http://www.audiocoding.com/downloads.html 
安裝方法

1     autoreconf -vif  
2     ./configure  --with-mp4v2 --enable-shared  
3     make  
4     make install  

9、faac 
faac-1.28.tar.gz  (要選擇這個擴展名的文件)
http://www.audiocoding.com/downloads.html
安裝方法:

1     tar zxvf faac-1.28.tar.gz  
2     cd faac-1.28  
3     ./bootstrap  
4     ./configure 
5     make   
6     make install  

10、amr-nb 
amrnb-10.0.0.0.tar.bz2 
http://ftp.penguin.cz/pub/users/utx/amr/ ( 從此處下載最新版本 )
安裝方法:

1     ./configure 
2     make  
3     make install  

11、amr-wb 
amrwb-7.0.0.1.tar.bz2 
http://ftp.penguin.cz/pub/users/utx/amr/ ( 從此處下載最新版本 )
安裝方法:

1     ./configure 
2     make  
3     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
結果如下圖:



轉載:http://blog.csdn.net/lifreshman/article/details/18737793
發佈了24 篇原創文章 · 獲贊 23 · 訪問量 29萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章