CentOs7.5下安装ffmpeg,详细安装说明
CentOs7.5下安装ffmpeg
1.官网下载linux版本的ffmpeg源码包 ffmpeg-4.1.tar.xz
(此步骤也可以使用git clone下载源码包,本质上是一样的 )
2.使用xftp将源码包ffmpeg-4.1.tar.xz上传至linux主机(usr/local/ffmpeg目录;直接使用linux命令下载到linux也可以)
cd /usr/local/
mkdir ffmpeg #在usr/local目录下创建ffmpeg目录
3.解压源码包
cd /usr/local/ffmpeg
tar xvJf ffmpeg-4.1.tar.xz
4.切换到ffmpeg-4.1目录、安装gcc编译器
yum install gcc #安装gcc编译器
yum install yasm #安装yasm编译器
5.输入如下命令/usr/local/ffmpeg为自己指定的安装目录
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
如果出现如下错误信息:
If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the ffm[email protected] mailing list or IRC #ffmpeg on irc.freenode.net. Include the log file "config.log" produced by configure as this will help solve the problem.
则需要先安装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 #编译安装
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
6.执行make(非常非常久.......)
make
7.执行make install(安装)
make install
8.修改文件/etc/ld.so.conf
vim /etc/ld.so.conf
输入以下内容
include ld.so.conf.d/*.conf
/usr/local/ffmpeg/lib/
输入ldconfig使修改生效。
9.查看版本
/usr/local/ffmpeg/ffmpeg-4.1/ffmpeg -version
10.配置环境变量
vim /etc/profile
在最后PATH添加环境变量:
#set ffmpeg environment
PATH=$PATH:/usr/local/ffmpeg/bin
export PATH
source /etc/profile #使配置生效
11.查看环境变量是否配置成功
ffmpeg -version
|
至此安装成功