Changes between Initial Version and Version 1 of CompilationGuide/Ubuntu


Ignore:
Timestamp:
Apr 11, 2012, 12:48:57 AM (7 years ago)
Author:
llogan
Comment:

make initial page

Legend:

Unmodified
Added
Removed
Modified
  • CompilationGuide/Ubuntu

    v1 v1  
     1= Compile FFmpeg on Ubuntu =
     2
     3This guide provides instructions to compile and install FFmpeg, x264, libvpx, and dependencies on Ubuntu Oneiric Ocelot 11.10.
     4
     5  '''Note:''' Copy and paste the whole code box for each step.
     6
     7== Preparation ==
     8Remove any existing packages:
     9{{{
     10sudo apt-get -y remove ffmpeg x264 libvpx-dev libx264-dev
     11}}}
     12
     13Get the dependencies:
     14{{{
     15sudo apt-get update
     16sudo apt-get -y install build-essential checkinstall git libfaac-dev libjack-jackd2-dev \
     17  libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev \
     18  libva-dev libvdpau-dev libvorbis-dev libx11-dev libxfixes-dev texi2html yasm zlib1g-dev
     19}}}
     20
     21== Installation ==
     22=== x264 ===#x264
     23H.264 video encoder. The following commands will get the current source files, compile, and install x264.
     24{{{
     25cd
     26git clone git://git.videolan.org/x264
     27cd x264
     28./configure --enable-static
     29make
     30sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | \
     31  awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \
     32  --fstrans=no --default
     33}}}
     34
     35  '''Note:''' See [http://ubuntuforums.org/showpost.php?p=11483157&postcount=1945 using snapshots] if you are having connection issues with the Git server.
     36
     37=== libvpx ===#libvpx
     38VP8 video encoder and decoder.
     39{{{
     40cd
     41git clone http://git.chromium.org/webm/libvpx.git
     42cd libvpx
     43./configure
     44make
     45sudo checkinstall --pkgname=libvpx --pkgversion="1:$(date +%Y%m%d%H%M)-git" --backup=no \
     46    --deldoc=yes --fstrans=no --default
     47}}}
     48
     49=== FFmpeg ===#ffmpeg
     50{{{
     51cd
     52git clone --depth 1 git://source.ffmpeg.org/ffmpeg
     53cd ffmpeg
     54./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb \
     55    --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 \
     56    --enable-nonfree --enable-version3 --enable-x11grab
     57make
     58sudo checkinstall --pkgname=ffmpeg --pkgversion="5:$(date +%Y%m%d%H%M)-git" --backup=no \
     59  --deldoc=yes --fstrans=no --default
     60hash x264 ffmpeg ffplay ffprobe
     61}}}
     62Installation 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.
     63
     64== Optional Installation ==
     65=== qt-faststart ===
     66This 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`.
     67{{{
     68cd ~/ffmpeg
     69make tools/qt-faststart
     70sudo checkinstall --pkgname=qt-faststart --pkgversion="$(date +%Y%m%d%H%M)-git" --backup=no \
     71  --deldoc=yes --fstrans=no --default install -Dm755 tools/qt-faststart \
     72  /usr/local/bin/qt-faststart
     73}}}
     74
     75=== Add `lavf` support to x264 ===
     76This 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.
     77{{{
     78cd ~/x264
     79make distclean
     80./configure --enable-static
     81make
     82sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | \
     83  awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \
     84  --fstrans=no --default
     85}}}
     86
     87== Updating FFmpeg ==#update
     88Development 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:
     89{{{
     90sudo apt-get -y remove ffmpeg x264 libx264-dev libvpx-dev
     91sudo apt-get update
     92sudo apt-get -y install build-essential git checkinstall yasm texi2html \
     93  libfaac-dev libjack-jackd2-dev libmp3lame-dev libopencore-amrnb-dev \
     94  libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libva-dev libvdpau-dev \
     95  libvorbis-dev libx11-dev libxfixes-dev zlib1g-dev
     96}}}
     97
     98=== x264 ===
     99{{{
     100cd ~/x264
     101make distclean
     102git pull
     103}}}
     104Now run `./configure`, `make`, and `make install` as shown in the [#x264 Install x264] section.
     105
     106=== libvpx ===
     107{{{
     108cd ~/libvpx
     109make clean
     110git pull
     111}}}
     112Now run `./configure`, `make`, and `make install` as shown in the [#libvpx Install libvpx] section.
     113
     114=== FFmpeg ===
     115{{{
     116cd ~/ffmpeg
     117make distclean
     118git pull
     119}}}
     120Now run `./configure`, `make`, and `make install` as shown in the [#ffmpeg Install FFmpeg] section.
     121
     122== Reverting Changes Made by This Guide ==
     123To remove FFmpeg/x264 and other packages added for this guide:
     124{{{
     125sudo apt-get -y autoremove x264 ffmpeg qt-faststart build-essential git checkinstall \
     126  yasm texi2html libfaac-dev libjack-jackd2-dev libmp3lame-dev libsdl1.2-dev libtheora-dev \
     127  libva-dev libvdpau-dev libvorbis-dev libvpx libx11-dev libxfixes-dev zlib1g-dev
     128}}}
     129Lastly, delete the x264, libvpx, and ffmpeg directories in your home folder.
     130
     131== If You Need Help ==
     132Feel free to ask your questions at the #ffmpeg IRC channel or the [http://ffmpeg.org/contact.html ffmpeg-user] mailing list.