Install ffmpeg with xyz2rgb Video Filter

In order to add the xyz2rgb Video Filter to ffmpeg, you need to compile ffmpeg on your computer. For this, you need also to compile some libraries ffmpeg depends on. You need to be acquainted with the utilisation of the Terminal and you may also need a good texteditor (like BBEdit). The following description is valid for Macintosh OSX 10.8

Prerequisites

  • Go to AppStore and install XCode
  • Open XCode and install the Commande Line tools (X Code Preferences:Downloads:Documentation)

Install YASM Compiler, needed by OpenJPEG
http://www.tortall.net/projects/yasm/releases/yasm-1.0.0.tar.gz
cd yasm
./configure
make
sudo make install

Install OpenJPEG, the JPEG2000 codec
http://openjpeg.googlecode.com/files/openjpeg-1.5.0.tar.gz
cd openjpeg
./configure
make
sudo make install

Install x264, the h264 encoder
ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
cd x264
./configure --enable-static
make
sudo make install

You need the option because static is now disabled by default.
If you have already installed x264 with other programs, you may need to delete the instances of libx264.a

Install LAME, handles mp3
http://sourceforge.net/projects/lame/
cd lame
./configure --enable-static
make
sudo make install

Install FAAS, handles AAC
http://downloads.sourceforge.net/faac/faac-1.28.tar.gz
cd faac
./configure --prefix=/usr
make
sudo make install

Install x11, needed by libsdl
http://xquartz.macosforge.org/downloads/SL/XQuartz-2.7.4.dmg
Use installer

Install libsdl.org, needed by ffplay
http://www.libsdl.org/release/SDL-1.2.15.tar.gz
cd sdl
./configure
make
sudo make install

Install ffmpeg
http://www.belle-nuit.com/site/files/xyz2rgb.zip
http://ffmpeg.org/releases/ffmpeg-1.0.tar.bz2
(The current version http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 does not seem to work with our patch)
Place the 3 files from the ZIP into the libavfilter subdirectory. 2 files will be replaced.
cd ffmpeg
./configure --enable-libopenjpeg --enable-avfilter --enable-libx264 --enable-libmp3lame --enable-libfaac --enable-gpl --enable-nonfree
make
sudo make install

If the installation is successfull, you should be able to use ffmpeg directly from the command line.
You can avoid that make recompiles always all files: Use make - t after the first make. To force complete recompilation, use make -B.

Notes

x264 Lib already installed

If you have already installed x264 for other purposes, you may have conflicts the compiler not using the good version.
There are two workarounds:

  • I removed the old x264 library
  • You can, as somebody suggestet me, add --extra-cflags="-I/usr/local/include" --extra-ldflags="-L/usr/local/lib" to the configure string of ffmpeg so you get

./configure --enable-libopenjpeg --enable-avfilter --enable-libx264 --enable-libmp3lame --enable-libfaac --enable-gpl --enable-nonfree --extra-cflags="-I/usr/local/include" --extra-ldflags="-L/usr/local/lib"

Error

If you get the error permission denied, try sudo make instead of make

libavdevice/alldevices.c:61:1: fatal error: opening dependency file libavdevice/alldevices.d: Permission denied

See also Open Source DCP Player Proof of Concept