Centos linux 安裝ffmpeg

來源:互聯網
上載者:User

標籤:

1、下載ffmpeg。
下載網址:http://www.ffmpeg.org/download.html

2、解壓縮
tar -zxvf ffmpeg-2.0.1.tar.gz

3、配置,產生Makefile
./configure --enable-shared --disable-yasm --prefix=/usr/local/ffmpeg
如果執行結果不對,可以根據提示資訊,並查看協助,解決問題
./configure --help

4、編譯安裝
make
make install

5、安裝之後在/usr/local/ffmpeg會看到有三個目錄
bin 執行檔案目錄
lib 靜態,動態連結程式庫目錄
include 編程用到的標頭檔

為了防止執行程式找不到庫檔案,
可以將/usr/local/ffmpeg/lib目錄設定到LD_LIBRARY_PATH環境變數,
或者查看/usr/local/ffmpeg/lib下所有的連結,並在/usr/lib下建立同樣的連結。如下。
ln -s /usr/local/ffmpeg/lib/libavcodec.so /usr/lib/libavcodec.so
ln -s /usr/local/ffmpeg/lib/libavdevice.so /usr/lib/libavdevice.so
ln -s /usr/local/ffmpeg/lib/libavfilter.so /usr/lib/libavfilter.so
ln -s /usr/local/ffmpeg/lib/libavformat.so /usr/lib/libavformat.so
ln -s /usr/local/ffmpeg/lib/libavutil.so /usr/lib/libavutil.so
ln -s /usr/local/ffmpeg/lib/libswresample.so /usr/lib/libswresample.so
ln -s /usr/local/ffmpeg/lib/libswscale.so /usr/lib/libswscale.so

ln -s /usr/local/ffmpeg/lib/libavcodec.so /usr/lib/libavcodec.so.55
ln -s /usr/local/ffmpeg/lib/libavdevice.so /usr/lib/libavdevice.so.55
ln -s /usr/local/ffmpeg/lib/libavfilter.so /usr/lib/libavfilter.so.3
ln -s /usr/local/ffmpeg/lib/libavformat.so /usr/lib/libavformat.so.55
ln -s /usr/local/ffmpeg/lib/libavutil.so /usr/lib/libavutil.so.52
ln -s /usr/local/ffmpeg/lib/libswresample.so /usr/lib/libswresample.so.0
ln -s /usr/local/ffmpeg/lib/libswscale.so /usr/lib/libswscale.so.2

6、編譯測試程式
gcc -o ffmpegtest ffmpegtest.c -I/usr/local/ffmpeg/include -L/usr/local/ffmpeg/lib -lavformat -lavcodec -lavtuil

7、執行程式
./ffmpegtest
或直接執行/usr/local/ffmpeg/lib目錄下的./ffmpeg進行測試。

Centos linux 安裝ffmpeg

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.