Centos7安装ffmpeg
用到的包
压缩并安装
powershell
tar xvJf ffmpeg-5.0.1.tar.xz
yum install -y gcc
powershell
tar -zxvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure
make && make install
yasm --version
powershell
yum install -y bzip2
powershell
tar jxvf nasm-2.14.02.tar.bz2
cd nasm-2.14.02
./configure
make && make install
nasm --version
powershell
tar jxvf x264-master.tar.bz2
cd x264-master
./configure --prefix=/usr/local/x264 --enable-shared --enable-static --disable-asm
make && make install
powershell
tar jxvf x264-master.tar.bz2
cd x264-master
./configure --enable-shared
make && make install
powershell
cd ./ffmpeg-5.0.1/
./configure --enable-libx264 --enable-gpl --enable-shared --prefix=/data/ffmpeg/ffmpeg
make && make install
- 根据顺序安装以上所有文件
- 再调整动态库路径
powershell
vim /etc/ld.so.conf
追加下列2行文本即可
- 刷新
powershell
ldconfig
- 查看是否ffmpeg是否安装成功
powershell
/data/ffmpeg/ffmpeg/bin/ffmpeg -version
完成