centos編譯ffmpeg x264,centosffmpegx264
1、安裝彙編編譯器(一般系統內建吧),如果沒有按照下面的命令安裝吧
yum install yasm
2、使用最新x264源碼編譯(只支援編碼)
在x264官網下載最新的代碼http://www.videolan.org/developers/x264.html
git clone git://git.videolan.org/x264.gitcd x264 ./configure --enable-static --enable-shared makemake install
注意--enable-static --enable-shared 後面要加上,否則在編譯ffmpeg的時候會報錯。
make install 應該出現下面的畫面說明安裝成功了。
會在目前的目錄下產生靜態庫libx264.a,動態庫在/usr/local/lib,標頭檔/usr/local/include目錄下。
3、使用最新的ffmpeg源碼編譯
在ffmpeg官網下載最新的代碼https://www.ffmpeg.org/download.html
git clone git://source.ffmpeg.org/ffmpeg.git ffmpegcd ffmpeg#編譯成動態庫 ./configure --enable-shared --disable-static --enable-memalign-hack --enable-libx264 --enable-gpl --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --enable-pthreads #編譯成靜態庫./configure --enable-static --disable-shared --enable-memalign-hack --enable-libx264 --enable-gpl --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --enable-pthreads
參考資料:
1、http://www.helyar.net/2010/how-to-compile-ffmpeg-from-source/
2、https://help.ubuntu.com/community/FFmpeg#Source_Build