ItecSoftware Logo

Install ffmpeg on Mac Snow Leopard

Written by Peter Gilg on - like this:
ffmpeg on apple osx

Ffmpeg is the de-facto open source standard for encoding audio and video. Especially with the arrival of html5 which uses codecs like Ogg, Theora, Vorbis, h264, webm among others, and the increasing popularity of devices from Apple, such as iPod, iPad and the iPhone, all of which require a different standard from flv, the version so widely in use by Adobe Flash.

Another positive aspect is that ffmpeg has a much revived developer group, posed to enhance the application on a much faster pace than it has been in recent years.

Installation on Linux systems is really straight forward, especially on common distro’s like Ubuntu and Fedora. On a Mac, we will have to build it from source (if you’re not a fan of ports like me), including encoder/decoders we plan to use. Here is the breakdown to install ffmpeg on Mac OSX running Snow Leopard.

Steps to install ffmpeg on Mac OSX

Install Git

If you don’t have Git installed, download the Git installer here, install the package and run the script in the source of the mounted image. CVS is included in XCode and that is located on the snow leopard installation disc.

Install LAME (latest version from cvs)

cd ~
cvs -d:pserver:anonymous@lame.cvs.sourceforge.net:/cvsroot/lame login
(at the password prompt, press Enter)
cvs -z3 -d:pserver:anonymous@lame.cvs.sourceforge.net:/cvsroot/lame co -P lame
cd lame
./configure
make
sudo make install

Install FAAC and FAAD

cd ~
wget http://sourceforge.net/projects/faac/files/faac-src/faac-1.28/ 
  faac-1.28.tar.gz/download
tar xzvf faac-1.28.tar.gz
cd faac-1.28
./configure --with-libmp4v2
sudo make install

cd ~
wget http://sourceforge.net/projects/faac/files/faad2-src/faad2-2.7/ 
  faad2-2.7.tar.gz/download
tar xzvf faad2-2.7.tar.gz
cd faad2-2.7
./configure
make
sudo make install

Install Yasm (for faster encoding)

cd ~
wget http://www.tortall.net/projects/yasm/releases/yasm-1.1.0.tar.gz
tar xzvf yasm-1.1.0.tar.gz
cd yasm-1.1.0
./configure
make
sudo make install

Install Ogg, Vorbis and Theora

cd ~
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.4.tar.gz
tar xzvf libogg-1.1.4.tar.gz
cd libogg-1.1.4
./configure
make
sudo make install
cd ~
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.3.tar.gz
tar xzvf libvorbis-1.2.3.tar.gz
cd libvorbis-1.2.3
./configure
make
sudo make install
cd ~
wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2
tar xzvf libtheora-1.1.1.tar.bz2
cd libtheora-1.1.1
./configure
make
sudo make install

Install ffmpeg

cd ~
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc  
--enable-pthreads --enable-libfaac --enable-libfaad2 --enable-libmp3lame  
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora 
--enable-libx264 --enable-libxvid --enable-x11grab --enable-libvpx-vp8

Note

As this article matures so will new versions of the above extensions become available. Especially webm will undoubtedly see a rapid development during the coming months and you should ensure that you use the latest versions of each.

Listed in Mac, Shell Scripting, Web Development

Tags: faac, faad, ffmpeg, git, html5, lame, ogg, theora, vorbis, webm, yasm

9 responses to “Install ffmpeg on Mac Snow Leopard”

  1. A.J. says:

    I am following your tutorial, and I have a couple of questions I would like to ask you, first what is Git, and when I follow your instructions I get an error saying cvs command not found.
    thanks

  2. Peter says:

    RE: A.J. – Git is a version control system, like CVS or Subversion. Just follow the instructions on how to install the client.
    The CVS error you’re getting is because you’re missing the cvs client. Probably the easiest way to install it is by installing XCode, which is included in the OS installation disc.

  3. jason says:

    Hello, thanks for the tutorial. I installed x264, but when I configure ffmpeg:

    ./configure –enable-gpl –enable-libx264

    it says libx264 not found. Have you seen this problem?

    • jason says:

      okay, got past that hump with –enable-shared when configuring the x264. Now x264 is in the lib, and I reconfiged ffmpeg, but I still cannot encode h.264s. I get the Invalid Codec Type -1 error.

  4. david says:

    I almost got it all to work until the final task on ffmpeg. Then it threw an error.

    “Unknown option “–enable-libfaad2″.”

    • Ryan says:

      Ya same issue here.

      • Alan says:

        You can safely remove –enable-libfaad2
        Also, you can skip downloading and compiling faad as well.

        This is handled internally in ffmpeg now and makes the faad library obsolete. There were licensing issues with faad code you download and hence it was better just to create new gpl’d code to handle it.

  5. Jose Muanis says:

    Got it working with the following ffmpeg configure line. My osx is 10.6.8

    ./configure –enable-gpl –enable-version3 –enable-nonfree –enable-postproc –enable-pthreads –enable-libfaac –enable-libmp3lame –enable-libtheora –enable-x11grab

    Thanks for the tips!

  6. Elliott says:

    Jose,

    I tried your configure on 10.6.8 but it doesn’t work. it keeps saying Unknown option "–enable-libfaac". It is saying it for every term though. Any ideas? Thanks!

Leave a Reply

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