yum -y install epel-release
yum -y install gcc
yum -y install gcc-c++
yum -y install cmake
yum -y install bzip2
yum -y install kernel-devel
yum -y install kernel-headers
yum -y install yasm
ffmpeg编译openssl需要安装依赖
yum -y install openssl-devel
yum groupinstall "Development Tools"
wget https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2
tar vxjf nasm-2.14.02.tar.bz2
cd nasm-2.14.02 && ./configure && make && make install
vim /etc/profile
PATH=$PATH:/usr/local/bin
export PATH
source /etc/profile
安装libx264
yum -y install git
git clone https://code.videolan.org/videolan/x264.git
cd x264/
./configure --enable-shared
make
make install
cp /usr/local/lib/libx264.* /usr/lib64
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
vim /etc/ld.so.conf
添加配置
include ld.so.conf.d/*.conf
/usr/local/x264/lib
ldconfig
wget http://ffmpeg.org/releases/ffmpeg-4.1.5.tar.bz2
tar vxjf ffmpeg-4.1.5.tar.bz2
cd ffmpeg-4.1.5
./configure --enable-openssl --enable-libx264 --enable-gpl --enable-nonfree --prefix=/usr/local/ffmpeg
make -j 10
make install
vim /etc/profile
PATH=$PATH:/usr/local/ffmpeg/bin
export PATH
source /etc/profile
ffmpeg -version
vim /etc/ld.so.conf
添加配置
include ld.so.conf.d/*.conf
/usr/local/ffmpeg/lib/
ldconfig
ffmpeg -codecs | grep h264