環境:CentOS6.2_64
1、下載源碼包
wget ftp://ftp.videolan.org/pub/x264/snapshots/x264-snapshot-20120718-2245-stable.tar.bz2
解壓:tar jxvf x264-snapshot-20120718-2245-stable.tar.bz2
wget http://ffmpeg.org/releases/ffmpeg-0.11.1.tar.gz
解壓:tar zxvf ffmpeg-0.11.1.tar.gz
2、安裝x264
2.1 安裝依賴包
缺少yasm
安裝:yum install yasm -y
2.2 安裝x264
./configure --prefix=/usr --enable-shared && make && make install
重新加載配置:ldconfig
3、安裝ffmpeg
ffplay必須依賴於sdl庫
yum install SDL -y
安裝:
./configure --enable-libx264 --enable-gpl && make && make install
附(自動安裝腳本):
#! /bin/bash echo "Install yasm ..." yum install yasm SDL* gtk+* -y echo "Install libx264 ..." wget ftp://ftp.videolan.org/pub/x264/snapshots/x264-snapshot-20120718-2245-stable.tar.bz2 tar jxvf x264-snapshot-20120718-2245-stable.tar.bz2 cd x264-snapshot-20120718-2245-stable ./configure --enable-shared && make && make install ldconfig echo "Install ffmpeg ..." cd .. wget http://ffmpeg.org/releases/ffmpeg-0.11.1.tar.gz tar zxvf ffmpeg-0.11.1.tar.gz cd ffmpeg-0.11.1 ./configure --enable-libx264 --enable-gpl && make && make install