In this post I will explain how I am compiling mplayer on Mac OSX Leopard using the Uoti’s mplayer fork build script. The script automates all the build process of ffmpeg, mplayer and libass. It is better than my previous method because it includes automatically the most recent version of libass (the one coming with mplayer is ancient).
First you need to install a couple of dependencies, you could compile them manually but it is not worth the hassle. Use MacPorts instead.
sudo port install git-core autoconf automake libtool pkgconfig freetype fontconfig libiconv ncurses zlib lzo2 libpng
Now make sure your MacPorts bin directory is at the start of your PATH, this will override the automake and autoconf shipping with Leopard. Your last .bash_profile line should look something like this:
export PATH=/opt/local/bin:/opt/local/sbin:${PATH}
Download the build scripts:
git clone git://repo.or.cz/mplayer-build.git
To launch the build script you do not use the usual ./configure && make && make install, read the README for more information on how the scripts work.
Download the source code for ffmpeg, libass and mplayer, and enable multithreading in ffmpeg:
cd mplayer-build ./init ./enable-mt
Now you need to edit some configuration file or the compilation will fail. First you need to add
--cc=gcc-4.2
to the common_options file (this should be optional on Snow Leopard since it comes with gcc4.2 as default compiler).
Second add
--disable-x11 --disable-gl --disable-mencoder
to the mplayer_options file.
Third add
--enable-encoder=png
to ffmpeg_options file if you want to take screenshots with the MplayerOSX Extended GUI.
Fourth you need to remove ‘–cpu=native’, from script/ffmpeg-config and if you are on a core2 or core2duo add ‘–cpu=core2′,.
Now you are ready to compile everything, just run:
export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig" make
The build script will take care of compiling ffmpeg, libass, mplayer and then linking them together.
After you are done you should find your mplayer executable in the mplayer subdirectory.
To use your newly compiled mplayer with the MPlayerOSX Extended GUI:
cd mplayer sudo cp mplayer /Applications/MPlayer\ OSX\ Extended.app/Contents/Resources/External_Binaries/mplayer.app/Contents/MacOS/mplayer
That’s all folks! enjoy.
MacOSX: mplayer with ffmpeg-mt and ordered chapters « pigoz's blog said
[...] with 2 comments NOTE: This guide is outdated, for the current reccomended way to build mplayer please check my other post here. [...]
Adriasil said
Is it possible to do this after doing the previous outdated one?
pigoz said
Yes it is possible. If you have Snow Leopard follow the related article or download the binaries :)
Adriasil said
I just have regular leopard: do I just follow this one?
pigoz said
yes follow this one. mplayer in 64bit though is a LOT faster :p
Adriasil said
sorry I saw this post afterwards…
Adriasil said
I am getting command not found for:
–cc=gcc-4.2
pigoz said
Have you installed XCode?
Adriasil said
Yeah, I have… I’m just supposed to be using terminal for this, right?
pigoz said
no, you need to add that string to the common_options file in your mplayer-build directory.
Adriasil said
How do I do that?
(sorry I’m completely new to this.)
pigoz said
Just open the file with TexEdit, TextMate, vim, emacs or any other text editor.
Adriasil said
Open mplayer with text edit?
then what?
pigoz said
Open “common_options” with the text editor, its written clearly in the article. Then you add the –cc=gcc-4.2
Same for other configuration files.
Adriasil said
Oh, I see, sorry, Thanks a heap!