1. 程式人生 > >centos7下視訊解碼播放環境搭建(ffmpeg等庫編譯)

centos7下視訊解碼播放環境搭建(ffmpeg等庫編譯)

1.軟體環境

作業系統環境:centos7

ffmpeg原始碼: github上的master版本(當前官網的3.4.1版本有bug,在主幹中修復了'x264_bit_depth' undeclared

2.編譯與安裝

設定環境變數:(可以在/root/.bashrc指令碼中設定,重啟有效)
export PATH="$PATH:/usr/local/bin:/usr/local/yasm/bin:/usr/local/SDL/bin:/usr/local/x264/bin"
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export C_INCLUDE_PATH="$C_INCLUDE_PATH:/usr/local/SDL/include/SDL:/usr/local/x264/include"
export LD_LIBRARY_PATH="/usr/local/lib

:/usr/local/SDL/lib:/usr/local/x264/lib:$LD_LIBRARY_PATH"

2.1 yasm安裝

./configure --prefix=/usr/local/yasm
make
make install

2.2 SDL安裝

./configure --prefix=/usr/local/SDL
make
make install

2.3 x264安裝

./configure --enable-shared --disable-asm --prefix=/usr/local/x264 
make 
make install

2.4 ffmpeg安裝

./configure --enable-shared --disable-static --enable-libx264 --enable-gpl --prefix=/usr/local/ffmpeg-master
make
make install

3.安裝好的庫lib和標頭檔案路徑include

/usr/local/yasm

/usr/local/x264

/usr/local/SDL

/usr/local/ffmpeg-master

4. 補充.幾個解碼庫路徑:

xvid  http://downloads.xvid.org/downloads/xvidcore-1.1.3.tar.gz 
mp3  http://lame.sourceforge.net/index.php 
Ogg  http://download.savannah.nongnu.org/releases/liboggpp/packages/
AC3  http://sourceforge.net/projects/ac3filter/ 
mpg4  http://sourceforge.net/projects/mpg/ 
3gp  http://www.3gpp.org/ftp/Specs 
VC1  http://neuron2.net/dgdecnv/dgdecnv.html