先安装yasm:

解压yasm-1.3.0.tar.gz

cd yasm-1.3.0/

./configure

make && make install

安装x264

解压last_x264.tar.bz2

cd x264-snapshot-20180305-2245/

./configure

make && make install

安装libfdk-aac:

解压fdk-aac-0.1.6.tar.gz

cd fdk-aac-0.1.6/

./configure

make && make install

安装cmake

yum install cmake*

cmake --version 如果大于3.5则不需安装cmake-3.5

安装ffmpeg

解压ffmpeg-3.4.2.tar.gz

cd ffmpeg-3.4.2/

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/

./configure --disable-debug --enable-libx264 --enable-gpl --enable-shared --enable-libfdk-aac --enable-nonfree

查看输出信息

Enabled encoders:是否有 libfdk_aac libx264

make && make install

cp /usr/local/lib/libx* /lib64/

cp /usr/local/lib/libfdk* /lib64/

cp /usr/local/lib/libav* /lib64/

cp /usr/local/lib/libsw* /lib64/

cp /usr/local/lib/libpostproc* /lib64/