= Compile FFmpeg on Ubuntu Lucid Lynx 10.04 LTS = [[PageOutline(2, Contents)]] This guide supports '''Ubuntu Lucid Lynx 10.

04 LTS'''. If you are using a differ ent Ubuntu version see the main [wiki:UbuntuCompilationGuide Compile FFmpeg on U buntu Guide]. This guide will enable several external encoders and decoders: ''l ibfaac'' (AAC encoder), ''libmp3lame'' (MP3 encoder), ''libopencore-amr'' (AMR e ncoder/decoder), ''libtheora'' (Theora encoder), ''libvorbis'' (Vorbis encoder), ''libvpx'' (VP8 encoder/decoder), and ''libx264'' (H.264 encoder). These are op tional and may be 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 libfaacdev \ libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev \ libvorbis-dev libx11-dev libxfixes-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 libfaacdev \ libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev pkgconfig zlib1g-dev }}} == Installation == === Yasm === Yasm is an 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 ===#x264 H.264 video encoder. The following commands will get the current source files, c ompile, and install x264. {{{ cd git clone --depth 1 git://git.videolan.org/x264 cd x264

org/showpost.99.sh)" --backup=no \ --deldoc=yes --default hash x264 ffmpeg ffplay ffprobe }}} '''Note:''' Ubuntu Server users should omit `--enable-x11grab`./version.5 .99.gz cd lame-3.tar.ffmpeg. === LAME === MP3 audio encoder.99.org/ffmpeg cd ffmpeg .sh | \ awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes }}} '''Note:''' See [http://ubuntuforums./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopenco re-amrnb \ --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-li bvpx \ --enable-libx264 --enable-nonfree --enable-version3 --enable-x11grab make sudo checkinstall --pkgname=ffmpeg --pkgversion="5:$(.git cd libvpx . `libvpx`.chromium. You can keep the ` x264`.php?p=11483157&postcount=194 5 using snapshots] if you are having connection issues with the Git server. and `ffmpeg` directories in your home directory if you plan on .gz tar xzvf lame-3.99/lame-3. {{{ cd git clone --depth 1 http://git.org/webm/libvpx.5" --backup=no --defa ult \ --deldoc=yes }}} === libvpx ===#libvpx VP8 video encoder and decoder. {{{ sudo apt-get remove libmp3lame-dev sudo apt-get install nasm cd wget http://downloads./configure --enable-static make sudo checkinstall --pkgname=x264 --default --pkgversion="3:$(.5./configure make sudo checkinstall --pkgname=libvpx --pkgversion="$(date +%Y%m%d%H%M)-git" --back up=no \ --default --deldoc=yes }}} === FFmpeg ===#ffmpeg {{{ cd git clone --depth 1 git://source.net/project/lame/lame/3.5.tar.sourceforge.99./version. == Finish == Installation is now complete and FFmpeg is now ready for use./configure --enable-nasm --disable-shared make sudo checkinstall --pkgname=lame-ffmpeg --pkgversion="3..

Usage: `qt-faststart input./configure --enable-static make sudo checkinstall --pkgname=x264 --pkgversion="3:$(. and `make install` as shown in the [#x264 Install x264] section. `make`.mp4`. See [#update Updating FFmpeg] below for more details. ---== Optional Installation == === qt-faststart === This is a useful tool if you're showing your H. Some optio nal steps are next followed by instructions on updating FFmpeg and finally instr uctions on reverting all changes made by this guide. First. remove some packages and then update the depen dencies: {{{ sudo apt-get -y remove ffmpeg x264 libx264-dev libvpx-dev sudo apt-get update sudo apt-get install -y build-essential git-core checkinstall texi2html libfaacdev \ 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 `./version.sh)" --backup =no \ --deldoc=yes --default install -Dm755 tools/qt-faststart /usr/local/bin/qt-f aststart }}} === Add `lavf` support to x264 === This allows x264 to accept just about any input that FFmpeg can handle and is us eful if you want to use x264 directly.mp4 output./version. {{{ cd ~/x264 make distclean . === libvpx === {{{ cd ~/libvpx .264 in MP4 videos on the web. It relocates some data in the video to allow playback to begin before the file is c ompletely downloaded. {{{ cd ~/ffmpeg make tools/qt-faststart sudo checkinstall --pkgname=qt-faststart --pkgversion="$(.updating later./configure`.sh | \ awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \ --fstrans=no --default }}} ---== Updating FFmpeg ==#update Development of FFmpeg and x264 is active and an occasional update can give you n ew features and bug fixes.

`libvpx`.html ffmpeg-user] mailing list. . === FFmpeg === {{{ cd ~/ffmpeg make distclean git pull }}} Now run `. and `make install` as shown in the [#libvpx Insta ll libvpx] section. delete the `x264`.2-dev libtheora-dev libvor bis-dev \ libx11-dev libxfixes-dev zlib1g-dev }}} Lastly. and `ffmpeg` directories in your home folde r./configure`. `make`. `make`. and `make install` as shown in the [#ffmpeg Insta ll FFmpeg] section.org/contact./configure`.make clean git pull }}} Now run `. ---== Reverting Changes Made by This Guide == To remove FFmpeg/x264 and other packages added for this guide: {{{ sudo apt-get remove x264 ffmpeg qt-faststart build-essential git-core checkinsta ll \ nasm yasm texi2html libfaac-dev lame-ffmpeg libsdl1. == If You Need Help == Feel free to ask your questions at the #ffmpeg IRC channel or the [http://ffmpeg .