在 CentOS 7 上安装 ffmpeg | Install ffmpeg on CentOS 7
更新与 20/04/2018
来源:https://blog.csdn.net/qq_34627459/article/details/74956569
-
安装 EPEL Release,因为安装需要使用其他的 repo 源。
yum install -y epel-release
如果出现缺少 Code 提示,可以:
sudo rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
安装完成之后,通过下列命令查看是否成功
yum repolist
-
安装 Nux-Dextop 源
导入一个 Code
sudo rpm –import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
安装nux-dextop 源
sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
查看 repo 源是否安装成功
yum repolist
-
yum 安装 ffmpeg
yum install -y ffmpeg
Updated on 20/04/2018
Source: https://blog.csdn.net/qq_34627459/article/details/74956569
-
Install EPEL Release because of the denpendence on other repositories.
yum install -y epel-release
If it comes with warning -"lacks Code", you can do
sudo rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
After installation, you can input following code to see if that works.
yum repolist
-
Install Nux-Dextop repositories.
Inport a code:
sudo rpm –import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
Install nux-dextop repositories.
sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
Make sure if that works.
yum repolist
-
Use yum to install ffmpeg.
yum install -y ffmpeg
在服务器上下载 YouTube 视频的时候需要 ffmpeg 软件来合成文件,然而这个过程似乎一点儿不同,下面是我在我位于美国的 Linode 服务器(Centos 7 64-bit)上的安装方式。
- ffmpeg 需要 libdc1394-devel 并且它可在 epel repository 中获得。 运行下面的命令来安装 epel repository:
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-10.noarch.rpm
注意:上面的内容“http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-10.noarch.rpm”是当前最新版本,如果出现了诸如 404 的错误,请访问“http://dl.fedoraproject.org/pub/epel/7/x86_64/e/”获得最新版本。
2. ffmpeg 可以在 ATRPMS Repo 中获得。ATRPMS Repo (http://dl.atrpms.net/all/atrpms-repo-6-7.el6.x86_64.rpm)
注: 若上面的链接无法使用,我们可以使用镜像:
rpm -ivh https://www.mirrorservice.org/sites/dl.atrpms.net/el7-x86_64/atrpms/stable/atrpms-repo-7-7.el7.x86_64.rpm
修改 atrpms.repo 来更新
其 baseurl:vi /etc/yum.repos.d/atrpms.repo
在 [atrpms] 下把:baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable enabled=1
中的 baseurl 和 enabled 改成 :baseurl=https://www.mirrorservice.org/sites/dl.atrpms.net/el$releasever-$basearch/atrpms/stable enabled=0
- 运行下面的命令行安装 ffmpeg:
yum -y --enablerepo=atrpms install ffmpeg
- 运行下面的命令来确认 ffmpeg 安装是否成功:
ffmpeg -version
或者
which ffmpeg
- 例如:把 mp3 转换成 ogg 可以运行下面的命令行:
wget https://example.com/mpthreetest.mp3
ffmpeg -i mpthreetest.mp3 -c:a libvorbis -q:a 4 mpthreetest.ogg
访问项目网站获得更多信息。
Due to some policy reasons, you're not able to access to our comment system in mainland China. Click here for details.