Installing ffmpeg-php on Leopard

warning: cal_days_in_month() [function.cal-days-in-month]: invalid date. in /home/.kuddles/miltonmoura/defaultbreak.com/sites/all/modules/archive/archive.module on line 106.

What a fight!

In order to develop the new video thumbnail generator for BelaCena v2, I just spent the last 4 hours struggling to build ffmpeg-php on Leopard. Goddamnit. These things make me miss Linux :)

Anyway, off the top of my head:

  1. port install re2c
  2. grab ffmpeg from trunk
  3. compile & install ffmpeg with --enable-shared --disable-mmx --disable-vhook --enable-gpl --prefix=$FFMPEG_HOME
  4. download & extract ffmpeg-php tarball
  5. phpize; sh configure --with-php-config=$PHP_HOME/bin/php-config --with-ffmpeg=$FFMPEG_HOME; make install
  6. add extension=ffmpeg.so to your php.ini
  7. sleep

This finally worked after struggling with a ports install of ffmpeg, a php-version mismatch (I have a ports version and the one bundled with osx) and a few tens of minutes fiddling with those lousy ffmpeg configure switches and libswscale...

argh!