MacPorts - Installing FFmpeg

 

To start, I'm a big fan of MacPorts, I've been using it since I started with OS X a few years ago. It is nice to have access to all the standard GNU tools and nice clean builds of Apache, MySQL, and PHP.

Today, I decided I wanted to install FFmpeg to use with DownloadHelper and like several people I've read about, I ran into some annoying errors.

To start, I tried the basic method of installation...

$ sudo port install ffmpeg

This threw a bunch of errors, which I didn't copy down. I remembered that I installed MacPorts, about a year ago, so I should probably just do an update. I also found that I was using XCode 3.0, while the current version is XCode 3.1. I downloaded and installed version 3.1 then started an upgrade for ports.

$ sudo port selfupdate
$ sudo port upgrade installed

The first issue occurred when doing the upgrade, xorg-renderproto would not install.
--->  Activating xorg-renderproto @0.9.3_0
Error: Target org.macports.activate returned: Image error: /opt/local/include/X11/extensions/render.h is being used by the active render port.  Please deactivate this port first, or use the -f flag to force the activation.
Error: The following dependencies failed to build: xorg-renderproto
Error: Unable to upgrade port: 1

I did a bit of reading and found that the render package is now obsolete and may be removed, so I just deactivated it.
$ sudo port deactivate render

This allowed xorg-renderproto to be installed, I just re-ran the upgrade command.

The next issue I had was with libsdl, it kept throwing errors in the Building state.

{various debug messages}
make: *** [build/SDL_x11gl.lo] Error 1

Error: Status 1 encountered during processing.

To get around this, as an experiment I tried installing libsdl without x11, as that was one of the options in the variants, this worked fine.
$ sudo port variants libsdl
libsdl has the variants:
        no_x11: Disable support for X11
        darwin_7: Platform variant, do not select manually
        darwin_8: Platform variant, do not select manually
        universal: Build for multiple architectures
$ sudo port clean libsdl
$ sudo port install libsdl +no_x11

Next up, I tried installing ffmpeg again and it worked great!
$ sudo port clean ffmpeg
$ sudo port install ffmpeg

Now FFmpeg 0.5 is installed and works great, I'm able to quickly convert FLV movies to avi.
$ ffmpeg
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --prefix=/opt/local --disable-vhook --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-avfilter-lavf --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libdirac --enable-libschroedinger --enable-libfaac --enable-libfaad --enable-libxvid --enable-libx264 --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=gcc-4.0 --disable-decoder=cavs
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 0 / 52.20. 0
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    1. 4. 0 /  1. 4. 0
  libswscale     1. 7. 1 /  1. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Mar 24 2009 11:00:50, gcc: 4.0.1 (Apple Inc. build 5490)
At least one output file must be specified