Linux 安装ffmpeg

1.添加RPMfusion仓库

我的是CentOS 7 如果是其他版本 请参考:https://download1.rpmfusion.org/free/el/

sudo yum install https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm

2.安装SDL媒体库

sudo yum install http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm

3.安装FFmpeg

sudo yum install ffmpeg

如果需要开发的同学 可以在安装开发库

sudo yum -y install ffmpeg-devel

4.查看是否安装成功

rpm -qi ffmpeg
[root@iZuf69fe7vrj77jnaq5xn2Z pk]# rpm -qi ffmpeg
Name        : ffmpeg
Version     : 3.4.8
Release     : 1.el7
Architecture: x86_64
Install Date: 2020年11月04日 星期三 15时05分46秒
Group       : Unspecified
Size        : 2260881
License     : GPLv2+
Signature   : RSA/SHA1, 2020年07月06日 星期一 20时39分14秒, Key ID 758b3d18f5cf6c1e
Source RPM  : ffmpeg-3.4.8-1.el7.src.rpm
Build Date  : 2020年07月05日 星期日 15时27分54秒
Build Host  : ebb14babbee54b3dada2f07a2760bfe1
Relocations : (not relocatable)
Packager    : RPM Fusion
Vendor      : RPM Fusion
URL         : http://ffmpeg.org/
Summary     : Digital VCR and streaming server
Description :
FFmpeg is a complete and free Internet live audio and video
broadcasting solution for Linux/Unix. It also includes a digital
VCR. It can encode in real time in many formats including MPEG1 audio
and video, MPEG4, h263, ac3, asf, avi, real, mjpeg, and flash.

或者

ffmpeg -version
[root@iZuf69fe7vrj77jnaq5xn2Z pk]# ffmpeg -version
ffmpeg version 3.4.8 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-39)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-indev=jack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --disable-encoder=libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzvbi --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
libavutil      55. 78.100 / 55. 78.100
libavcodec     57.107.100 / 57.107.100
libavformat    57. 83.100 / 57. 83.100
libavdevice    57. 10.100 / 57. 10.100
libavfilter     6.107.100 /  6.107.100
libavresample   3.  7.  0 /  3.  7.  0
libswscale      4.  8.100 /  4.  8.100
libswresample   2.  9.100 /  2.  9.100
libpostproc    54.  7.100 / 54.  7.100

到这里就完成了,是不是很方便简单

喜欢的朋友记得点赞收藏