Changes between Version 26 and Version 27 of CompilationGuide/MacOSX
- Timestamp:
- May 3, 2014, 3:16:39 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CompilationGuide/MacOSX
v26 v27 1 [[PageOutline(1 , Contents)]]1 [[PageOutline(1-100, Contents)]] 2 2 3 3 Compiling 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. 4 4 5 = Prerequisites and Dependencies=5 == Shortcut: Compile FFmpeg through Homebrew == 6 6 7 == XCode == 7 If you want to use Homebrew for compiling, you can simply run: 8 9 {{{ 10 brew install ffmpeg 11 }}} 12 13 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. 14 15 You 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 === 8 20 9 21 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]. 10 22 11 == Homebrew==23 === Homebrew === 12 24 13 To get FFmpeg for OS X, you first have to install [http://brew.sh/ Homebrew] :25 To 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. 14 26 15 27 {{{ … … 17 29 }}} 18 30 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: 31 Then: 32 32 33 33 {{{ … … 38 38 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` 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. 39 39 40 ---- 40 === Manual install of the dependencies without Homebrew === 41 41 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 ==== 62 43 63 44 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]. … … 68 49 69 50 70 == Yasm==51 ==== Yasm ==== 71 52 72 53 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}}} 73 54 74 == Additional libraries==55 ==== Additional libraries ==== 75 56 76 These are just some examples. Run {{{. configure --help}}} for all available options.57 These are just some examples. Run {{{./configure --help}}} for all available options. 77 58 78 59 * FAAC (AAC) is available at [http://www.audiocoding.com audiocoding.com]. Enabling support in ffmpeg requires the `--enable-libfaac --enable-nonfree` configure options. … … 86 67 * 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`. 87 68 * XviD is available from [http://www.xvid.org xvid.org]. Compile with --enable-libxvid. 69 70 === Compiling === 71 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: 72 73 {{{ 74 git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg 75 cd 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 79 make && sudo make install 80 }}}
