准备文件:
ffmpeg源码
https://www.ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
x264
git clone git://git.videolan.org/x264.git
yasm
http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
编译安装过程:
1、安装yasm
tar zxvf yasm-1.3.0.tar.gzcd yasm-1.3.0./configuremakemake installyasm --version
2、编译安装x264
cd x264./configure --enable-shared --enable-pthread --enable-picmakemake install
3、编译ffmpeg
1. cd ffmpeg2. ./configure --enable-libx264 --enable-gpl --enable-shared --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --enable-pic3. make4. make install5.
安装好ffmpeg运行时如果提示
ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory
则需要修改文件:/etc/ld.so.conf
在文件尾添加一行:
/usr/local/lib
然后执行命令:
ldconfig
重新运行ffmpeg -encoders | grep x264会发现安装成功
