Changes between Version 10 and Version 11 of CompilationGuide/MacOSX


Ignore:
Timestamp:
Sep 14, 2012, 10:12:42 PM (5 years ago)
Author:
tedsimbajon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CompilationGuide/MacOSX

    v10 v11  
    1 Compiling on Mac OS X is as easy as any other *nix machine, there are just a few caveats. For all of the packages described here, the general procedure is "./configure --help;./configure <flags>; make && sudo make install", but some use a different configuration scheme, or none at all. 
     1Compiling on Mac OS X is as easy as any other *nix machine, there are just a few caveats. For all of the packages described here, the general procedure is "./configure --help;./configure &lt;flags&gt;; make &amp;&amp; sudo make install", but some use a different configuration scheme, or none at all.  
    22 
    3 Some of the following dependencies can also be installed with [http://mxcl.github.com/homebrew/ homebrew] or [http://www.macports.org/ macports]. 
     3Some of the following dependencies can also be installed with [http://mxcl.github.com/homebrew/ homebrew] or [http://www.macports.org/ macports].  
    44 
    5 '''Attention Lion 10.7 Users:''' Due to defects in the llvm-gcc compiler, static macros defined in FFmpeg will fail to be recognized, resulting in a fatal error. Use cc/clang instead of gcc when compiling on Lion, i.e. {{{--cc=cc --cxx=c++}}} 
     5'''Attention Lion 10.7 Users:''' Due to defects in the llvm-gcc compiler, static macros defined in FFmpeg will fail to be recognized, resulting in a fatal error.  
    66 
    7 == Dependencies == 
     7'''Solution:''' Install xCode via App Store ( This will download to the Applcations Folder). When ready, launch "xCode" and go thru the process of License aggrement.  
    88 
    9 === XCode === 
     9'''Note:''' After installing xCode, you have to install an additional component in xCode via xCode > Preferrences > Downloads and install "Command Line Tools". Then start a new terminal session and procced to FFmpeg configure and install. 
    1010 
    11 Starting 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] 
     11== Dependencies  == 
    1212 
    13 === Freetype === 
     13=== XCode === 
    1414 
    15 Mac 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`}}} before {{{./configure}}} when configuring packages that require freetype like gd and png. 
     15Starting 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 &gt; Downloads &gt; Components. Older versions are still available with an AppleID and free Developer account at [http://developer.apple.com developer.apple.com]  
    1616 
    17 === Pkg-config & GLib === 
     17=== Freetype === 
    1818 
    19 Pkg-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]. 
     19Mac 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`}}} before {{{./configure}}} when configuring packages that require freetype like gd and png.  
    2020 
    21 To compile GLib, you must also download gettext from [ftp://ftp.gnu.org/gnu/gettext/ GNU.org] and edit the file stpncpy.c to add "#undef stpncpy" just before "#ifndef weak_alias". Lion has its own (incompatible) version of the stpncpy function, which overlaps in gettext. Compile gettext as usual. Compile GLib with {{{LIBFFI_CFLAGS=-I/usr/include/ffi LIBFFI_LIBS=-lffi ./configure;make && sudo make install}}} 
     21=== Pkg-config &amp; GLib  === 
    2222 
    23 To compile pkg-config, run {{{GLIB_CFLAGS="-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include" GLIB_LIBS="-lglib-2.0 -lgio-2.0" ./configure --with-pc-path="/usr/X11/lib/pkgconfig:/usr/X11/share/pkgconfig:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig"}}} 
     23Pkg-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].  
    2424 
    25 === Yasm === 
     25To compile GLib, you must also download gettext from [ftp://ftp.gnu.org/gnu/gettext/ GNU.org] and edit the file stpncpy.c to add "#undef stpncpy" just before "#ifndef weak_alias". Lion has its own (incompatible) version of the stpncpy function, which overlaps in gettext. Compile gettext as usual. Compile GLib with {{{LIBFFI_CFLAGS=-I/usr/include/ffi LIBFFI_LIBS=-lffi ./configure;make && sudo make install}}}  
    2626 
    27 Yasm 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}}} 
     27To compile pkg-config, run {{{GLIB_CFLAGS="-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include" GLIB_LIBS="-lglib-2.0 -lgio-2.0" ./configure --with-pc-path="/usr/X11/lib/pkgconfig:/usr/X11/share/pkgconfig:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig"}}}  
    2828 
    29 == Additional libraries == 
     29=== Yasm  === 
    3030 
    31 === FAAC (AAC) === 
     31Yasm 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}}}  
    3232 
    33 FAAC is available at [http://www.audiocoding.com/downloads.html AudioCoding.com]. Enabling support in ffmpeg requires the `--enable-libfaac --enable-nonfree` configure options. 
     33== Additional libraries  == 
    3434 
    35 === Lame (MP3) === 
     35=== FAAC (AAC) === 
    3636 
    37 Lame is available from [http://sourceforge.net/projects/lame/files/lame/ Sourceforge.net], and adds MP3 encoding to FFmpeg. Enabling support in ffmpeg requires `--enable-libmp3lame`. 
     37FAAC is available at [http://www.audiocoding.com/downloads.html AudioCoding.com]. Enabling support in ffmpeg requires the `--enable-libfaac --enable-nonfree` configure options.  
    3838 
    39 === Libass === 
     39=== Lame (MP3) === 
    4040 
    41 In order to compile with `--enable-libass` you need Freetype installed. 
     41Lame is available from [http://sourceforge.net/projects/lame/files/lame/ Sourceforge.net], and adds MP3 encoding to FFmpeg. Enabling support in ffmpeg requires `--enable-libmp3lame`.  
    4242 
    43 === OpenJPEG === 
     43=== Libass === 
    4444 
    45 OpenJPEG is available at [http://code.google.com/p/openjpeg/downloads/list Code.Google.com] 
     45In order to compile with `--enable-libass` you need Freetype installed.  
    4646 
    47 === Schroedinger === 
     47=== OpenJPEG === 
    4848 
    49 Schroedinger, which adds Dirac codec support, is available from [http://diracvideo.org/ DiracVideo.org]. To compile schroedinger, you need ORC, available from [http://code.entropywave.com/download/orc/ EntropyWave.com]. Compile orc with the standard procedure, making sure you delete the "testsuite" folder, which won't compile. When compiling schroedinger, make sure pkg-config and yasm are already compiled. 
     49OpenJPEG is available at [http://code.google.com/p/openjpeg/downloads/list Code.Google.com]  
    5050 
    51 === Speex === 
     51=== Schroedinger === 
    5252 
    53 Speex is available at [http://downloads.xiph.org/releases/speex/ Xiph.org] 
     53Schroedinger, which adds Dirac codec support, is available from [http://diracvideo.org/ DiracVideo.org]. To compile schroedinger, you need ORC, available from [http://code.entropywave.com/download/orc/ EntropyWave.com]. Compile orc with the standard procedure, making sure you delete the "testsuite" folder, which won't compile. When compiling schroedinger, make sure pkg-config and yasm are already compiled.  
    5454 
    55 === Theora, Ogg, Vorbis, & SDL === 
     55=== Speex === 
    5656 
    57 All of these libraries are available at [http://theora.org/downloads/ Theora.org] 
     57Speex is available at [http://downloads.xiph.org/releases/speex/ Xiph.org]  
    5858 
    59 === VPX === 
     59=== Theora, Ogg, Vorbis, &amp; SDL === 
    6060 
    61 VPX is available at [http://code.google.com/p/webm/downloads/list Code.Google.com], make sure you compile with --enable-vp8. 
     61All of these libraries are available at [http://theora.org/downloads/ Theora.org]  
    6262 
    63 === x264 === 
     63=== VPX === 
    6464 
    65 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. 
     65VPX is available at [http://code.google.com/p/webm/downloads/list Code.Google.com], make sure you compile with --enable-vp8.  
    6666 
     67=== x264  === 
    6768 
    68 === Xvid === 
     69FFmpeg 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.  
    6970 
    70 XVid is available from [http://www.xvid.org/Downloads.43.0.html XVid.org], under Developer Downloads 
     71<br>  
    7172 
    72 == Compiling == 
     73=== Xvid  === 
     74 
     75XVid is available from [http://www.xvid.org/Downloads.43.0.html XVid.org], under Developer Downloads  
     76 
     77== Compiling  == 
    7378 
    7479Once 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:  
     
    7984make 
    8085make install 
    81 }}} 
     86}}}  
    8287 
     88<br>  
    8389 
    84 === Install qt-faststart (optional) === 
    85 This is a useful tool if you're showing your H.264 MP4 videos on the web. It relocates some data in the video to allow playback to begin before the file is completely downloaded. Usage: qt-faststart input.mp4 output.mp4. 
    86 Code: 
     90=== Install qt-faststart (optional)  === 
     91 
     92This is a useful tool if you're showing your H.264 MP4 videos on the web. It relocates some data in the video to allow playback to begin before the file is completely downloaded. Usage: qt-faststart input.mp4 output.mp4. Code:  
    8793 
    8894{{{