centos7.x安装FFMPEG

43 篇文章 1 订阅

centos7.x安装FFMPEG

  • 安装依赖

[root@content yukw]# # yum install autoconf automake bzip2 bzip2-devel cmake freetype-devel gcc gcc-c++ git libtool make pkgconfig zlib-devel
  • 安装编译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

--enable-shared是configure 常用的一个参数,表示启用动态库版本。
如果你要编译一个库的源代码,可以把它编译成静态库,也可以把它编译成动态库。如果你想编译成动态库,就用 --enable-shared参数;如果你想编译成静态库,就用--enable-static参数

  • 安装编译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

  • 添加环境变量

[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
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

参考官网文档:CompilationGuide/Centos – FFmpeg 

好了,这就是centos7.x安装FFMPEG的方法了,如有问题可与博主一起交流讨论!

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值