Install FFMPEG on a Mac

ffmpeg-logo

For those that don’t know about FFmpeg, it’s a project containing a command line suite of tools that allow someone to convert quite literally any piece of media to any other piece of media.  It includes an entire library of codecs that can be used to wrangle just about any piece of video.  It includes sub-components that allow for just about infinite flexibility.  If you work in media you probably use VLC, a great tool, plays about anything.  VLC actually uses the codec library from the FFmpeg project, that’s why it works so well.  Components of FFmpeg are found in many media products.

However, one down side to FFmpeg is that it’s flexible nature can make it tricky to install.  Thankfully it has gotten easier though the simpler installation methods aren’t well published.  A friend emailed over the weekend asking how to install it on a Mac.  I promised a blog post in our community that might help him or others dealing with media.

I’ll assume you have 10.9 or newer.  There are two options for an “easy install”, Homebrew or MacPorts.  Note, don’t put Homebrew and MacPorts on the same machine, they don’t like each other, pick one or the other.

Install Xcode

  1. Install Xcode from the Mac App Store.
  2. Open Terminal, enter the following and click “accept” on the dialog box:
    xcode-select --install

Using MacPorts

  1. Get the latest MacPorts “easy installer” and install it: https://distfiles.macports.org/MacPorts/
  2. Install FFmpeg
sudo port install ffmpeg

Using Homebrew

  1. Install Homebrew with the following command:
    ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
  2. Install FFmpeg.  The command will be “brew install ffmpeg –ANY-OPTIONS-YOU-WANT”.
Example:  brew install ffmpeg --with-fdk-aac --with-tools

A couple quick notes.  You might be asking “what’s the difference between Homebrew and MacPorts?”  Well, they basically do the same thing.  Homebrew is a little easier to use, MacPorts is a little more complicated but powerful (though many would argue the point).  In truth I have just had a little easier time with MacPorts while I seem to have to wrestle a little more with Homebrew.  For instance, in this article I actually had some bugs with Homebrew I had to fight.  Conversely, the FFMPEG Project actually documents and supports Homebrew.

If there’s any interest in a “How To Use FFmpeg” post please comment!

Edit:  Here’s a list of optional installs using Homebrew

–with-fdk-aac  (Enable the Fraunhofer FDK AAC library)
–with-ffplay  (Enable FFplay media player)
–with-freetype  (Build with freetype support)
–with-frei0r  (Build with frei0r support)
–with-libass  (Enable ASS/SSA subtitle format)
–with-libcaca  (Build with libcaca support)
–with-libvo-aacenc  (Enable VisualOn AAC encoder)
–with-libvorbis  (Build with libvorbis support)
–with-libvpx  (Build with libvpx support)
–with-opencore-amr  (Build with opencore-amr support)
–with-openjpeg  (Enable JPEG 2000 image format)
–with-openssl  (Enable SSL support)
–with-opus  (Build with opus support)
–with-rtmpdump  (Enable RTMP protocol)
–with-schroedinger  (Enable Dirac video format)
–with-speex  (Build with speex support)
–with-theora  (Build with theora support)
–with-tools  (Enable additional FFmpeg tools)
–without-faac  (Build without faac support)
–without-lame  (Disable MP3 encoder)
–without-x264  (Disable H.264 encoder)
–without-xvid  (Disable Xvid MPEG-4 video encoder)
–devel  (install development version 2.1.1)
–HEAD  (install HEAD version)


This entry was posted on Monday, December 30th, 2013 at 4:45 pm and is filed under Media Distribution, Video Production. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One thought on “Install FFMPEG on a Mac

  1. Thanks for putting everything together in one place. I use Homebrew but I didn’t remember all the options 🙂
    Transcoding audio for the iPod makes the Fraunhofer AAC codec a must for me, because the quality of the other encoders is not the same. I’m now on devel with fdk.aac and extremely happy

    Thanks again!

Leave a Reply

Your email address will not be published.