Ubuntu 10.04 Recompile FFmpeg

Source: Internet
Author: User
Tags git clone

The system has ffmpeg with its own installation, such as not supporting '-LIBFAAC '


Recompile method:

Content Source: Https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuideLucid

Compile FFmpeg on Ubuntu Lucid Lynx 10.04 LTS

This guide supports Ubuntu Lucid Lynx 10.04LTS. If you are using a different Ubuntu version, the main Compile FFmpeg on Ubuntu Guide. This guide would enable several external encoders and DECODERS:LIBFAAC (AAC encoder), Libmp3lame (MP3 encoder), Libopencor E-AMR (Amr Encoder/decoder), Libtheora (Theora encoder), Libvorbis (Vorbis encoder), LIBVPX (VP8 Encoder/decoder), and Lib x264 (H.264 encoder). These are optional and may are omitted if desired.

Note: Copy and paste the whole code box for each step. Preparation

Remove any existing packages:

sudo apt-get remove ffmpeg x264 libx264-dev yasm

Get the Dependencies (Ubuntu Desktop users):

sudo apt-get update
sudo apt-get install-y build-essential git-core checkinstall texi2html libfaac-dev \
    Libopen Core-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libvorbis-dev libx11-dev
    Pkg-config Zlib1g-dev

Get the Dependencies (Ubuntu Server or headless users):

sudo apt-get update
sudo apt-get install-y build-essential git-core checkinstall texi2html libfaac-dev \
    Libopen Core-amrnb-dev libopencore-amrwb-dev Libtheora-dev Libvorbis-dev pkg-config Zlib1g-dev
installation yasm

Yasm is a assembler and is recommended for x264 and FFmpeg.

CD
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
sudo checkinstall--pkgname=yasm--pkgversion= "1.2.0"--backup=no--deldoc= Yes--default
x264

H.264 video encoder. The following commands'll get the current source files, compile, and install x264.

CD
git clone--depth 1 git://git.videolan.org/x264
cd x264
./configure--enable-static
make sudo checkinstall--pkgname=x264--default--pkgversion= "3:$ (./version.sh | \
    awk-f ' ["] '/point/{print $ "+git" $ 5} ') '--backup=no--deldoc=yes

Note: The snapshots if you are have connection issues with the Git server. LAME

MP3 Audio Encoder.

sudo apt-get remove Libmp3lame-dev
sudo apt-get install nasm
CD
wget 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-- Enable-nasm--disable-shared
make
sudo checkinstall--pkgname=lame-ffmpeg--pkgversion= "3.99.5"--backup=no --default \
    --deldoc=yes
LIBVPX

VP8 Video encoder and decoder.

CD
git clone--depth 1 http://git.chromium.org/webm/libvpx.git
cd libvpx
./configure
make sudo checkinstall--pkgname=libvpx--pkgversion= "$ (date +%y%m%d%h%m)-git"--backup=no \
    --default--deldoc=yes
FFmpeg
CD
git clone--depth 1 git://source.ffmpeg.org/ffmpeg
cd ffmpeg
./configure--ENABLE-GPL--ENABLE-LIBFAAC --enable-libmp3lame--enable-libopencore-amrnb \
    --ENABLE-LIBOPENCORE-AMRWB--enable-libtheora-- Enable-libvorbis--enable-libvpx \
    --enable-libx264--enable-nonfree--enable-version3
--enable-x11grab Make
sudo checkinstall--pkgname=ffmpeg--pkgversion= "5:$ (./version.sh)"--backup=no \
    --deldoc=yes- Default
hash x264 ffmpeg Ffplay ffprobe

Note: Ubuntu Server users should omit--enable-x11grab. Finish

Installation is now complete and FFmpeg are now ready for use. You can keep the x264, LIBVPX, and ffmpeg directories into your home directory if you are on updating later. Updating FFmpeg below for more details. Some Optional steps are next followed by instructions on updating FFmpeg and finally instructions in reverting all changes Made by this guide. Optional Installation Qt-faststart

This is a useful tool if you are showing your H.264 in MP4 on the web. It relocates Some data in the ' video to allow playback to begin before the ' file is completely downloaded. Usage:qt-faststart Input.mp4 Output.mp4.

CD ~/ffmpeg make
tools/qt-faststart
sudo checkinstall--pkgname=qt-faststart--pkgversion= "$ (./version.sh)" --backup=no \
    --deldoc=yes--default install-dm755 Tools/qt-faststart/usr/local/bin/qt-faststart
Add LAVF support to x264

This allows x264 to accept just about any input that FFmpeg can handle and are useful if you have want to use x264 directly.

CD ~/x264 make
distclean
./configure--enable-static
make
sudo checkinstall--pkgname=x264-- Pkgversion= "3:$ (./version.sh | \
  awk-f ' ["] '/point/{print $ "+git" $} ")"--backup=no--deldoc=yes \
  - Fstrans=no--default
Updating FFmpeg

Development of FFmpeg and x264 is active and a occasional update can give you new features and bug fixes. Some packages and then update the dependencies:

sudo apt-get-y remove ffmpeg x264 libx264-dev libvpx-dev
sudo apt-get update
sudo apt-get install-y ial git-core checkinstall texi2html libfaac-dev \ Libopencore-amrnb-dev Libopencore-amrwb-dev Libsdl1.2-dev
    Libtheora-dev \
    Libvorbis-dev libx11-dev libxfixes-dev pkg-config Zlib1g-dev
x264
CD ~/x264 make
distclean
git pull

Now run./configure, make, and make install as shown into the Install x264 section. LIBVPX

CD ~/libvpx make clean
git pull

Now run./configure, make, and make install as shown into the Install LIBVPX section. FFmpeg

CD ~/ffmpeg make
distclean
git pull

Now run./configure, make, and make install as shown into the Install FFmpeg section. reverting Changes Made by this Guide

To remove ffmpeg/x264 and the packages added for this guide:

sudo apt-get remove x264 ffmpeg qt-faststart build-essential git-core checkinstall \ r nasm yasm texi2html Libfaac-dev
  Lame-ffmpeg libsdl1.2-dev libtheora-dev libvorbis-dev libx11-dev libxfixes-dev
  

Lastly, delete the x264, LIBVPX, and ffmpeg directories in your home folder. If you are Need help

Feel your questions at the #ffmpeg IRC channel or the Ffmpeg-user mailing list.

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.