先安装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/
参考地址:https://blog.csdn.net/yinsui1839/article/details/80096668
https://blog.csdn.net/weixin_46045077/article/details/106659194
libx264 not found解决办法:
添加 –extra-cflags=-I/usr/local/include –extra-ldflags=-L/usr/local/lib
执行:./configure –enable-memalign-hack –enable-ffserver –enable-network –enable-protocols –enable-muxers –disable-yasm –enable-shared –enable-w32threads –enable-libx264 –enable-gpl –extra-cflags=-I/usr/local/include –extra-ldflags=-L/usr/local/lib
参考地址:http://blog.sina.com.cn/s/blog_54b5ea250100r53o.html
fdk-aac安装地址:
http://www.linuxfromscratch.org/blfs/view/svn/multimedia/fdk-aac.html
解决libx264.so库文件不存在错误:error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file
vim /etc/ld.so.conf //在新的一行中加入库文件所在目录
/usr/lib
# ldconfig //更新/etc/ld.so.cache文件
参考链接:https://blog.csdn.net/deeplan_1994/article/details/83927832