Installing ffmpeg (and LAME) on Mac Snow Leopard and Lion

A video still created programmatically; thousands of these can be combined into video using the ffmpeg library – faster and cleaner than a clunky Final Cut project

UPDATE 2: I ran into an error trying to install ffmpeg using these instructions yesterday.  However, installing using MacPorts worked like a charm! I suggest following the instructions for installing LAME first, then use MacPorts to install ffmpeg using the following command:

UPDATE: Having switched recently to Lion, the install below didn’t quite work.  With a small tweak, it appears to be ok – see below for details.

Well, it might not be Lion (doing live musical performance with my laptop makes me leary of new operating systems) but after finding little recent info on installing ffmpeg on a Mac, I’ve put together this basic outline.  For someone who isn’t great at installing libraries using Terminal, it wasn’t completely straightforward, but it works!  You will need the Apple Developer Tools to make this work (so far as I can tell).

UPDATE: I did a fresh install of XCode and had to do one small addition to get everything to compile.  For details, see this post.

This tutorial is based on the tutorial by Stephen Jungels, with some explanation and consolidation targeted at noobs (like myself).  Definite hat tip, Stephen!

The basic steps are as follows, full details after the break:

  1. Install Git
  2. Download LAME
  3. Download ffmpeg
  4. Find or create folder to install to
  5. Install LAME
  6. Install ffmpeg
  7. Test

This is suggested by ffmpeg as the easiest way to get the most recent version.  Downloads as a compressed installer and runs really easy (like a normal program).  This is by far the most simple part of the process :(

As suggested in the tutorial I followed, this will be necessary for mp3 support (and possibly mp4) so I added it – quite easy.  Don’t install yet, just download it.

You will download ffmpeg with Git using the command line.  Open the Terminal (Applications > Utilities > Terminal)

  1. Move to your Desktop using the command:
  2. This changes directories (cd) so you will download ffmpeg to somewhere convenient
  3. Type the following command to download ffmpg:
  4. The download should begin – it may be a bit slow but should update you as it goes

In my install, I had to create the appropriate folder to install the libraries.

  1. Look in:
  2. If there is a “scr” folder in the “local” folder, move the LAME folder there; if not, you will have to create it.  My computer won’t let me make a folder there, so I made a folder titled “scr” on my desktop and copied it to the “local” folder.
  3. Copy the downloaded ffmpeg and LAME folders to the “src” folder

Now that both the LAME and ffmpeg folders have been moved to the right place, it’s time to install them.  This can be the most confusing part (I’ve found), so here we go.  First we’ll install LAME so that ffmpeg can find it (and you can use it for other projects like exporting mp3s from Audacity).

  1. Type the following command into the Terminal window but DON’T hit return yet (note: there is a space after the “cd”):
  2. Then drag the LAME folder into the Terminal window – this is a shortcut that pastes the path.  I find this really convenient for complicated paths to places on my computer I don’t use a lot.  Hit return.
  3. Type this command to configure everything for installation:
  4. A lot of lines should run – wait for them to finish and type:
  5. When that’s done, type the final step:
  6. You’ll likely have to type in your password, then LAME will install.

The last step, the slowest and most likely to cause errors, is to install ffmpeg.

  1. Move to the ffmpeg folder; type the following but DON’T hit return (like above, with a space after “cd”):
  2. Drage the ffmpeg folder into the Terminal window, hit return.
  3. For Snow Leopard: type the following command and be prepared to wait!

    Stephan’s tutorial said that everything above is necessary and I found this to be true.

    For Lion: type just the following:

  4. When that’s done, type in (both OS versions):

    … and wait some more.

  5. Finally, type in (both OS versions):

    Enter your password and let everything install.

That’s it!  To test that everything worked right, type the following commands one at a time:

If either gives you an error, something went wrong.  If you get some info about the library, you’re good to go!  I’m using this to compile video files from stills created programmatically.  I used the following tutorial by Gary Steele, which I will post about shortly – so far works great and is really fast.

Thoughts, suggestions, or problems?  Please send me an email: mail [at] jeffreythompson [dot] org

Did you find this post helpful or interesting? A small donation goes a long way towards helping produce this content. If you can't, please share what you've done with others!
Donate via Flattr

Leave a Reply

Your email address will not be published. Required fields are marked *