centos7.x安装FFMPEG

centos7.x安装FFMPEG

  • 安装依赖

[root@content yukw]# yum -y install gcc
  • 安装编译yasm

[root@content yukw]# mkdir /data/{src,service}
[root@content yukw]# cd /data/src
[root@content yukw]# wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
[root@content yukw]# tar xf yasm-1.3.0.tar.gz 
[root@content yukw]# cd yasm-1.3.0/
[root@content yukw]# ./configure --enable-shared --prefix=/data/service/yasm
[root@content yukw]# make
[root@content yukw]# make install
  • 安装编译ffmpeg

[root@content yukw]# cd ..
[root@content yukw]# wget http://www.ffmpeg.org/releases/ffmpeg-4.4.tar.gz
[root@content yukw]# tar xf ffmpeg-4.4.tar.gz 
[root@content yukw]# cd ffmpeg-4.4/
[root@content yukw]# ./configure --enable-shared --disable-x86asm --prefix=/data/service/ffmpeg
[root@content yukw]# make
[root@content yukw]# make install
  • 加载库文件

[root@content yukw]# vim /etc/ld.so.conf
include ld.so.conf.d/*.conf
/data/service/yasm/lib/
/data/service/ffmpeg/lib/
[root@content yukw]# ldconfig
[root@content yukw]# /data/service/ffmpeg/bin/ffmpeg -version
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)
configuration: --enable-shared --disable-x86asm --prefix=/data/service/ffmpeg
libavutil      56. 70.100 / 56. 70.100
libavcodec     58.134.100 / 58.134.100
libavformat    58. 76.100 / 58. 76.100
libavdevice    58. 13.100 / 58. 13.100
libavfilter     7.110.100 /  7.110.100
libswscale      5.  9.100 /  5.  9.100
libswresample   3.  9.100 /  3.  9.100

centos7.x安装FFMPEG

  • 添加环境变量

[root@content yukw]# vim /etc/profile    添加如下四行
PATH=$PATH:/data/service/ffmpeg/bin
export PATH
PATH=$PATH:/data/service/yasm/bin
export PATH

[root@content yukw]# source /etc/profile
[root@content yukw]# ffmpeg -version

上一篇:iOS进阶


下一篇:5G时代,如何快速学习音视频?阿里P8亲手整理的Android音视频开发进阶指南