yum install -y libtheora-devel libvorbis-devel yum install -y libtool autoconf automake yum -y install gnutls gnutls-devel lame lame-devel faac faac-devel git clone git://github.com/mstorsjo/fdk-aac cd fdk-aac aclocal;libtoolize --force;autoconf;autoheader;automake autoreconf -i ./configure make install cd .. #进入https://sourceforge.net/projects/lame/,下载lame-3.100 tar -zxf lame-3.100.tar.gz cd lame-3.100 ./configure make make install cd.. wget https://www.nasm.us/pub/nasm/releasebuilds/2.14/nasm-2.14.tar.gz --no-check-certificate tar zxvf nasm-2.14.tar.gz cd nasm-2.14 ./configure make install cd.. git clone https://code.videolan.org/videolan/x264.git cd x264 # 如果不将include和lib安装在/usr/local目录,之后运行ffmpeg命令时可能仍然报错误 ./configure --prefix=/usr/x264/ --includedir=/usr/local/include --libdir=/usr/local/lib --enable-shared make install cd.. wget http://ffmpeg.org/releases/ffmpeg-4.2.2.tar.bz2 tar -jxvf ffmpeg-4.2.2.tar.bz2 cd ffmpeg-4.2.2 ./configure --prefix=/usr/local/ffmpeg --enable-gpl --enable-version3 --enable-pthreads --enable-shared --enable-libmp3lame --enable-libx264 --enable-pic --enable-libfdk-aac --enable-openssl --enable-nonfree make -j24 make install # vi /etc/profile // 在profile文件中加入 PATH=$PATH:/usr/local/ffmpeg/bin export PATH 保存后执行source /etc/profile 运行:$ ffmpeg -v ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory 执行vi /etc/ld.so.conf 加入 /usr/local/ffmpeg/lib /usr/lib /usr/lib64 /usr/local/lib 执行:ldconfig $ ffmpeg -y -i 4.wmv -vcodec libx264 -qscale 0 -f mp4 video.mp4



