These instructions are for Ubuntu Karmic Koala 9.10. Most of the details for this guide are covered in HOWTO: Install and use the latest FFmpeg and x264. This guide is intended to quickly get you up and running with libavfilter once you are familiar with the linked HOWTO. For that reason, this guide will be as minimal as possible.
Initial Installation
1. Uninstall blockers
Code:
sudo apt-get remove ffmpeg x264 libx264-dev
2. Install dependencies
Code:
sudo apt-get update
sudo apt-get install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libfaad-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libx11-dev libxfixes-dev libxvidcore4-dev zlib1g-dev
3. Create and cd to the directory you would like your source files to live in. In my case it will be ~/ffmpeg-x264-avfilter
Code:
cd
mkdir ffmpeg-x264-avfilter
cd ffmpeg-x264-avfilter
4. Install x264 from latest sources
Code:
git clone git://git.videolan.org/x264.git
cd x264
./configure
make
sudo checkinstall --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`+`git rev-list HEAD -n 1 | head -c 7`" --backup=no --default
(Note that I'm skipping the libtheora step from the above-linked guide. If you need it, make sure to refer to that guide.)
5. Fetch libavfilter and ffmpeg sources
Code:
cd ..
svn checkout svn://svn.ffmpeg.org/soc/libavfilter
cd libavfilter
./checkout.sh
6. Make and install ffmpeg with libavfilter
Code:
cd ffmpeg
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avfilter-lavf
make
sudo checkinstall --pkgname=ffmpeg-avfilter --pkgversion "4:0.5+svn`date +%Y%m%d`" --backup=no --default
7. Verify your installation
Code:
hash ffmpeg
ffmpeg -filters
Updating to latest libavfilter Not now! Only perform this when necessary.
Code:
sudo apt-get remove ffmpeg-avfilter
cd ~/ffmpeg-x264-avfilter/
svn checkout svn://svn.ffmpeg.org/soc/libavfilter
cd libavfilter
sudo rm -rf ffmpeg
./checkout.sh
cd ffmpeg
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avfilter-lavf
make
sudo checkinstall --pkgname=ffmpeg-avfilter --pkgversion "4:0.5+svn`date +%Y%m%d`" --backup=no --default
Useful Note: It is pretty difficult to find useful documentation for libavfilter online. Point your browser at ~/ffmpeg-x264-avfilter/libavfilter/ffmpeg/doc/libavfilter.html (if you named your source directory as I did) for the full documentation on your version of libavfilter.
Another Note: libavfilter seems to be pretty unstable right now. If you'd like to try to debug a crash, invoke ffmpeg by using ~/ffmpeg-x264-avfilter/libavfilter/ffmpeg/ffmpeg_g as the command. This is the non-stripped version of ffmpeg. Alternatively you could pass --disable-stripping to the ffmpeg ./configure command (I think).
Disclaimer: This works for me with libavfilter revision 5715 -- the checkout.sh script should automatically pull in the appropriate ffmpeg version. It is possible that I have made a mistake or a typo in this guide, as I threw it together pretty quickly after I got it to work for me. Let me know any errors I may have made and I'll be happy to correct them.
Bookmarks