ffmpeg安装教程
发布日期:2021-06-17
浏览量:3930次
安装依赖包
yum install autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel x264-devel
yum install -y gcc g++ cmake gcc-c++
yum install libass libass-devel
yum install -y yasm
wget https://www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.gz
tar -zxvf nasm-2.13.03.tar.gz
cd nasm-2.13.03
./configure
make
make install
支持mp3音频合成
wget https://jaist.dl.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar -zxvf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure --enable-shared
make
make install
wget http://download.videolan.org/x264/snapshots/x264-snapshot-20191217-2245.tar.bz2
tar jxvf x264-snapshot-20191217-2245.tar.bz2
cd x264-snapshot-20191217-2245
./configure --enable-shared --enable-static
make
make install
ldconfig
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
wget https://ffmpeg.org/releases/ffmpeg-4.2.2.tar.bz2
tar -jxvf ffmpeg-4.2.2.tar.bz2
cd ffmpeg-4.2.2
./configure --enable-pic --enable-gpl --enable-shared --enable-libx264 --enable-libfreetype --enable-libfontconfig --enable-libmp3lame --prefix=/usr/local/ffmpeg
make -j 4
make install
最后一行加入并保存:
vi /etc/ld.so.conf
/usr/local/ffmpeg/lib/
重新加载配置
ldconfig
软连接
ln -s /usr/local/ffmpeg/bin/ffmpeg /usr/bin/ffmpeg