mdsh.com/wiki


RecentChanges

TextFormattingRules
AllWikiTopics
OrphanedWikiTopics
ToDoWikiTopics
WikiLockList
RSS
Export2HTML

WikiSearch

SetUsername

StartingPoints
Home
OSX:buildFFmpeg @Jun 4, 2011 9:42:25 PM

This is tested on Mac OS 10.6.7 (a Mac Book Pro and a MacMini)

Get essential build environment


Install Xcode 3 - you don't need to spend $5 on Xcode 4

xcode_3.2.6_and_ios_sdk_4.3.dmg

Install MacPorts

MacPorts-1.9.2-10.6-SnowLeopard.dmg

Behind a firewall


If you cannot rsync, for instance if you're in a corporation where its hard to get through firewalls, then edit /opt/local/etc/macports/sources.conf replacing the default entry at the end of the file

sudo vim /opt/local/etc/macports/sources.conf
[...]
#rsync://rsync.macports.org/release/ports/ [default]
http://www.macports.org/files/ports.tar.gz [default]


Sync the MacPorts sources, if you are in a corporation that has a proxy server you might need to set the http_proxy environment variable as I have done in this example:

sudo http_proxy=http://www-cache.reith.bbc.co.uk:80 \
/opt/local/bin/port -d sync


Get tools to build the source


sudo http_proxy=http://www-cache.reith.bbc.co.uk:80 \
/opt/local/bin/port install yasm git-core texi2html


Behind a socks proxy server?


To access source files for building parts of FFmpeg, git might need access through a SOCKS proxy:

sudo http_proxy=http://www-cache.reith.bbc.co.uk:80 \
/opt/local/bin/port install tsocks


Then, when you have to do a git clone or a git pull do this instead:

tsocks git clone git:// OR
tsocks git pull


copy the sample tsocks.conf

sudo cp -a /opt/local/etc/tsocks.conf.sample /opt/local/etc/tsocks.conf

and edit /opt/local/etc/tsocks.conf. For example, in a corporation you might need to add something like:

local = 132.0.0.0/255.0.0.0

to the local block near the top and change server and server_port to

server = 132.185.136.18
server_port = 1085
tordns_enable = false


Build other libraries


Decide and create the place where you are going to do all your building, and set an environment variable so that it is easy to script the install:

export PREFIX=/usr/local
sudo mkdir $PREFIX/src
sudo chgrp staff $PREFIX/src
sudo chmod g+w $PREFIX/src



libx264


cd $PREFIX/src
PATH=$PATH:/opt/local/bin/ \
git clone git://git.videolan.org/x264.git
cd x264

PKG_CONFIG_PATH=/opt/local/lib/pkgconfig/ \
PATH=$PATH:/opt/local/bin/ \
./configure \
--prefix=$PREFIX

PATH=$PATH:/opt/local/bin/ \
make

sudo make install


FFmpeg


cd $PREFIX/src
PATH=$PATH:/opt/local/bin/ \
git clone git://git.videolan.org/ffmpeg.git
cd ffmpeg

PKG_CONFIG_PATH=/opt/local/lib/pkgconfig/ \
PATH=$PATH:/opt/local/bin/ \
--extra-cflags='-I$PREFIX/include -I/opt/local/include' \
--extra-libs='-L$PREFIX/lib -L/opt/local/lib -mmacosx-version-min=10.5' \
--prefix=$PREFIX \
--enable-ffplay \
--enable-ffprobe \
--enable-ffserver \
--enable-shared \
--disable-indev=jack \
--cc=gcc-4.0 \
--enable-gpl \
--enable-nonfree \
--enable-pthreads \
--enable-libx264


--extra-cflags='-I$PREFIX/include -I/opt/local/include' --extra-libs='-L$PREFIX/lib -L/opt/local/lib -mmacosx-version-min=10.5' --prefix=/usr/local --enable-ffplay --enable-ffprobe --enable-ffserver --enable-shared --disable-indev=jack --cc=gcc-4.0 --enable-gpl --enable-nonfree --enable-pthreads --enable-libxvid --enable-libvorbis --enable-libspeex --enable-libtheora --enable-libfaac --enable-libdirac --enable-libmp3lame --enable-libx264 --enable-libschroedinger



PKG_CONFIG_PATH=/opt/local/lib/pkgconfig/ \
PATH=$PATH:/opt/local/bin/ \
./configure \
--prefix=$HOME/darwin-ppc \
--target-os=darwin \
--arch=ppc \
--extra-cflags="-O3 -arch ppc -mcpu=powerpc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
--extra-ldflags="-arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
--enable-gpl \
--enable-nonfree \
--enable-runtime-cpudetect \
--enable-memalign-hack \
--enable-pthreads \
--enable-static \
--disable-shared \
--disable-indev=jack \
--disable-altivec


VeryQuickWiki Version 2.8.1 | Admin

All contents copyright mdsh.com (C) 2011-2023.