第一步:下载libx264
git clone https://code.videolan.org/videolan/x264.git libx264
第二步:安装nasm2.13.03
wget http://www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.xz
xz -d nasm-2.13.03.tar.xz
tar -xvf nasm-2.13.03.tar
cd nasm-2.13.03
./configure --prefix=/usr
make
make install
第三步:安装libx264
apt-get install libx264-dev
./configure --enable-static --enable-shared
make
make install
打开/etc/ld.so.conf
添加/usr/local/lib
运行
ldconfig
第四步:安装ffmpeg
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libx264 --enable-shared
make
make install
打开 /etc/ld.so.conf
加入/usr/local/ffmpeg/lib
更新环境变量ldconfig
打开/etc/profile
加入export PATH="/usr/local/ffmpeg/bin:$PATH"
运行
source /etc/profile