【转】Compile FFmpeg on CentOS 6.x
This guide is based on a minimal CentOS installation and will install FFmpeg with several external encoding libraries. This guide is kept relatively up to date with FFmpeg development and library sources (see the page history for changelog), and should also work for recent Red Hat Enterprise Linux (RHEL) and Fedora.
Note: The # indicates that the command should be executed as superuser or root.
Preparation
Remove any existing packages:
# yum erase ffmpeg x264 x264-devel
Get the dependencies:
# yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig wget zlib-devel
Make a source directory:
mkdir ~/ffmpeg-source
Installation
Yasm
Yasm is an assembler used by x264 and FFmpeg.
cd ~/ffmpeg-source
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure
make
# make install
Note: If you do not require certain encoders you may skip the relevant section and then remove the appropriate ./configure option in FFmpeg. For example, if libvorbis is not needed, then skip that section and then remove –enable-libvorbis from the Install FFmpeg section.
x264
H.264 video encoder.
cd ~/ffmpeg-source
git clone git://git.videolan.org/x264
cd x264
./configure --enable-static --enable-shared
make
# make install
libfdk_aac
AAC audio encoder.
cd ~/ffmpeg-source
git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git
cd fdk-aac
autoreconf -fiv
./configure --disable-shared
make
# make install
LAME
MP3 audio encoder.
cd ~/ffmpeg-source
wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar xzvf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure --disable-shared --enable-nasm
make
# make install
libogg
Required for libtheora and libvorbis.
cd ~/ffmpeg-source
wget http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz
tar xzvf libogg-1.3.0.tar.gz
cd libogg-1.3.0
./configure --disable-shared
make
# make install
libtheora
Theora video encoder.
cd ~/ffmpeg-source
wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz
tar xzvf libtheora-1.1.1.tar.gz
cd libtheora-1.1.1
./configure --disable-shared
make
# make install
libvorbis
Vorbis audio encoder.
cd ~/ffmpeg-source
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz
tar xzvf libvorbis-1.3.3.tar.gz
cd libvorbis-1.3.3
./configure --disable-shared
make
# make install
libvpx
VP8 video encoder.
cd ~/ffmpeg-source
git clone http://git.chromium.org/webm/libvpx.git
cd libvpx
./configure
make
# make install
FFmpeg
cd ~/ffmpeg-source
git clone git://source.ffmpeg.org/ffmpeg
cd ffmpeg
./configure --enable-nonfree --enable-gpl --enable-libfdk_aac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264
make
# make install
Compilation is now complete and ffmpeg should now be ready to use. The rest of this guide shows how to update or remove FFmpeg.
Note: Keep the ffmpeg-source directory and all contents if you intend to update or uninstall as shown below.
Error with libx264 not found:
yum install x264-devel
yum install x264
Updating x264, libvpx, and FFmpeg
First uninstall x264, libvpx, and FFmpeg:
cd ~/ffmpeg-source/x264
# make uninstall
cd ~/ffmpeg-source/ffmpeg
# make uninstall
cd ~/ffmpeg-source/libvpx
# make uninstall
Update x264
cd ~/ffmpeg-source/x264
make distclean
git pull
Then run ./configure, make, and make install as shown in the Install x264 section.
Update libvpx
cd ~/ffmpeg-source/libvpx
make clean
git pull
Then run ./configure, make, and make install as shown in the Install libvpx section.
Update FFmpeg
cd ~/ffmpeg-source/ffmpeg
make distclean
git pull
Then run ./configure, make, and make install as shown in the Install FFmpeg section.
Reverting changes made by this guide
cd ~/ffmpeg-source/yasm-1.2.0
# make uninstall
cd ../x264
# make uninstall
cd ../lame-3.99.5
# make uninstall
cd ../libogg-1.3.0
# make uninstall
cd ../libvorbis-1.3.3
# make uninstall
cd ../libvorbis-1.3.3
# make uninstall
cd ../libvpx
# make uninstall
cd ../ffmpeg
# make uninstall
rm -rf ~/ffmpeg-source
# yum erase autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig wget zlib-devel
This entry was posted in Centos, FFmpeg on April 30, 2013.
【转】Compile FFmpeg on CentOS 6.x的更多相关文章
- ffmpeg的centos、msys2、msvc编译
msys2 和 centos https://ffmpeg.org/download.html https://ffmpeg.zeranoe.com/builds/ Windows MSYS2准备 1 ...
- centos编译 Compiling FFmpeg on CentOS RHEL Fedora
This guide is based on a minimal installation of the latest CentOS release, and will provide a local ...
- compile ffmpeg
download SDL 1.2.xxx version source code. 1) configure 2) make & make instll download recent ffm ...
- How to compile tensorflow on CentOS
Tensorflow is a very effective machine learning library implemented by C++, we can use tensorflow wi ...
- ffmpeg源码编译安装(Compile ffmpeg with source) Part 2 : 扩展安装
在Ubuntu,Debian,Mint上编译ffmpeg 本文主要为在Ubuntu,Debian和Mint上编译安装ffmpeg和库文件以及一些扩展的编解码器.当然这与从源中安装无关. 请首先看一下通 ...
- ffmpeg源码编译安装(Compile ffmpeg with source) Part 1 : 通用部分
本页内容包含了在Unix/Linux中用源码包编译的通用的结构 可能不仅仅适用于ffmpeg 为啥使用源码包编译 编译源码可以扩展功能, 实现相对于自己平台的最优化, 还可以自定义的修改 概述 大部分 ...
- compile FFMPEG under windows
这个文章应该算是中文版最好的了.但是还有一些需要修正. 特别是winsock2的处理 win10 msys2 vs2015 ffmpeg3.2.2 编译 这个英文版的才是最好的 Building ff ...
- 【软件安装】在 CentOS 7(Linux)上部署流媒体服务(Tengine、ffmpeg、Centos 7、nginx-http-flv-module、OBS)
Centos7+Tengine+Nginx-http-flv-module+ffmpeg+OBS搭建流媒体服务器 一.需求和背景 视频直播是基于领先的内容接入.分发网络和大规模分布式实时转码技术打造的 ...
- 用ffmpeg合并音频文件
1 问题描述 打电话的对话,被拆分成了两个PCM文件.其中主叫的录音文件A.pcm,被叫的录音为B.pcm. 问题是怎么合成一个混音的对话文件AB.wav. 2 WAV文件的录音格式 常见的声音文件主 ...
随机推荐
- jquery ajax php+mysql 无刷新分页 详细实例
最近在接触jquery和ajax,当前项目也会用到分页,为了用户体验更好一些,就准备用无刷新分页,这个demo很适合新手学习查看,写的比较清晰,话不多说,直接上代码吧. 首先是html页面,index ...
- 通过WebApi取出XML数据
Get请求: public static Result<GetExpressCollectionResponseType> GetDataFromWebs(string waybillNu ...
- 动态获取爱奇艺上传视频mp4格式url地址
有时候,在工作中有些客户需要用到视频,我们大家都知道视频是非常的耗费流量的,因此,如果因为项目要求客户单独买台视频服务器是非常划不来的.那么将视频上传到优酷,爱奇艺等视频网站来托管那是一件很好的解决方 ...
- Python设计模式——单例模式
单例模式是日常应用中最广泛的模式了,其目的就是令到单个进程中只存在一个类的实例,从而可以实现数据的共享,节省系统开销,防止io阻塞等等 但是在多进程的应用中,单例模式就实现不了了,例如一些web应用, ...
- 微信支付JS API使用心得
微信的接口真的很坑爹,只返回成功或失败,从来不会告诉你为什么失败.这个微信支付的js接口也是调了一个下午才成功,期间踩了不少坑,在这里总结一下,而且把支付接口封装成了一个js文件,这样以后调用就很方便 ...
- Win8.1设置窗口背景颜色为护眼色
更改注册表 window+R --->输入regedit(点击确定后进入注册表编辑器) 需要修改以下两个地方,重启电脑生效: [HKEY_CURRENT_USER\Control Panel\C ...
- JSON和JSONP,也许你会豁然开朗,含jQuery用例
前言: 说到AJAX就会不可避免的面临两个问题,第一个是AJAX以何种格式来交换数据?第二个是跨域的需求如何解决?这两个问题目前都有不同的解决方案,比如数据可以用自定义字符串或者用XML来描述,跨域可 ...
- noj [1480] 懒惰的风纪委Elaine (多重背包)
http://ac.nbutoj.com/Problem/view.xhtml?id=1480 [1480] 懒惰的风纪委Elaine 时间限制: 1000 ms 内存限制: 65535 K 问题描述 ...
- js实现方法的链式调用
假如这里有三个方法:person.unmerried();person.process();person.married();在jQuery中通常的写法是:person.unmerried().pro ...
- 【弱省胡策】Round #6 String 解题报告
感觉这个题好神啊. 首先我们只管 $a = b$ 的情况,那么我们自然就可以把这个串对 $a$ 取模,然后用 KMP 求出能弄出几个其他的 B 串. 具体就是把串先倍长,然后倒过来,然后求 $Next ...