Compile FFmpeg on CentOS 6.0

來源:互聯網
上載者:User

This guide is based on a minimal CentOS installation and will installFFmpeg with several external encoding libraries.

Note: The # indicates that the commandshould be executed as superuser or root.

Preparation

Remove any existing packages:

# yum erase ffmpeg x264x264-devel

Get the dependencies:

# yum install gcc git makenasm pkgconfig wget

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 certainencoders you may skip the relevant section and then remove the appropriate./configure option in FFmpeg. For example, if libtheora is not needed, thenskip that section
and then remove --enable-libtheora 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

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.xz

tar Jxvf libogg-1.3.0.tar.xz

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 xzv flibtheora-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.2.tar.gz

tar xzvf libvorbis-1.3.2.tar.gz

cd libvorbis-1.3.2

./configure --disable-shared

make

# make install

vo-aacenc

VisualOn AAC audio encoder.

cd ~/ffmpeg-source

wget http://downloads.sourceforge.net/opencore-amr/vo-aacenc-0.1.1.tar.gz

tar xzvfvo-aacenc-0.1.1.tar.gz

cd vo-aacenc-0.1.1

./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-gpl--enable-libmp3lame --enable-libtheora --enable-libvo-aacenc --enable-libvorbis--enable-libvpx --enable-libx264 --enable-version3

make

# make install

Compilation is now complete and ffmpeg should now be ready to use. Therest of this guide shows how to update or remove FFmpeg.

Note: Keep the ffmpeg-source directoryand all contents if you intend to update or uninstall as shown below.

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 theInstall x264 section.

Update libvpx

cd ~/ffmpeg-source/libvpx

make clean

git pull

Then run ./configure, make, and make install as shown in theInstall libvpx section.

Update FFmpeg

cd ~/ffmpeg-source/ffmpeg

make distclean

git pull

Then run ./configure, make, and make install as shown in theInstall 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 ../libtheora-1.1.1

# make uninstall

cd ../libvorbis-1.3.2

# make uninstall

cd ../libvpx

# make uninstall

cd ../ffmpeg

# make uninstall

rm -rf ~/ffmpeg-source

# yum erase gcc git make nasmpkgconfig wget

 

https://ffmpeg.org/trac/ffmpeg/wiki/CentosCompilationGuide

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.