Linux环境下FFMPEG的安装与配置

首先,安装相关编码器

安装包下载地址:https://download.csdn.net/download/u010782875/10476579

lame-3.100.tar.gz

tar -zxvf lame-3.100.tar.gz
cd lame-3.100
./configure
make
make install
make clean

libogg-1.3.3.tar.gz 

tar -zxvf libogg-1.3.3.tar.gz
cd libogg-1.3.3
./configure
make
make install
make clean

libvorbis-1.3.3.tar.gz 

tar -zxvf libvorbis-1.3.3.tar.gz
cd libvorbis-1.3.3
./configure
make
make install
make clean

注:libvorbis依赖于libogg, 所以libogg要先于libvorbis安装

xvidcore-1.3.3.tar.gz 

tar -zxvf xvidcore-1.3.3.tar.gz
cd xvidcore-1.3.3/build/generic/
./configure
make
make install
make clean

last_x264.tar.bz2

tar -xvf last_x264.tar.bz2 
cd x264-snapshot-20171125-2245
./configure --enable-shared --enable-static
make
make install
make clean

FFMPEG安装及配置

ffmpeg-4.0.tar.bz2 

tar -xvf ffmpeg-4.0.tar.bz2 
cd ffmpeg-4.0
./configure --enable-shared --prefix=/usr/local/ffmpeg --enable-libmp3lame --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-postproc --enable-ffplay --enable-libx264 --enable-libxvid
make
make install
make clean

编译完成后,进入/etc/profile中将ffmpeg加入到环境变量(在文件最后加上export PATH=/usr/local/ffmpeg/bin:$PATH

进一步,把ffmpeg的库加入/etc/ld.so.conf中

sudo gedit /etc/ld.so.conf

检查安装

ffmpeg -version

若安装成功,则会出现如下信息

Linux环境下FFMPEG的安装与配置_第1张图片

参考文章:https://blog.csdn.net/tuzixini/article/details/78641151

你可能感兴趣的:(SRS)