如何在Linux中安装ffmpeg

时间:2020-03-21 11:45:24  来源:igfitidea点击:

在本教程中,让我向我们展示如何在各种Linux发行版上安装FFMPEG。
FFMPEG是可用于编码,解码,转码,MUX,DEMUX,RECORD,Stream,Filter和播放任何类型的媒体文件的最佳多媒体框架之一。
它是完全免费的多媒体框架,适用于几乎所有操作系统,包括Linux,Mac OS X,Microsoft Windows,BSD,Solaris等。
有关更多详细信息,请参阅本教程末尾给出的官方链接。

ffmpeg包装为大多数Linux发行版,可在默认存储库中使用。
其中我包括流行的Linux Distrs的安装说明。

在Arch Linux上安装ffmpeg及其衍生物

FFMPEG可在Arch Linux的默认存储库中使用。
我们可以使用命令安装它:

$sudo pacman -S ffmpeg

AUR中有最新的开发版。

,因此我们可以使用任何Aur Hepers安装它,例如Yay。

$yay -S ffmpeg-git

AUR中还有FFMPEG-Full Package,它建成了尽可能多的可选功能。
如果我们愿意,我们也可以安装。

$yay -S ffmpeg-full-git

在debian上安装ffmpeg

ffmpeg可在默认存储库中使用。
打开终端并运行以下命令以安装它。

$sudo apt-get install ffmpeg

在Ubuntu及其衍生品上安装ffmpeg

在Ubuntu中,FFMPEG可在官方存储库中提供,因此我们可以使用命令安装它:

$sudo apt-get install ffmpeg

官方存储库中的FFMPEG可能已经过时了。
要安装最新版本,请使用FFMPEG PPA。

$sudo add-apt-repository ppa:mc3man/trusty-media
$sudo apt-get update
$sudo apt-get dist-upgrade

在Fedora,Rhel,Centos安装FFMPEG

FFMPEG可以通过基于RPM的分布式的涡点和rpmfusion存储库安装,例如RHEL,Fedora,CentOS。

首先,使用命令添加epel存储库:

$sudo yum install epel-release

添加RPMFusion存储库,如下所示,取决于我们使用的分发:

要启用访问免费和非直接存储库的访问,请使用以下命令:

Fedora 22及以后:

$sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

Rhel 6.x,Centos 6.x:

$sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-6.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-6.noarch.rpm

Rhel 7.x,CentOS 7.x:

$sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm

上面的命令将安装免费和非免费存储库。

启用EPEL后,RPMFUSUT存储库,运行以下命令以安装ffmpeg:

$sudo dnf install ffmpeg ffmpeg-devel

或者,

$sudo yum install ffmpeg ffmpeg-devel

恭喜!我们已在Linux框中成功安装了ffmpeg。

要验证已安装的版本,请运行:

$ffmpeg -version

示例输出:

ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
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

为了获得完整的帮助,运行:

$ffmpeg -h

或者,即使更好,请参阅手册页:

$man ffmpeg