Changes between Initial Version and Version 1 of UbuntuCompilationGuideQuantal


Ignore:
Timestamp:
May 11, 2013, 10:41:28 PM (6 years ago)
Author:
llogan
Comment:

make initial page

Legend:

Unmodified
Added
Removed
Modified
  • UbuntuCompilationGuideQuantal

    v1 v1  
     1= Compile FFmpeg on Ubuntu 12.10, 12.04, and 11.10 =
     2
     3[[PageOutline(2, Contents)]]
     4
     5This guide supports '''Ubuntu 12.10 (Quantal Quetzal)''', '''Ubuntu 12.04 (Precise Pangolin)''', and '''Ubuntu 11.10 (Oneiric Ocelot)'''. Separate guides are available for [wiki:UbuntuCompilationGuideLucid Ubuntu 10.04 (Lucid Lynx)] and [wiki:UbuntuCompilationGuideHardy Ubuntu 8.04 (Hardy Heron)]. This guide will provide the latest FFmpeg code and enable several external encoding and decoding libraries: ''fdk-aac'' (AAC encoder), ''libfaac'' (AAC encoder), ''libmp3lame'' (MP3 encoder), ''libopencore-amr'' (AMR encoder/decoder), ''libtheora'' (Theora encoder), ''libvorbis'' (Vorbis encoder), ''libvpx'' (VP8 encoder/decoder), and ''libx264'' (H.264 encoder). These are optional and may be omitted if desired. This guide will also install many filters, including the `subtitles` filter for hardcoding subtitles (see the filter list in the [wiki:FilteringGuide#ListofFilters Filtering Guide]).
     6
     7  '''Note:''' Copy and paste the whole code box for each step.
     8
     9== Preparation ==
     10
     11Remove any existing packages:
     12{{{
     13sudo apt-get remove ffmpeg x264 libav-tools libvpx-dev libx264-dev yasm
     14}}}
     15
     16  '''Note:''' The ''multiverse'' repository must be enabled in order to install the ''libfaac-dev'' package. See [https://help.ubuntu.com/community/Repositories/Ubuntu#Adding_Repositories_in_Ubuntu more details on adding repositories].
     17
     18Get the dependencies ('''Ubuntu Desktop''' users):
     19{{{
     20sudo apt-get update
     21sudo apt-get -y install autoconf automake build-essential checkinstall git libass-dev libfaac-dev \
     22  libgpac-dev libjack-jackd2-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev \
     23  libsdl1.2-dev libspeex-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libx11-dev \
     24  libxext-dev libxfixes-dev pkg-config texi2html zlib1g-dev
     25}}}
     26
     27Get the dependencies ('''Ubuntu Server''' or headless users):
     28{{{
     29sudo apt-get update
     30sudo apt-get -y install autoconf automake build-essential checkinstall git libass-dev libfaac-dev \
     31  libgpac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev librtmp-dev libspeex-dev \
     32  libtheora-dev libtool libvorbis-dev pkg-config texi2html zlib1g-dev
     33}}}
     34
     35== Installation ==
     36
     37=== Yasm ===
     38
     39Yasm is an assembler and is recommended for x264 and FFmpeg.
     40{{{
     41cd
     42wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
     43tar xzvf yasm-1.2.0.tar.gz
     44cd yasm-1.2.0
     45./configure
     46make
     47sudo checkinstall --pkgname=yasm --pkgversion="1.2.0" --backup=no \
     48  --deldoc=yes --fstrans=no --default
     49}}}
     50
     51=== x264 ===
     52H.264 video encoder. The following commands will get the current source files, compile, and install x264. See the [wiki:x264EncodingGuide x264 Encoding Guide] for some usage examples.
     53{{{
     54cd
     55git clone --depth 1 git://git.videolan.org/x264.git
     56cd x264
     57./configure --enable-static
     58make
     59sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | \
     60  awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \
     61  --fstrans=no --default
     62}}}
     63
     64  '''Note:''' You can download the nightly [ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2 x264 source snapshot] as an alternative to using `git`.
     65
     66=== fdk-aac ===
     67AAC audio encoder.
     68{{{
     69cd
     70git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git
     71cd fdk-aac
     72autoreconf -fiv
     73./configure --disable-shared
     74make
     75sudo checkinstall --pkgname=fdk-aac --pkgversion="$(date +%Y%m%d%H%M)-git" --backup=no \
     76  --deldoc=yes --fstrans=no --default
     77}}}
     78
     79  '''Note:''' You can download a [https://github.com/mstorsjo/fdk-aac/zipball/master fdk-aac source snapshot] as an alternative to using `git`.
     80
     81=== libvpx ===
     82VP8 video encoder and decoder.
     83{{{
     84cd
     85git clone --depth 1 http://git.chromium.org/webm/libvpx.git
     86cd libvpx
     87./configure --disable-examples --disable-unit-tests
     88make
     89sudo checkinstall --pkgname=libvpx --pkgversion="1:$(date +%Y%m%d%H%M)-git" --backup=no \
     90  --deldoc=yes --fstrans=no --default
     91}}}
     92
     93  '''Note:''' You can download a [http://code.google.com/p/webm/downloads/list libvpx source snapshot] as an alternative to using `git`.
     94
     95=== opus (optional) ===
     96Opus audio encoder and decoder. Add `--enable-libopus` to your ffmpeg `./configure` line if you want to use this.
     97{{{
     98cd
     99git clone --depth 1 git://git.xiph.org/opus.git
     100cd opus
     101./autogen.sh
     102./configure --disable-shared
     103make
     104sudo checkinstall --pkgname=libopus --pkgversion="$(date +%Y%m%d%H%M)-git" --backup=no \
     105  --deldoc=yes --fstrans=no --default
     106}}}
     107
     108=== FFmpeg ===
     109
     110  '''Note:''' Ubuntu Server users should remove `--enable-x11grab` from the following command:
     111
     112{{{
     113cd
     114git clone --depth 1 git://source.ffmpeg.org/ffmpeg
     115cd ffmpeg
     116./configure --enable-gpl --enable-libass --enable-libfaac --enable-libfdk-aac --enable-libmp3lame \
     117  --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libspeex --enable-librtmp --enable-libtheora \
     118  --enable-libvorbis --enable-libvpx --enable-x11grab --enable-libx264 --enable-nonfree --enable-version3
     119make
     120sudo checkinstall --pkgname=ffmpeg --pkgversion="7:$(date +%Y%m%d%H%M)-git" --backup=no \
     121  --deldoc=yes --fstrans=no --default
     122hash -r
     123}}}
     124
     125  '''Note:''' You can download the nightly [http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 FFmpeg source snapshot] as an alternative to using `git`.
     126
     127== Finish ==
     128Installation is now complete and FFmpeg is now ready for use. You can keep the x264, libvpx, and ffmpeg directories in your home directory if you plan on updating later. See [#update Updating FFmpeg] below for more details. Some optional steps are next followed by instructions on updating FFmpeg and finally instructions on reverting all changes made by this guide.
     129
     130----
     131
     132== Optional Installation ==
     133=== qt-faststart ===
     134This is a useful tool if you're showing your H.264 in MP4 videos 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`. When converting files with ffmpeg you can add `-movflags faststart` to have the same effect.
     135{{{
     136cd ~/ffmpeg
     137make tools/qt-faststart
     138sudo checkinstall --pkgname=qt-faststart --pkgversion="$(date +%Y%m%d%H%M)-git" --backup=no \
     139  --deldoc=yes --fstrans=no --default install -Dm755 tools/qt-faststart \
     140  /usr/local/bin/qt-faststart
     141}}}
     142
     143=== Add `lavf` support to x264 ===
     144This allows x264 to accept just about any input that FFmpeg can handle and is useful if you want to use x264 directly. See a [http://ubuntuforums.org/showpost.php?p=11243462&postcount=1839 more detailed explanation] of what this means.
     145{{{
     146cd ~/x264
     147make distclean
     148./configure --enable-static
     149make
     150sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | \
     151  awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \
     152  --fstrans=no --default
     153}}}
     154
     155----
     156
     157== Updating FFmpeg ==#update
     158Development of FFmpeg and x264 is active and an occasional update can give you new features and bug fixes. First, remove some packages and then update the dependencies:
     159{{{
     160sudo apt-get -y remove ffmpeg x264 libx264-dev libvpx-dev
     161sudo apt-get update
     162sudo apt-get -y install autoconf automake build-essential checkinstall git libass-dev libfaac-dev \
     163  libgpac-dev libjack-jackd2-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev \
     164  libsdl1.2-dev libspeex-dev libtheora-dev libva-dev libvdpau-dev libvorbis-dev libx11-dev \
     165  libxext-dev libxfixes-dev texi2html yasm zlib1g-dev
     166}}}
     167
     168=== x264 ===
     169{{{
     170cd ~/x264
     171make distclean
     172git pull
     173}}}
     174Now run `./configure`, `make`, and `checkinstall` as shown in the [#x264 Install x264] section.
     175
     176=== fdk-aac ===
     177{{{
     178cd ~/fdk-aac
     179make distclean
     180git pull
     181}}}
     182Now run `./configure`, `make`, and `checkinstall` as shown in the [#fdk-aac Install fdk-aac] section.
     183
     184=== libvpx ===
     185{{{
     186cd ~/libvpx
     187make clean
     188git pull
     189}}}
     190Now run `./configure`, `make`, and `checkinstall` as shown in the [#libvpx Install libvpx] section.
     191
     192=== opus ===
     193{{{
     194cd ~/opus
     195make distclean
     196git pull
     197}}}
     198Now run `./configure`, `make`, and `checkinstall` as shown in the [#opusoptional Install opus] section.
     199
     200=== FFmpeg ===
     201{{{
     202cd ~/ffmpeg
     203make distclean
     204git pull
     205}}}
     206Now run `./configure`, `make`, and `checkinstall` as shown in the [#FFmpeg Install FFmpeg] section.
     207
     208----
     209
     210== Reverting Changes Made by This Guide ==
     211To remove FFmpeg, x264, and other packages installed for this guide:
     212{{{
     213sudo apt-get autoremove autoconf automake build-essential checkinstall fdk-aac ffmpeg git libass-dev \
     214  libfaac-dev libgpac-dev libjack-jackd2-dev libmp3lame-dev libsdl1.2-dev libspeex-dev libtheora-dev \
     215  libtool libva-dev libvdpau-dev libvorbis-dev libvpx libx11-dev libxfixes-dev opus pkg-config \
     216  qt-faststart texi2html x264 yasm zlib1g-dev
     217}}}
     218Lastly, delete the `x264`, `fdk-aac`, `libvpx`, `opus`, and `ffmpeg` directories in your home folder.
     219
     220== If You Need Help ==
     221Feel free to ask your questions at the #ffmpeg IRC channel or the [http://ffmpeg.org/contact.html ffmpeg-user] mailing list.