环境: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