centos7编译安装ffmpeg

centos7编译安装ffmpeg

1. 安装基础命令

yum -y install gcc automake autoconf libtool make
yum install gcc gcc-c++
yum -y install bzip2
yum install -y wget
yum install -y vim

2. 安装nasm

wget https://www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.gz
tar xvf nasm-2.13.03.tar.gz
cd nasm-2.13.03
./configure
make
make install

3. 安装yasm

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

4. 安装ffmpeg

wgt 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-shared --prefix=/usr/local/ffmpeg --enable-gpl 
make
make install

配置:

vim /etc/ld.so.conf

打开后加入以下两行:
/usr/local/ffmpeg/lib
/usr/local/lib

让配置生效
ldconfig

创建链接:

ln -s /usr/local/ffmpeg/bin/ffmpeg /usr/local/bin/ 
ln -s /usr/local/ffmpeg/bin/ffprobe /usr/local/bin/ 
ln -s /usr/local/ffmpeg/bin/ffserver /usr/local/bin/

5. 测试

 输入ffmpeg -version
[root@iZuf69pdcwzj9ioluu7rthZ softwore]# ffmpeg -version
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-39)
configuration: --enable-shared --prefix=/usr/local/ffmpeg --enable-gpl
libavutil      56. 31.100 / 56. 31.100
libavcodec     58. 54.100 / 58. 54.100
libavformat    58. 29.100 / 58. 29.100
libavdevice    58.  8.100 / 58.  8.100
libavfilter     7. 57.100 /  7. 57.100
libswscale      5.  5.100 /  5.  5.100
libswresample   3.  5.100 /  3.  5.100
libpostproc    55.  5.100 / 55.  5.100

输入 which ffmpeg 
[root@iZuf69pdcwzj9ioluu7rthZ softwore]# which ffmpeg 
/usr/local/bin/ffmpeg

参考: https://www.cnblogs.com/fatmanhappycode/p/12231189.html

你可能感兴趣的:(freeswitch学习,运维,centos,ffmpeg,linux)