centos7编译安装ffmpeg

post by rocdk890 / 2017-7-12 9:40 Wednesday linux技术
公司最近要使用音频转码,找到我说要用ffmpeg,让我安装一个,好吧,为了方便以后查阅,故写下这篇文章.
系统:centos 7.x(64位)
软件:ffmpeg 3.3.2
1.下载ffmpeg 3.3.2
wget http://www.ffmpeg.org/releases/ffmpeg-3.3.2.tar.gz

2.下载第三方源
yum -y install epel-release
wget https://www.mirrorservice.org/sites/dl.atrpms.net/el7-x86_64/atrpms/stable/atrpms-repo-7-7.el7.x86_64.rpm
wget http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
rpm -ivh atrpms-repo-7-7.el7.x86_64.rpm
rpm -ivh nux-dextop-release-0-1.el7.nux.noarch.rpm

vi /etc/yum.repos.d/atrpms.repo
[atrpms]
name=Red Hat Enterprise Linux $releasever - $basearch - ATrpms
failovermethod=priority
#baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable
baseurl=https://www.mirrorservice.org/sites/dl.atrpms.net/el7-x86_64/atrpms/stable
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-atrpms

[atrpms-debuginfo]
name=Red Hat Enterprise Linux $releasever - $basearch - ATrpms - Debug
failovermethod=priority
baseurl=http://dl.atrpms.net/debug/el$releasever-$basearch/atrpms/stable
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-atrpms

[atrpms-source]
name=Red Hat Enterprise Linux $releasever - $basearch - ATrpms - Source
failovermethod=priority
baseurl=http://dl.atrpms.net/src/el$releasever-$basearch/atrpms/stable
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-atrpms

3.安装依赖包
yum install automake autoconf make gcc gcc-c++ libtool zlib zlib-devel curl curl-devel alsa-lib alsa-lib-devel gettext gettext-devel expat expat-devel nasm pkgconfig yasm yasm-devel gnutls gnutls-devel  lame lame-devel  fdk-aac fdk-aac-devel x264 x264-devel bzip2 bzip2-devel -y

4.安装ffmpeg
tar zxf ffmpeg-3.3.2.tar.gz && cd ffmpeg-3.3.2
./configure --prefix=/usr/local/ffmpeg --enable-gpl --enable-version3 --enable-nonfree --enable-shared --enable-zlib --enable-bzlib --enable-libmp3lame --enable-libx264 --enable-pic --enable-libfdk-aac
make && make install

echo "/usr/local/ffmpeg/lib" >> /etc/ld.so.conf
ldconfig
echo 'export PATH=/usr/local/ffmpeg/bin:$PATH' >> /etc/profile
source /etc/profile

ffmpeg -version
ffmpeg version 3.3.2 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-11)
configuration: --prefix=/usr/local/ffmpeg --enable-gpl --enable-version3 --enable-nonfree --enable-shared --enable-zlib --enable-bzlib --enable-libmp3lame --enable-libx264 --enable-pic --enable-libfdk-aac
libavutil      55. 58.100 / 55. 58.100
libavcodec     57. 89.100 / 57. 89.100
libavformat    57. 71.100 / 57. 71.100
libavdevice    57.  6.100 / 57.  6.100
libavfilter     6. 82.100 /  6. 82.100
libswscale      4.  6.100 /  4.  6.100
libswresample   2.  7.100 /  2.  7.100
libpostproc    54.  5.100 / 54.  5.100
可以看到ffmpeg已安装成功,好了,剩下的还需要什么就要看你们自己去折腾了.
夜空- 本站版权
1、本站所有主题由该文章作者发表,该文章作者与夜空享有文章相关版权
2、其他单位或个人使用、转载或引用本文时必须同时征得该文章作者和夜空的同意
3、本帖部分内容转载自其它媒体,但并不代表本站赞同其观点和对其真实性负责
4、如本帖侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意
5、原文链接:blog.slogra.com/post-703.html

标签: centos 安装 编译 install ffmpeg centos7

评论: