This is the first of a three part series covering how to convert videos using the marvellous FFMPEG library. Video converison is a must have if you are planning on creating a social network site.
In this part I’ll be covering how to install FFMPEG on Ubuntu Hardy Heron (8.04).
Install FFMPEG Dependencing
First off, you need to download and install the dependency packages for FFMPEG. Without these, it’ll all go tits. So it’s a good thing to sort out.
sudo apt-get install build-essential subversion libx264-dev libdts-dev libswscale-dev liblame-dev libfaad2-dev libfaac-dev libxvidcore4-dev liba52-0.7.4 liba52-0.7.4-dev
The lib* files help you to convert various video formats into flash videos, or which ever format you wish. Subversion is needed so you can download the FFMPEG source.
Check Out FFMPEG Source
Next, you need to checkout the current FFMPEG source from subversion. So let’s do that:
mkdir src
cd src
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg
Bosh! We now have the FFMPEG source on our server. So far so good.
Compiling FFMPEG
Now we’re ready to compile to beast. Make sure you’re in the ffmpeg directory that we just downloaded. Then run the configure command:
./configure --enable-gpl --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-liba52 --enable-libdc1394 --enable-libgsm --enable-libfaad --enable-libfaac --enable-libxvid --enable-pthreads --enable-libx264 --enable-shared--enable-postproc --enable-avfilter-lavf --enable-swscale --enable-avfilter
Then we’re ready to compile:
make
sudo make install
This will take ages. So don’t worry if it seems to be going on for a while. The last time I did it, it took about 5 minutes or so.
Hopefully, once that’s finished, you should be ready to rock.
Testing FFMPEG
Now, hold your breath and type:
ffmpeg -v
You should now get a load of blurb along the lines of:
jim@jim-ubuntu:~$ ffmpeg -v
FFmpeg version SVN-r13207, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-libvorbis --enable-libtheora --enable-liba52 --enable-libdc1394 --enable-libgsm --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-libxvid --enable-pthreads --enable-libx264 --enable-shared --enable-swscale --enable-avfilter --enable-postproc --enable-avfilter-lavf
libavutil version: 49.6.0
libavcodec version: 51.57.0
libavformat version: 52.13.0
libavdevice version: 52.0.0
libavfilter version: 0.0.0
built on May 21 2008 11:55:20, gcc: 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
ffmpeg: missing argument for option '-v'
If you don’t get anything similiar to the above, then you’ve fucked it. Check the FFMPEG docs or post here and I’ll try and help you out.
More In This Series
- Converting Videos with Rails: Installing FFMPEG
- Converting Videos with Rails: How to Convert Videos
- Converting Videos with Rails: Using Background Processes
(Possibly) Related Posts
- Converting Videos with Rails: Converting the Video
- Building a Social Network Site in Rails
- Fixing Long Key Lengths in MySQL
If you found this post or anything else on this site of any use, then please take the time to recommend me on Working with Rails.

