CentOS 6.5安裝部署FFmpge切片環境

來源:互聯網
上載者:User

標籤:解碼器   linux   ffmpeg   

Linux下ffmpeg的安裝


首先要安裝各種解碼器

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    tar xf libogg-1.3.1.tar.gz2    cd libogg-1.3.13    ./configure4    make && 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    tar xf libvorbis-1.3.3.tar.gz 2    cd libvorbis-1.3.33    ./configure 4     make  5     make install


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

1    tar xf xvidcore-1.3.2.tar.gz 2    cd xvidcore-1.3.23    ./configure4    make && 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/
安裝方法如下:

先安裝:yasm,
下載yasm    http://yasm.tortall.net/Download.html

1    tar xf yasm.tar.gz2    cd yasm3    ./configure4    make && make install

latest安裝方法如下:

1    tar xf latest_x264.tar.bz22    cd latest_x2643    ./configure4    make && make install


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

1    ./configure2    make && make install


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

1    ./configure2    make && make install


8、faad2
faad2-2.7.tar.gz
http://www.audiocoding.com/downloads.html
安裝方法

1    ./configure2    make && make install


9、faac
faac-1.28.tar.gz
http://www.audiocoding.com/downloads.html
安裝方法:

1    ./configure2    make && make install

註:在安裝make時會報錯,需做以下處理:
注釋掉faac-1.28/common/mp4v2/mpeg4ip.h 裡的第126行
char *strcasestr(const char *haystack, const char *needle);


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

先安裝patch:

1    yum -y install patch2    tar xf amrnb-11.0.0.0.tar.bz2 3    cd amrnb-11.0.0.04    ./configure5    make && make install


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

1    ./configure2    make && make install


12、最關鍵的一步, 安裝ffmpeg

1   ./configure --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-ffplay2   make  3   make install

在./configure的時候會報錯, 提示說沒有libopencore-amrnb和libopencore-amrwb兩個庫. 我參考了 [2], 使用如下命令安裝它們:

sudo apt-get install libopencore-amrnb-dev libopencore-amrwb-dev

如果./configure的時候加入 --enable-shared, 編譯安裝沒有問題. 但是運行ffmpeg命令就會出錯:

relocation error: /usr/local/lib/libavfilter.so.3: symbol sws_get_class, version LIBSWSCALE_2 not defined in file libswscale.so.2 with link time reference;

這時可以參考 [3], 大意是說跟gstreamer的動態庫衝突了, 要卸載gstreamer. 但是如果卸載了gstreamer我的多媒體軟體多不能用了. 所以我卸載了ffmpeg並重新編譯成靜態庫. 安裝完之後, 運行ffmpeg成功, 輸出如下:

ffmpeg version 2.0.1 Copyright (c) 2000-2013 the FFmpeg developers                                                        built on Oct 25 2013 17:40:51 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)                                                configuration: --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  libavutil      52. 38.100 / 52. 38.100  libavcodec     55. 18.102 / 55. 18.102  libavformat    55. 12.100 / 55. 12.100  libavdevice    55.  3.100 / 55.  3.100  libavfilter     3. 79.101 /  3. 79.101  libswscale      2.  3.100 /  2.  3.100  libswresample   0. 17.102 /  0. 17.102  libpostproc    52.  3.100 / 52.  3.100Hyper fast Audio and Video encoderusage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...


本文出自 “Healer” 部落格,請務必保留此出處http://zlyang.blog.51cto.com/1196234/1709347

CentOS 6.5安裝部署FFmpge切片環境

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.