關於ffmpeg的安裝詳細步驟和說明

來源:互聯網
上載者:User

關於ffmpeg的安裝詳細步驟和說明

一、windows安裝:

直接:

https://ffmpeg.zeranoe.com/builds/

https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-20160316-git-d0a9114-win64-static.7z

解壓後即可使用:


ffmpeg -i C:\ffmpeg\test.avi -b:v 640k c:\ffmpeg\output.ts


二、linux源碼安裝:

如下:

下載 源碼包:ffmpeg-2.8.6.tar.bz2

1.從網路上下載到的源碼包,然後解壓到指目錄


假設下載目錄 /opt/soft

cd /opt/soft

解壓包:

tar -jxvf ffmpeg-2.8.6.tar.bz2

進入解壓後目錄

cd ffmpeg-2.8.6

執行

./configure --enable-shared --prefix=/usr/local/ffmpeg

提示出錯:

yasm/nasm not found or too old. Use --disable-yasm for a crippled build.

If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solve the problem.


按照提示需要安裝yasm

使用如下
yum install yasm


安裝完成後,繼續執行

./configure --enable-shared --prefix=/usr/local/ffmpeg


時間比較長,需要等待幾分鐘

然後執行下面

make

make install

時間比較長,需要等待幾分鐘

執行過程沒有報錯,則成功安裝

檢查是否安裝成功:


/usr/local/ffmpeg/bin/ffmpeg --version

報錯如下:

/usr/local/ffmpeg/bin/ffmpeg: error while loading shared libraries: libavdevice.so.56: cannot open shared object file: No such file or directory


提示庫檔案找不到。

修改檔案/etc/ld.so.conf 內容增加/usr/local/ffmpeg/lib/

vim /etc/ld.so.conf



include ld.so.conf.d/*.conf
/usr/local/ffmpeg/lib/


使修改生效

ldconfig


執行 /usr/local/ffmpeg/bin/ffmpeg --version

則返回


配置環境變數 path

export PATH=/usr/local/ffmpeg/bin/:$PATH

env

則在任何目錄都可以執行 ffmpeg --version


測試執行轉碼:

ffmpeg -i test.avi -b:v 640k output.ts

聯繫我們

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