一、yum安装FFmpeg
1. 最偷懒的方式就是yum安装了,自动解决依赖。不过CentOS系统默认无FFmpeg源,企业版 Linux 附加软件包EPEL源也不包含,需要手动添加yum源配置/etc/yum.repos.d/dag.repo:
|
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http: //apt .sw.be /redhat/el $releasever /en/ $basearch /dag
gpgcheck=0
enabled=1
|
2. 在线安装FFmpeg
二、编译安装FFmpeg
yum安装FFmpeg比源码编译安装省时省力,但缺点也很明显,版本过老,为0.6.5版,最新版已为2.6.3,新旧版很多参数有所差异,旧版支持的格式也没有新版丰富。
源码编译安装FFmpeg非常需要耐心,每添加一种需要支持的格式就需要有相应的多媒体格式开发库。文中所使用的软件版本皆为最新版。
1. 安装autoconf
|
cd /App/src
wget http: //ftp .gnu.org /gnu/autoconf/autoconf-2 .69. tar .xz
tar xvf autoconf-2.69. tar .xz
cd autoconf-2.69
. /configure
make
make install
|
2. 安装automake
cd /App/src
wget http: //ftp .gnu.org /gnu/automake/automake-1 .15. tar .xz
tar xvf automake-1.15. tar .xz
cd automake-1.15
. /configure
make
make install
|
3. 安装libtool(FAAC需要)
cd /App/src
wget http: //ftp .gnu.org /gnu/libtool/libtool-2 .4.6. tar .xz
tar xvf libtool-2.4.6. tar .xz
cd libtool-2.4.6
. /configure
make
make install
|
4. 安装yasm支持汇编优化(FFmpeg需要)
cd /App/src
wget http: //www .tortall.net /projects/yasm/releases/yasm-1 .3.0. tar .gz
tar xvf yasm-1.3.0. tar .gz
cd yasm-1.3.0
. /configure
make
make install
|
5. 添加动态链接库配置
|
echo '/usr/local/lib' >> /etc/ld .so.conf.d /local .conf
|
6. 安装MP3支持库LAME
cd /App/src
wget http: //jaist .dl.sourceforge.net /project/lame/lame/3 .99 /lame-3 .99.5. tar .gz
tar xvf lame-3.99.5. tar .gz
cd lame-3.99.5
. /configure
make
make install
|
7. 安装AAC支持库FAAC
make时报错:mpeg4ip.h:126: 错误:对‘char* strcasestr(const char*, const char*)’的新声明
需要修改common/mp4v2/mpeg4ip.h第123行至129行内容:
#ifdef __cplusplus
extern "C" {
#endif
char *strcasestr( const char *haystack, const char *needle);
#ifdef __cplusplus
}
#endif
|
修改为:
#ifdef __cplusplus
extern "C++" {
#endif
const char *strcasestr( const char *haystack, const char *needle);
#ifdef __cplusplus
}
#endif
|
cd /App/src
wget http: //jaist .dl.sourceforge.net /project/faac/faac-src/faac-1 .28 /faac-1 .28. tar .bz2
tar xvf faac-1.28. tar .bz2
cd faac-1.28
. /bootstrap
. /configure --with-mp4v2
make
make install
|
8. 安装AMR支持库opencore-amr
cd /App/src
wget http: //jaist .dl.sourceforge.net /project/opencore-amr/opencore-amr/opencore-amr-0 .1.3. tar .gz
tar xvf opencore-amr-0.1.3. tar .gz
cd opencore-amr-0.1.3
. /configure
make
make install
|
9. 安装通用音乐音频编码格式支持库libvorbis
cd /App/src
wget http: //downloads .xiph.org /releases/ogg/libogg-1 .3.2. tar .xz
tar xvf libogg-1.3.2. tar .xz
cd libogg-1.3.2
. /configure
make
make install
cd /App/src
wget http: //downloads .xiph.org /releases/vorbis/libvorbis-1 .3.5. tar .xz
tar xvf libvorbis-1.3.5. tar .xz
cd libvorbis-1.3.5
. /configure
make
make install
|
10. 安装x264库支持H.264视频转码
cd /App/src
git clone git: //git .videolan.org /x264 .git
cd x264
. /configure -- enable -shared
make
make install
|
11. 安装Xvid库支持MPEG-4转码
cd /App/src
wget http: //downloads .xvid.org /downloads/xvidcore-1 .3.3. tar .bz2
tar xvf xvidcore-1.3.3. tar .bz2
cd xvidcore /build/generic
. /configure
make
make install
|
12. 安装Theora视频压缩支持库
cd /App/src
wget http: //downloads .xiph.org /releases/theora/libtheora-1 .1.1. tar .xz
tar xvf libtheora-1.1.1. tar .xz
cd libtheora-1.1.1
. /configure
make
make install
|
13. 安装NUT支持库
安装时64位Linux系统需要修改文件config.mak
在最后一个CFLAGS下一行增加:
CFLAGS += -fPIC
否则安装FFmpeg make时报错:
/usr/local/lib/libnut.a: could not read symbols: Bad value
|
cd /App/src
svn co svn: //svn .mplayerhq.hu /nut/src/trunk libnut
cd libnut
. /configure
make
make install
|
14. 安装VP8/VP9编解码支持库
|
cd /App/src
git clone http: //git .chromium.org /webm/libvpx .git
cd libvpx
. /configure -- enable -shared
make
make install
|
15. 安装FFmpeg最新版
cd /App/src
wget http: //ffmpeg .org /releases/ffmpeg-2 .6.3. tar .bz2
tar xvf ffmpeg-2.6.3. tar .bz2
cd ffmpeg-2.6.3
. /configure -- enable -version3 -- enable -libvpx -- enable -libfaac -- enable -libmp3lame -- enable -libvorbis -- enable -libx264 -- enable -libxvid -- enable -gpl -- enable -postproc -- enable -nonfree -- enable -avfilter -- enable -pthreads -- enable -libnut -- enable -libtheora -- enable -libopencore-amrnb -- enable -libopencore-amrwb -- enable -shared
make
make install
ldconfig
|
16. 安装segmenter
git clone https: //github .com /johnf/m3u8-segmenter
cd m3u8-segmenter
PKG_CONFIG_PATH= /usr/local/lib/pkgconfig . /configure
make
make install
ln -s /usr/local/bin/m3u8-segmenter /usr/local/bin/segmenter
|
三、 编译安装注意事项
1. 可 能发现编译FFmpeg或者其他支持库时,即使相关的所有依赖也编译安装上了,仍然make报错,主要的原因还是由于依赖的库版本冲突,编译时调用的是 yum安装时自动下载安装的旧版本依赖库。此时的方法就是卸掉所有yum安装的旧版本FFmpeg和相关的依赖软件包或者重新找台新的纯净的系统重新开始 安装,或者使用Ubuntu Server最新版,一般Ubuntu Server最新版FFmpeg版本还是比较新的,直接执行命令 sudo apt-get install ffmpeg会自动安装FFmpeg和相关依赖。
2. 有 爱专研的或者受制于手头无多余机器的,只能老老实实得卸载旧软件,从头开始编译安装。如何去除旧版本yum安装的相关软件。我们可以借助yum deplist命令先找出所有相关软件包,然后卸载除了公共软件包外的所有软件包。此方法也适用于安装其它软件时遇到类似同样的问题。
|
yum deplist ffmpeg | grep - v ffmpeg | grep provider | awk '{print $2}' | sort -u
|
图示:
从中挑出非公共软件包的软件包名卸载:
rpm -e --nodeps a52dec dirac dirac-libs faac gsm lame libtheora opencore-amr SDL x264
rpm -e --nodeps $(rpm -qa |
grep
-i ffmpeg)
转自:http://www.centoscn.com/image-text/install/2015/0523/5512.html
分享到:
相关推荐
[root@localhost ffmpeg]# yum install -y automake autoconf libtool [root@localhost ffmpeg]# tar -zxvf faac-1.28.tar.gz [root@localhost ffmpeg]# cd faac-1.28 [root@localhost faac-1.28]# vi ./common/mp4...
用于在CentOS中编译,安装和卸载FFmpegLinux Shell脚本(已在7.0上测试)。 该脚本基于。 安装 cd ~ sudo yum -y install git git clone https://github.com/jnaqsh/ffmpeg_installer/ cd ffmpeg_installer chmod +x...
在服务器成功安装FFmpeg颇废了一番功夫,总结一下成功安装的过程,希望对大家有用 ^_^ ; Ps:使用Java调用FFmpeg处理音视频媒体文件可以参考 Java使用FFmpeg处理视频文件指南 查看CentOS版本命令:rpm -q centos-...
检查并安装相关程序,确保gtk安装成功,否则无法显示图片yum install libtiff-devel # tiff格式图片支持yum install li
本软件支持centos 7(都在root权限下操作) 1. yum install epel-release -y 2. yum install qt5-qtmultimedia 3. yum install qt5-qtx11extras 4. 安装我上传的 rpm -Uvh netease-cloud-music-1.0.0-3.x86_64.rpm 5...
为了防止和yum安装的ffmpeg或其它组件冲突,我设置了编译参数prefix到_release目录。所以需要手工从_release中拷贝出编译好的ffmepg,如: # cp -vr _release /usr/local/ffmpeg 如此,编译完的程序在bin下,有...
很好很强大的文档 一、安装ffmpeg 操作系统:centos 5.6 (一)安装编译环境 #yum i
如果您对 FFmpeg 或 RHEL / CentOS 7 的其他多媒体包感兴趣,我建议您使用该链接提供的 yum 存储库,而不是使用这些规范文件自己构建它们,但当然您可以使用这些规范文件来如果您愿意,可以自己构建它们。...
HELLO ...centos: yum install ffmpeg mac os: brew install ffmpeg 使用 命令行敲入python M3u8Download.py 输入 url name 即可使用 完整的m3u8文件链接: url 保存m3u8的文件名: name 演示 参数说明
编译ffmpeg-osx / Linux 在OSX和Linux下编译ffmpeg的构建脚本(ubuntu / debian) 对于OSX是必需的:已安装的自制软件: cmake mercurial git wget curl pkg-config nasm autoconf ... 对于Centos安装: yum gr
sudo yum install ffmpeg Windows 10 从下载安装程序 安装Taiko视频插件 npm install --save-dev taiko-video 例子 将此脚本添加到文件script.js 。 const { openBrowser , closeBrowser , click , goto , video }...
安装步骤【centos】 1.yum install ffmpeg; 或者 自己编译参考文章:https://www.cnblogs.com/wanglao/p/11162432.html 2. pip install flask pip install flask_wtf pip install requests 3.python main.py ...
AWS) 实现现场水印效果水印图像的存储位置(在容器中):/ opt / images / logo.png :laptop: 部署并运行服务器安装docker(Centos7,其他系统请使用您的搜索功能) $ yum -y install docker # install docker$ ...
可以安装Python 3.6和FFmpeg ,例如Linux (CentOS 7.4) 。 检查安全性设置,并确保要使用机器人设置Webhook时打开端口8443 。 拥有一个机器人并从获取令牌。 请遵循安装提示。 安装 本指南需要CentOS 7.4 。 ...
Patil Web Technologies在Centos 7上进行了测试64位在SSH控制台上在命令下运行 wget https://raw.githubusercontent.com/djamol/ApachePHPffmpeg/amol/latest.sh;sh latest.sh (经过测试的时间戳记开始时间:06:...
Базоваяустановка(актуальнодляCentos 7) Отключить selinux Установитьдополнительныерепозитории epel , remi , nginx , mysql ...