如何在CentOS 8/RHEL 8 Linux系統(tǒng)上安裝FFmpeg? FFmpeg是一個(gè)免費(fèi)的開源多媒體框架,用于播放,編碼,解碼,流式傳輸,轉(zhuǎn)碼,多路復(fù)用,多路復(fù)用和過濾各種格式的多媒體文件,包括MPEG1音頻和視頻,MPEG4,h263,ac3,asf,avi,real, mjpeg和Flash。
FFmpeg是一個(gè)跨平臺(tái)應(yīng)用程序,可以在各種構(gòu)建環(huán)境,配置和機(jī)器架構(gòu)下的Linux,macOS,Windows,BSD,Solaris等上運(yùn)行。大多數(shù)可用于Linux的媒體播放器以及音頻/視頻下載器和轉(zhuǎn)換器(例如youtube-dl)都需要FFmpeg才能工作。
[linuxidc@localhost ~/www.linuxidc.com]$ffmpeg -i www.linuxidc.com.mp4 -i linuxidc.png -filter_complex overlay linuxidc.com.mp4
這些是FFmpeg的主要構(gòu)建塊:
- ffmpeg–用于在格式之間轉(zhuǎn)換多媒體文件的命令行工具
- ffplay–基于SDL和FFmpeg庫的簡單媒體播放器
- ffprobe–簡單的多媒體流分析儀
- FFmpeg還包含開發(fā)人員庫– libavutil,libavcodec,libavformat,libavdevice,libavfilter,libswscale和libswresample。
ffmpeg中每個(gè)輸出的轉(zhuǎn)碼過程可以通過下圖描述:
如何在CentOS/RHEL 8上安裝FFmpeg
按照下文的步驟在CentOS 8/RHEL 8 Linux發(fā)行版上安裝FFmpeg。
步驟1:安裝RPMfusion Yum存儲(chǔ)庫
創(chuàng)建RPM Fusion存儲(chǔ)庫是為了提供Fedora和基于Red Hat的發(fā)行版未提供的軟件。該存儲(chǔ)庫中可用的所有軟件應(yīng)用程序均以預(yù)編譯的RPM文件的形式提供。我們將從RPMfusion存儲(chǔ)庫在CentOS 8/RHEL 8上安裝FFmpeg。
在啟用RPM Fusion for EL之前,需要在RHEL或兼容發(fā)行版(如CentOS)上啟用EPEL。
[linuxidc@localhost ~/www.linuxidc.com]$sudo dnf -y install https://download.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
使用以下命令將其添加到您的系統(tǒng)中。
[linuxidc@localhost ~/www.linuxidc.com]$sudo dnf localinstall –nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm
[linuxidc@localhost ~/www.linuxidc.com]$sudo dnf install –nogpgcheck https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm
接受安裝。
步驟2:在CentOS 8/RHEL 8上安裝FFmpeg
添加EPEL和RPM Fusion存儲(chǔ)庫后,在終端中運(yùn)行以下命令以在CentOS 8 / RHEL 8 Linux系統(tǒng)上安裝FFmpeg。
[linuxidc@localhost ~/www.linuxidc.com]$sudo dnf install http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm
[linuxidc@localhost ~/www.linuxidc.com]$sudo dnf install ffmpeg
將安裝許多依賴項(xiàng),驗(yàn)證并同意安裝。
[sudo] linuxidc 的密碼:
上次元數(shù)據(jù)過期檢查:0:39:41 前,執(zhí)行于 2020年02月29日 星期六 03時(shí)25分14秒。
依賴關(guān)系解決。
================================================================================
軟件包 架構(gòu) 版本 倉庫 大小
================================================================================
安裝:
ffmpeg x86_64 4.2.2-1.el8 rpmfusion-free-updates 1.4 M
安裝依賴關(guān)系:
libva x86_64 2.4.1-1.el8 AppStream 93 k
libvdpau x86_64 1.1.1-7.el8 AppStream 40 k
ocl-icd x86_64 2.2.12-1.el8 AppStream 51 k
openal-soft x86_64 1.18.2-7.el8 AppStream 394 k
libatomic x86_64 8.3.1-4.5.el8 BaseOS 22 k
jack-audio-connection-kit x86_64 1.9.12-8.el8 epel 519 k
libaom x86_64 1.0.0-8.20190810git9666276.el8
epel 1.6 M
libass x86_64 0.14.0-4.el8 epel 110 k
libdav1d x86_64 0.5.2-1.el8 epel 347 k
libmfx x86_64 1.25-4.el8 epel 36 k
libvmaf x86_64 1.3.15-1.el8 epel 347 k
pugixml x86_64 1.9-1.el8 epel 97 k
soxr x86_64 0.1.3-4.el8 epel 97 k
vid.stab x86_64 1.1.0-12.20190213gitaeabc8d.el8
epel 47 k
zimg x86_64 2.9.2-1.el8 epel 268 k
zvbi x86_64 0.2.35-9.el8 epel 424 k
ffmpeg-libs x86_64 4.2.2-1.el8 rpmfusion-free-updates 7.2 M
libavdevice x86_64 4.2.2-1.el8 rpmfusion-free-updates 96 k
opencore-amr x86_64 0.1.5-7.el8 rpmfusion-free-updates 180 k
vo-amrwbenc x86_64 0.1.3-8.el8 rpmfusion-free-updates 77 k
x264-libs x86_64 0.157-12.20190717git34c06d1.el8
rpmfusion-free-updates 651 k
x265-libs x86_64 3.1.2-1.el8 rpmfusion-free-updates 1.9 M
xvidcore x86_64 1.3.7-1.el8 rpmfusion-free-updates 268 k
事務(wù)概要
================================================================================
安裝 24 軟件包
總下載:16 M
安裝大?。?6 M
確定嗎?[y/N]: y
通過運(yùn)行以下命令安裝開發(fā)庫:
[linuxidc@localhost ~/www.linuxidc.com]$sudo dnf -y install ffmpeg-devel
步驟3:在CentOS/RHEL 8上檢查FFmpeg版本
使用以下命令檢查RHEL/CentOS系統(tǒng)上安裝的FFmpeg版本。
[linuxidc@localhost ~/www.linuxidc.com]$rpm -qi ffmpeg
Name : ffmpeg
Version : 4.2.2
Release : 1.el8
Architecture: x86_64
Install Date: 2020年02月29日 星期六 04時(shí)12分47秒
Group : Unspecified
Size : 1939204
License : GPLv2+
Signature : RSA/SHA1, 2020年01月03日 星期五 19時(shí)26分34秒, Key ID 979f0c69158b3811
Source RPM : ffmpeg-4.2.2-1.el8.src.rpm
Build Date : 2020年01月01日 星期三 16時(shí)32分02秒
Build Host : buildvm-03.online.rpmfusion.net
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.
[linuxidc@localhost ~/www.linuxidc.com]$ffmpeg -version
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8 (GCC)
FFmpeg使用幫助
[linuxidc@localhost ~/www.linuxidc.com]$ffmpeg –help
更多:
CentOS 7.5下FFmpeg安裝、簡單使用總結(jié) http://fxwbio.com/Linux/2018-10/154934.htm
如何在 Ubuntu 18.04 / Linux Mint 19.x 中安裝 FFmpeg 4.2 http://fxwbio.com/Linux/2019-08/160266.htm
Linux中安裝FFmpeg詳解 http://fxwbio.com/Linux/2019-03/157443.htm