Changes between Version 23 and Version 24 of CompilationGuide/MacOSX
- Timestamp:
- Dec 25, 2013, 7:06:36 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CompilationGuide/MacOSX
v23 v24 1 [[PageOutline(2, Contents)]] 2 1 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. 2 3 [[BR]][[BR]]4 4 5 5 == Prerequisites and Dependencies == … … 11 11 === Homebrew === 12 12 13 To get FFmpeg for OS X, you first have to install [http://brew.sh/ Homebrew] .13 To get FFmpeg for OS X, you first have to install [http://brew.sh/ Homebrew]: 14 14 15 15 {{{ … … 19 19 === Shortcut: Compile FFmpeg through Homebrew === 20 20 21 If you want to use Homebrew for compiling, you can simply run 21 If you want to use Homebrew for compiling, you can simply run: 22 22 23 23 {{{brew install ffmpeg}}} … … 29 29 === Remaining Dependencies === 30 30 31 First, we need to install a few dependencies .31 First, we need to install a few dependencies: 32 32 33 33 {{{ 34 brew install automake celt faac fdk-aac git lame libass libtool libvorbis libvpx \ 35 libvo-aacenc opencore-amr openjpeg opus sdl schroedinger shtool speex texi2html \ 36 theora wget x264 xvid yasm 34 brew install automake fdk-aac git lame libass libtool libvorbis libvpx \ 35 opus sdl shtool texi2html theora wget x264 xvid yasm 37 36 }}} 38 37 39 Install {{{libaacplus}}} (at the moment, there is no Homebrew formula for it): 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. 40 39 41 {{{ 42 wget http://217.20.164.161/~tipok/aacplus/libaacplus-2.0.2.tar.gz 43 tar xzf libaacplus-2.0.2.tar.gz 44 cd libaacplus-2.0.2 45 # libtool on osx is quite different from the gnu libtool, which is called glibtool on osx 46 sed -i '.bck' -e 's/libtool/glibtool/' autogen.sh 47 ./autogen.sh 48 make && make install 49 cd .. 50 }}} 51 52 The new version of autoconf requires that you replace {{{AM_CONFIG_HEADER}}} in {{{configure.ac}}} at line 8 with {{{AC_CONFIG_HEADERS}}}. If you don't make this change you will see the following error message in the terminal: 53 54 {{{ 55 configure.ac:8: error: 'AM_CONFIG_HEADER': this macro is obsolete. 56 You should use the 'AC_CONFIG_HEADERS' macro instead. 57 }}} 58 59 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. 60 61 62 [[BR]][[BR]] 40 ---- 63 41 64 42 == Compile FFmpeg == 65 43 66 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-gplwill be necessary for some of the dependencies above. A sample command is: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: 67 45 68 46 {{{ 69 47 git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg 70 48 cd ffmpeg 71 ./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libaacplus \ 72 --enable-libass --enable-libcelt --enable-libfaac --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame \ 73 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-openssl \ 74 --enable-libopus --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvo-aacenc \ 75 --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --prefix=/usr/local 49 ./configure --enable-gpl --enable-version3 --enable-nonfree --enable-libass \ 50 --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus \ 51 --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 \ 52 --enable-libxvid --prefix=/usr/local 76 53 make && make install 77 54 }}} 78 55 79 Finally install {{{qt-faststart}}}. This is a useful tool if you're showing your H.264 MP4 videos on the web. It relocates the [http://www.adobe.com/devnet/video/articles/mp4_movie_atom.html MOOV atom] in the video to allow playback to begin before the file is completely downloaded. When converting files with ffmpeg you can use `-movflags faststart` to have the same effect.80 56 81 {{{ 82 make tools/qt-faststart 83 }}} 57 ---- 84 58 85 You can use it like this:86 87 {{{88 qt-faststart input.mp4 output.mp489 }}}90 91 [[BR]][[BR]]92 59 93 60 == Manual install of the dependencies without Homebrew ==
