This repository contains scripts to help build MPlayer together with
some dependencies that many platforms will not have a new enough
version of. This makes it easy to compile the player against
up-to-date  library versions without needing to manually compile the
libraries first. More specifically, the scripts first compile FFmpeg
libraries and libass and then build the player statically linked
against those.

If you downloaded the tarball version of the repository then most
of the sections below do not apply. In that case see only the
following sections:
"Prerequisites"
"Basic use" (leave out the "./init" part, the tarball does not need that)
"Building"
"Giving configure options to MPlayer and FFmpeg".


CHANGES FROM EARLIER VERSIONS OF THIS FILE (2010-12-20):
FFmpeg-mt is now enabled by default in new installs (updating doesn't
change selection), player selects thread count automatically



Prerequisites

This section lists some system packages you need to have installed in
addition to a basic build environment.

The libass build system uses autotool packages (autoconf, automake, libtool).
If you compile from git you must have those installed; tarball exports
contain pregenerated files and those are not necessary.
FFmpeg needs the Yasm assembler.

Compiling with full features requires development files for several
external libraries. Below is a list of some important requirements.
Libraries specific to particular video output methods
(you'll want at least one of VDPAU, GL or Xv):
 - libvdpau (for VDPAU output, best choice for NVIDIA cards)
 - libGL (OpenGL output)
 - libXv (XVideo output)
general:
 - libasound   (ALSA audio output)
 - various general X development libraries
 - libfreetype
 - libfontconfig



Basic use

Assuming you have required system components installed, the following
commands should be enough to build the player:
$ ./init --shallow
$ make -j 6
$ make install
You can also run it like "mplayer/mplayer some_file.mkv" without doing
the last install step.
For more details see below.



Initializing the repo

First you need to download the actual sources, using either:

./init
or
./init --shallow

The latter form creates only partial git repositories which do not
have full history data. This reduces the amount of data you need to
download but reduces the development-related functionality of the
repositories. If you only want to simply build MPlayer it should
usually be enough.



Building

You can build MPlayer with just 'make'. There is no separate
configure step because the MPlayer configure depends on included
library sources being configured _and_ built first. If you want to
give configuration options see the section below.



Enabling or disabling FFmpeg-mt

FFmpeg-mt is version of FFmpeg with improved threading support, useful
for things like high-bitrate H264. It allows significantly faster
decoding on multicore machines. It is now enabled by default.
You can disable compilation with FFmpeg-mt decoders using "./disable-mt"
and enable it with "./enable-mt". By default MPlayer will try to determine
the number of cores available on your machine and use that as the number
of decoding threads. If you want to override that and use a different
number of threads you can use the "-lavdopts threads=N" option,
where N is the number of threads you want to use (a value equal to
the number of available cores is normally good).



Giving configure options to MPlayer and FFmpeg

You can specify extra options that will be passed to MPlayer's
configure script by placing them in a file called "mplayer_options" in
this directory. There's a corresponding file called "ffmpeg_options"
for FFmpeg. Options in file "common_options" will be passed to both
MPlayer and FFmpeg; this mainly makes sense for generic options like
"-cc=gcc-4.4'. Place each option on its own line without any quoting.



Helper scripts included in this repo:

./init
Prepare the repository by downloading actual sources. You need to run
this at least once before you can build anything. With the --shallow
argument creates shallow git repositories that require less bandwidth
to download.

./update
Download the latest version of the sources.

./clean
Remove all generated or extra files from build directories and
restore them to their original state. Running this between builds is
probably a good idea.

./enable-mt
./disable-mt
Enable or disable building with FFmpeg-mt support. Can be run before
first ./init or later to switch support on and off. The files
'ffmpeg-mt-enabled' and 'ffmpeg-mt-disabled' are created or deleted to
indicate whether -mt support is currently active. Note that if you
build MPlayer and then switch -mt support on or off, a rebuild is
likely to fail unless you remember to run ./clean before the new
build.
