一、安装依赖
1.1 安装tiff、png、gif等依赖
dnf -y install automake autoconf libtool make gcc gcc-c++ dnf --enablerepo=PowerTools -y install giflib-devel dnf --enablerepo=PowerTools -y install libexif-devel dnf -y install bison pkgconfig glib2-devel gettext make libpng-devel libjpeg-devel libtiff-devel libexif-devel giflib-devel libX11-devel freetype-devel fontconfig-devel cairo-devel fribidi-devel
1.2 安装yasm (源码编译安装)
cd /tmp wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz tar zxvf yasm-1.3.0.tar.gz cd yasm-1.3.0 ./configure make make install
1.3 安装nasm(源码编译安装)
cd /tmp wget https://www.nasm.us/pub/nasm/releasebuilds/2.15/nasm-2.15.tar.gz tar xvf nasm-2.15.tar.gz cd nasm-2.15 ./configure make make install
1.4 安装libx264(源码编译安装) H264编码器
cd /tmp yum install git (可选) git clone https://code.videolan.org/videolan/x264.git cd x264 ./configure --enable-shared make make install
1.5 安装 libmp3lame(源码编译安装) mp3编码器
cd /tmp wget https://sourceforge.net/projects/lame/files/lame/3.100/lame-3.100.tar.gz tar zxvf lame-3.100.tar.gz cd lame-3.100 ./configure --enable-shared make make install
1.6安装图形库
cd /tmp wget http://download.mono-project.com/sources/libgdiplus/libgdiplus0-6.0.5.tar.gz tar zxvf libgdiplus0-6.0.5.tar.gz cd libgdiplus-6.0.5 ./configure make make install echo "/usr/local/lib" >> /etc/ld.so.conf ldconfig
二、安装ffmpeg
cd /tmp wget http://ffmpeg.org/releases/ffmpeg-4.3.1.tar.gz tar zxvf ffmpeg-4.3.1.tar.gz cd ffmpeg-4.3.1 ./configure --enable-gpl --enable-libx264 --enable-libmp3lame --enable-libfreetype --enable-libfontconfig --enable-libfribidi make make install
三、测试
ffmpeg
四、常见问题
[error while loading shared libraries: libx264.so.138: cannot open shared object file: No search File]
https://blog.csdn.net/ai2000ai/article/details/55260929
https://www.cnblogs.com/blackhumour2018/p/9400415.html