ffmpeg with x264 and libavfilter on debian squeeze
Monday, September 27th, 2010Since the deprecation of vhook, it’s hard to watermark videos in ffmpeg. With the new google summer of code changes, it’s possible to do watermarking again. The problem is, this requires building a recent version of ffmpeg. And if you want x264 support too, the package in Squeeze isn’t recent enough, so that has to be compiled too. Anyway, here’s the “guide”. It’s based off FFmpeg image overlay and install ffmpeg on Debian Lenny from SVN and x264 from GIT, with a few small adjustments.
Let’s start by installing all the dependencies for debian’s ffmpeg package:
aptitude build-dep ffmpeg
We need to add the debian-multimedia repository. Edit your sources.list:
vi /etc/apt/sources.list
Add in these lines for the debian-multimedia repository:
deb http://www.debian-multimedia.org squeeze main non-free
deb-src http://www.debian-multimedia.org squeeze main non-free
Then add the repository key so dpkg doesn’t complain (you’ll need install wget):
aptitude install wget
wget http://www.debian-multimedia.org/pool/main/d/debian-multimedia-keyring/debian-multimedia-keyring_2008.10.16_all.deb
dpkg -i debian-multimedia-keyring_2008.10.16_all.deb
Then update:
aptitude update
Now we’ll install some packages to flesh out ffmpeg’s format support:
aptitude install libmp3lame-dev libxvidcore4-dev libfaad-dev libfaac-dev liba52-0.7.4-dev
And we’ll need subversion and git to grab sources for ffmpeg and x264, respectively:
aptitude install subversion git
Now, let’s go ahead and check out the summer of code branch of ffmpeg
svn co svn://svn.ffmpeg.org/soc
cd soc/libavfilter/
./checkout.sh
cd ffmpeg/
./configure --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libgsm --enable-postproc --enable-libxvid --enable-pthreads --enable-libvorbis --enable-gpl --enable-x11grab --enable-nonfree --enable-filter=movie --enable-avfilter --enable-libfaac
At this point, the configure script will complain that “ERROR: libx264 not found”. So now it’s time to install x264:
cd ../../..
git clone git://git.videolan.org/x264.git
cd x264
./configure
make
checkinstall --fstrans=no --install=yes --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`-0.0squeeze1" --default
Now, back to ffmpeg:
cd ../soc/libavfilter/ffmpeg/
./configure --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libgsm --enable-postproc --enable-libxvid --enable-pthreads --enable-libvorbis --enable-gpl --enable-x11grab --enable-nonfree --enable-filter=movie --enable-avfilter --enable-libfaac
make
checkinstall --pkgname=ffmpeg --pkgversion "4:0.7+svn`date +%Y%m%d`" --backup=no --default
And that’s it! You now have ffmpeg on your debian squeeze system (should work fine with lenny if you change the debian-multimedia sources.list entries).
Update: Added libfaac.