Centos7编译安装FFMPEG

  • 安装依赖和yasm
[root@ECS ~]# yum install autoconf automake bzip2 bzip2-devel cmake freetype-devel gcc gcc-c++ git libtool make pkgconfig zlib-devel openssl-devel
[root@ECS ~]# yum install yasm​
  • 下载并解压源码包
[root@ECS ~]# wget http://ffmpeg.org/releases/ffmpeg-4.4.1.tar.gz
[root@ECS ~]# tar -xvf ffmpeg-4.4.1.tar.gz
  • 编译安装
[root@ECS ~]# cd ffmpeg-4.4.1
[root@ECS ffmpeg-4.4.1]# ./configure --enable-shared --enable-openssl --enable-protocols --enable-protocol=https --prefix=/usr/local/ffmpeg​
[root@ECS ffmpeg-4.4.1]# make && make install
  • 配置动态库路径
[root@ECS ~]# vi /etc/ld.so.conf
# 末尾加入/usr/local/ffmpeg/lib
[root@ECS ~]# ldconfig
  • 配置环境变量
[root@ECS ~] vi /etc/profile
# 文件末尾加入
PATH=$PATH:/usr/local/ffmpeg/bin
export PATH
[root@ECS ~] source /etc/profile
  • 查看FFMPEG版本
[root@ECS ~] ffmpeg -version
ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)
configuration: --enable-shared --enable-openssl --enable-protocols --enable-protocol=https --prefix=/usr/local/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

参考:https://trac.ffmpeg.org/wiki/CompilationGuide/Centos

添加新评论