Changes between Version 26 and Version 27 of CompilationGuide/MacOSX


Ignore:
Timestamp:
May 3, 2014, 6:16:39 AM (6 years ago)
Author:
Timothy_Gu
Comment:

Fixes

Legend:

Unmodified
Added
Removed
Modified
  • CompilationGuide/MacOSX

    v26 v27  
    1 [[PageOutline(1, Contents)]]
     1[[PageOutline(1-100, Contents)]]
    22
    33Compiling on Mac OS X is as easy as any other *nix machine, there are just a few caveats. The general procedure is {{{./configure <flags>; make && sudo make install}}}, but some use a different configuration scheme, or none at all.  You can also install the latest stable version of FFmpeg without the need to compile it yourself, which saves you a bit of time. Just follow this guide.
    44
    5 = Prerequisites and Dependencies =
     5== Shortcut: Compile FFmpeg through Homebrew ==
    66
    7 == XCode  ==
     7If you want to use Homebrew for compiling, you can simply run:
     8
     9{{{
     10brew install ffmpeg
     11}}}
     12
     13to get the latest stable 1.x version. Call {{{brew install ffmpeg --devel}}} to install the latest 2.x version. These versions are packaged as Homebrew formulae and will take care of all the dependencies and the installation itself. If you don't know how to configure and compile a binary, you will find using Homebrew much easier. If instead you want to manually compile the latest Git version of FFmpeg, just continue with this guide.
     14
     15You can run {{{brew info ffmpeg}}} to see additional configuration options, e.g. in order to enable {{{libfdk_aac}}} or {{{libvpx}}}.
     16
     17== Compiling FFmpeg yourself ==
     18
     19=== Xcode ===
    820
    921Starting with Lion 10.7, Xcode is available for free from the Mac App Store and is required to compile anything on your Mac. Make sure you install the Command Line Tools from Preferences > Downloads > Components. Older versions are still available with an AppleID and free Developer account at [http://developer.apple.com developer.apple.com].
    1022
    11 == Homebrew ==
     23=== Homebrew ===
    1224
    13 To get FFmpeg for OS X, you first have to install [http://brew.sh/ Homebrew]:
     25To get FFmpeg for OS X, you first have to install [http://brew.sh/ Homebrew]. If you don't want to use Homebrew, see the section below.
    1426
    1527{{{
     
    1729}}}
    1830
    19 == Shortcut: Compile FFmpeg through Homebrew ==
    20 
    21 If you want to use Homebrew for compiling, you can simply run:
    22 
    23     {{{brew install ffmpeg}}}
    24 
    25 to get the latest stable 1.x version. Call {{{brew install ffmpeg --devel}}} to install the latest 2.x version. These versions are packaged as Homebrew formulae and will take care of all the dependencies and the installation itself. If you don't know how to configure and compile a binary, you will find using Homebrew much easier. If instead you want to manually compile the latest Git version of FFmpeg, just continue with this guide.
    26 
    27 You can run {{{brew info ffmpeg}}} to see additional configuration options, e.g. in order to enable {{{libfdk_aac}}} or {{{libvpx}}}.
    28 
    29 == Remaining Dependencies ==
    30 
    31 First, we need to install a few dependencies:
     31Then:
    3232
    3333{{{
     
    3838Mac OS X Lion comes with Freetype already installed (older versions may need 'X11' selected during installation), but in an atypical location: `/usr/X11`. Running `freetype-config` in Terminal can give the locations of the individual folders, like headers, and libraries, so be prepared to add lines like {{{CFLAGS=`freetype-config --cflags` LDFLAGS=`freetype-config --libs` PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig }}} before {{{./configure}}} or add them to your `$HOME/.profile` file.
    3939
    40 ----
     40=== Manual install of the dependencies without Homebrew ===
    4141
    42 = Compile FFmpeg =
    43 
    44 Once you have compiled all of the codecs/libraries you want, you can now download the FFmpeg source either with Git or the from release tarball links on the website. Study the output of {{{./configure --help}}} and make sure you've enabled all the features you want, remembering that `--enable-nonfree` and `--enable-gpl` will be necessary for some of the dependencies above. A sample command is:
    45 
    46 {{{
    47 git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
    48 cd ffmpeg
    49 ./configure  --prefix=/usr/local --enable-gpl --enable-nonfree --enable-libass \
    50 --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus \
    51 --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid
    52 make && sudo make install
    53 }}}
    54 
    55 
    56 ----
    57 
    58 
    59 = Manual install of the dependencies without Homebrew  =
    60 
    61 == Pkg-config & GLib  ==
     42==== Pkg-config & GLib  ====
    6243
    6344Pkg-config is necessary for detecting some of the libraries you can compile into FFmpeg, and it requires GLib which is not included in Mac OS X (but almost every other *nix distribution). You may either download pkg-config 0.23, or download the large tarball from [http://ftp.gnome.org/pub/GNOME/sources/glib/ Gnome.org] and compile it. Pkg-config is available from [http://pkgconfig.freedesktop.org/releases/ Freedesktop.org].
     
    6849
    6950
    70 == Yasm  ==
     51==== Yasm ====
    7152
    7253Yasm is available from [http://yasm.tortall.net/Download.html tortall.net] and is necessary for compiling C code that contains machine-independent Assembler code. To compile, run {{{./configure --enable-python; make && sudo make install}}}
    7354
    74 == Additional libraries  ==
     55==== Additional libraries ====
    7556
    76 These are just some examples. Run {{{.configure --help}}} for all available options.
     57These are just some examples. Run {{{./configure --help}}} for all available options.
    7758
    7859* FAAC (AAC) is available at [http://www.audiocoding.com audiocoding.com]. Enabling support in ffmpeg requires the `--enable-libfaac --enable-nonfree` configure options.
     
    8667* x264 is available at [http://www.videolan.org/developers/x264.html]. FFmpeg depends on x264 when compiled with `--enable-libx264` and x264 depends on FFmpeg when compiled with `--enable-lavf-input`. The best way to handle it is to install x264 first without `--enable-lavf-input`, then compile FFmpeg with `--enable-libx264` and finally compile x264 again with `--enable-lavf-input`.
    8768* XviD is available from [http://www.xvid.org xvid.org]. Compile with --enable-libxvid.
     69
     70=== Compiling ===
     71Once you have compiled all of the codecs/libraries you want, you can now download the FFmpeg source either with Git or the from release tarball links on the website. Study the output of {{{./configure --help}}} and make sure you've enabled all the features you want, remembering that `--enable-nonfree` and `--enable-gpl` will be necessary for some of the dependencies above. A sample command is:
     72
     73{{{
     74git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
     75cd ffmpeg
     76./configure  --prefix=/usr/local --enable-gpl --enable-nonfree --enable-libass \
     77--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus \
     78--enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid
     79make && sudo make install
     80}}}