Compile FFMPEG on centos 6.0

Source: Internet
Author: User

This guide is based on a minimal centos installation and Will installffmpeg with several external encoding libraries.

Note:The # indicates that the commandshoshould 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 attacker 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-libtheoraFrom
Install FFMPEGSection.

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 shocould 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 inInstall x264Section.

Update libvpx

Cd ~ /FFMPEG-source/libvpx

Make clean

Git pull

Then run./configure, make, and make install as shown inInstall libvpxSection.

Update FFMPEG

Cd ~ /FFMPEG-source/FFMPEG

Make distclean

Git pull

Then run./configure, make, and make install as shown inInstall FFMPEGSection.

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.