MPlayer - Movie Player for LINUX (C) 2000-2001 Arpad Gereoffy (A'rpi/ESP-team)

http://www.mplayerhq.hu

[ English ] [ Hungarian ] [ German ] [ French ]


Table of Contents



1. Introduction

1.1. Overview

MPlayer is a movie player for LINUX (runs on many other Unices, and non-x86 CPUs, see section 6). It plays most MPEG, AVI and ASF/WMV files (also some QT/MOV files, with CVID, VP31 video, and raw audio), supported by many native, XAnim, and Win32 DLL codecs. You can watch VideoCD, SVCD, DVD, 3ivx, and even DivX movies too (and you don't need the avifile library at all!). The another big feature of mplayer is the wide range of supported output drivers. It works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev, AAlib, but you can use SDL (and this way all drivers of SDL) and some lowlevel card-specific drivers (for Matrox, 3Dfx and Radeon) too! Most of them supports software or hardware scaling, so you can enjoy movies in fullscreen. And what about the nice big antialiased shaded subtitles (9 supported types!!!) with european/ISO 8859-1,2 (hungarian, english, czech, etc), cyrillic, korean fonts, and OSD?

MPlayer is basically GPL, but contains some non-GPL code which is not allowed to be distributed in binary form, and also contains the OpenDivX library which has special license.

I didn't write any codecs, just some players. I spent a lot of time finding the best way to parse bad damaged input files (both MPEG and AVI) and to do perfect A-V sync with seeking ability. My player is rock solid playing damaged MPEG files (useful for some VCDs), and it plays bad AVI files which are unplayable with the famous windows media player. Even AVI files without index chunk are playable, and you can rebuild their indexes with the -idx option, thus enabling seeking! As you see, stability and quality are the most important things for me, but the speed is also amazing.

1.2. History

This began a year ago... I've tried lots of players under linux (mtv,xmps,dvdview,livid/oms,VideoLAN, xine,xanim,avifile,xmmp) but they all have some problem. Mostly with special files or with audio/video sync. Most of them is unable to play both MPEG1, MPEG2 and AVI (DivX) files. Many players have image quality or speed problems too. So I've decided to write/modify one...

1.3. Installation

You'll need the following packages and versions if you don't want to experience any problems:

Read the following before trying to compile MPlayer:

Then build MPlayer:

    ./configure
    make
    make install

It is recommended to browse the output of ./configure , it contains info about what will be built, and what won't. You may also want to view config.h and config.mak files.

Though not mandatory, the fonts should be installed in order to gain OSD, and subtitle functionality. Download mp-arial-iso-8859-*.zip and/or optional (if exists) language updates. It's VERY RECOMMENDED to check section 1.5 for details.

    mkdir ~/.mplayer/font
    cd ~/.mplayer/font
    unzip mp-arial-iso-8859-1.zip

Only one thing remains: copy the codecs.conf file from the etc directory (relative to the MPlayer tree) to $HOME/.mplayer/codecs.conf.

1.4. What about the GUI?

The GUI is built upon GTK, so gtk (and it's devel stuff) has to be installed. You can build it by specifying --enable-gui during ./configure . Then, to turn on GUI mode, you either

  • use the -gui option
  • specify gui=yes in your config file
  • ln -s /usr/local/bin/mplayer /usr/local/bin/gmplayer , and call gmplayer instead.

As MPlayer doesn't have a skin included, you have to download them if you want to use the GUI. See the download page. They should be extracted to the usual system-wide directory (/usr/local/share/mplayer/Skin), or to $HOME/.mplayer/Skin . MPlayer by default looks in these directories for a default named directory, but you can use the -skin newskin option, or the skin=newskin config file directive to use the skin in */Skin/newskin directory.

1.5. Subtitles and OSD

Yes, MPlayer also supports many kinds of subtitles. Currently 8 kinds of subtitle can be used by the subreader code. To see what are these subtitle formats, see subreader.c, line ~30.

MPlayer introduces a new subtitle format called MPsub. It was designed by me (Gabucino). Basically its main feature is being dynamically time-based (although it has frame-based mode too). Example (from DOCS/tech/mpsub.sub) :

# first number : wait this much after previous subtitle disappeared
# second number : display the current subtitle for this many seconds

15 3
A long, long time ago...

0 3
in a galaxy far away...

0 3
Naboo was under an attack.

So you see, the main goal was to make subtitle editing/timing/joining/cutting easy. And, if you - say - get an SSA subtitle but it's badly timed/delayed to your version of the movie, you simply do a mplayer dummy.avi -sub source.ssa -dumpmpsub . A dump.mpsub file will be created in the current directory, which will contain the source subtitle's text, but in MPsub format. Then you can freely add/substract seconds to/from the subtitle.

Subtitles are displayed with a technique called 'OSD', On Screen Display. OSD is used to display current time, volume bar, seek bar etc.

INSTALLING OSD and SUB

You need an MPlayer font package to be able to use OSD/SUB feature. There are many ways to get it:

  • download ready-to-use font packages from MPlayer site. Note: currently available fonts are limited for iso 8859-1/2 support, and there are a few special versions for korean, russian etc codepages. Font should have appropriate font.desc file which maps unicode font positions to the actual code page of the subtitles text. Other solution is to have subtitles encoded in utf8 encoding and use -utf8 option or just name the subtitles file .utf and have it in the same dir as the video file. Recoding from different codepages to utf8 could be done by using konwert (debian) or iconv (RedHat) programs.
    Some URLs:
  • use the font generator tool at TOOLS/subfont-c It's a complete tool to convert from TTF/Type1/etc font to mplayer font pkg. (read TOOLS/subfont-c/README for details)
  • use the font generator GIMP plugin at TOOLS/subfont-GIMP (note: you must have HSI RAW plugin too, see URL below)

After that, UNZIP the files to ~/.mplayer/font/ . Now you have to see a timer at the upper left corner of the movie (switch it off with 'o') .

OSD has 3 states: (switch with 'o')

  • timer + volume bar + seek bar + subtitles (default)
  • volume bar + seek bar + subtitles
  • subtitles only

You can change default behaviour by setting osdlevel= variable in config file.

2. Features

2.1. Video Formats, Audio & Video Codecs

2.2. Video & Audio output devices

3. Usage

  file  mplayer [options] [path/]filename
VCDmplayer [options] -vcd trackno /dev/cdrom
DVDmplayer [options] -dvd titleno [/dev/dvd]
netmplayer [options] http://site.com/file.[mpg|avi]

  mplayer -vo x11 /mnt/Films/Contact/contact2.mpg
  mplayer -vcd 2 /dev/cdrom
  mplayer -afm 3 /mnt/DVDtrailers/alien4.vob
  mplayer -dvd 1 /dev/dvd
  mplayer -abs 65536 -delay -0.4 -nobps ~/movies/test.avi

3.1. Control from keyboard

  <- or ->  seek backward/forward 10 seconds
up or downseek backward/forward 1 minute
pgup/pgdownseek backward/forward 10 minutes
p or SPACEpause movie (press any key)
q or ESCstop playing and quit program
+ or -adjust audio delay by +/- 0.1 second
/ or *decrease/increase volume
otoggle OSD: none / seek / seek+timer
mtoggle using master/pcm volume
z or xadjust subtitle delay by +/- 0.1 second

(the following keys are valid only when using DirectShow DivX codec or DivX4 codec with -vc divx4)

1 or 2adjust contrast
3 or 4adjust brightness
5 or 6adjust hue
7 or 8adjust saturation

GUI keyboard control

, and .previous / next file
gray - or +decrease / increase volume
enterstart playing
spacepause
sstop
aabout
lload file
bskin browser
etoggle equalizer
ptoggle playlist
ftoggle fullscreen
mtoggle mute

3.2. Control from LIRC

Linux Infrared Remote Control - use an easy to build home-brewn IR-receiver, an (almost) arbitrary remote control and control your linux box with it! More about it at www.lirc.org.

If you have installed the lirc-package, you can compile MPlayer with LIRC support using ./configure --enable-lirc

If everything went fine, MPlayer will print a message like LIRC init was successful. on startup. If an error occurs it will tell you. If it doens't tell you anything about LIRC there's no support compiled in. That's it :-)

The application name for MPlayer is - oh wonder - mplayer_lirc. It understands the following commands:

  PAUSE  pause playing. Any other keystroke will continue replay.
QUITexit MPlayer
RWND10 secs back
FRWND60 secs back
FWDskip 10 secs
FFWDskip 60 secs
INCVOLincrease volume one percent
DECVOLdecrease volume one percent
MASTERuse master mixer channel
PCMuse pcm mixer channel

Don't forget to enable the repeat flag for RWND/FWD in .lircrc. Here's an excerpt from my .lircrc:

  begin
   remote = CU-SX070
   prog = mplayer_lirc
   button = Tape_Play
   repeat = 1
   config = FFWD
  end

  begin
   remote = CU-SX070
   prog = mplayer_lirc
   button = Tape_Stop
   config = QUIT
  end

If you don't like the standard location for the lirc-config file (~/.lircrc) use the -lircconf <filename> switch to specify another file.

3.3. Streaming from network or pipes

MPlayer can play files from network, using the HTTP protocol. Configuring it is simple, just recompile MPlayer with

    ./configure --enable-streaming

MPlayer can NOT read ASF files from network by the MMS protocol, only by plain HTTP.

MPlayer can read from stdin (NOT named pipes). This can be for example used to play from FTP:

    wget ftp://micorsops.com/something.avi -O - | mplayer -

4. FAQ section

5. CD/DVD section

6. Misc OS'es

6.1. Debian packaging

To build the package, get the cvs version, or .tgz and uncompress it, and cd into programs directory:

    cd main
    fakeroot debian/rules binary

(... mplayer detects hardware/software, builds itself and.. ) dpkg-deb: building package `mplayer' in `../mplayer_0.18-1_i386.deb'.

And now just become root, and:

    dpkg -i ../mplayer_0.18-1_i386.deb as root.

Here's how it looks like:

	eyck@incubus:/src/main$ sudo dpkg -i ../mplayer_0.18-1_i386.deb 
	Password:
	(Reading database ... 26946 files and directories currently installed.)
	Preparing to replace mplayer 0.17a-1 (using ../mplayer_0.18-1_i386.deb)
	Unpacking replacement mplayer ...
	Setting up mplayer (0.18-1) ...

6.2. FreeBSD

To build the package you will need GNU make (gmake, /usr/ports/devel/gmake), native BSD make will not work.

To run MPlayer you will need to re-compile the kernel with "options USER_LDT" (unless you are running -CURRENT, where this is default). If you have a CPU with SSE also use "options CPU_ENABLE_SSE" to use it (FreeBSD-STABLE required, or use kernel patches).

If MPlayer complains about "CD-ROM Device '/dev/cdrom' not found!" make a symbolic link: ln -s /dev/(your_cdrom_device) /dev/cdrom

There's no DVD support for FreeBSD yet.

6.3. Solaris

MPlayer should work on Solaris 2.6 or newer.

AVI file playback works best on Solaris x86, because you have the option to use the win32 codecs on the x86 platform, or can use MMX/MMX2/3DNow/etc instructions for MP3/DivX/DVD/whatever. On Solaris SPARC, you'll find quite a few AVI files with non working video and/or audio playback, because the video/audio codecs using the Win32 DLLs are not available. However, DivX/OpenDivX movies should work, when using libavcodec.

On UltraSPARCs, MPlayer takes advantage of their VIS extensions (equivalent to MMX), currently only in libmpeg2, libvo and libavcodec, but not in mp3lib. You can watch a VOB file on a 400Mhz CPU. You'll need mLib installed.

To build the package you will need GNU make (gmake, /opt/sfw/gmake), native Solaris make will not work. Typical error you get when building with solaris' make instead of GNU make:

   % /usr/ccs/bin/make
   make: Fatal error in reader: Makefile, line 25: Unexpected end of line seen

On Solaris SPARC, you need the GNU C/C++ Compiler; it does not matter if GNU C/C++ compiler is configured with or without the GNU assembler.

On Solaris x86, you need the GNU assembler and the GNU C/C++ compiler, configured to use the GNU assembler! The mplayer code on the x86 platform makes heavy use of MMX, SSE and 3DNOW! instructions that cannot be compiled using Sun's assembler /usr/ccs/bin/as.

The configure script tries to find out, which assembler program is used by your "gcc" command (in case the autodetection fails, use the "--as=/whereever/you/have/installed/gnu-as" option to tell the configure script where it can find GNU "as" on your system).

Error message from configure on a Solaris x86 system using GCC without GNU assembler:

   % configure
   ...
   Checking assembler (/usr/ccs/bin/as) ... , failed
   Please upgrade(downgrade) binutils to 2.10.1...

(Solution: Install and use a gcc configured with "--with-as=gas")

Typical error you get when building with a GNU C compiler that does not use GNU as:

   % gmake
   ...
   gcc -c -Iloader -Ilibvo -O4 -march=i686 -mcpu=i686 -pipe -ffast-math 
	-fomit-frame-pointer  -I/usr/local/include   -o mplayer.o mplayer.c
   Assembler: mplayer.c
   "(stdin)", line 3567 : Illegal mnemonic
   "(stdin)", line 3567 : Syntax error
   ... more "Illegal mnemonic" and "Syntax error" errors ...

For DVD support you must have the patched libcss installed. Patch: http://www.tools.de/solaris/mplayer/.

Due to two bugs in solaris 8 x86, you cannot reliably play DVDs using a capacity >4GB:

On Solaris with an UltraSPARC CPU, you can get some extra speed by using the CPU's VIS instructions for certain time consuming operations. VIS acceleration can be used in MPlayer by calling functions in Sun's mediaLib.

VIS accelerated operations from mediaLib are used for mpeg2 video decoding and for color space conversion in the video output drivers.

6.4. StrongARM

MPlayer is reported to compile on StrongARM. Use the following command line:

  ./configure --target=arm-linux --disable-css --with-x11libdir=/usr/arm/lib
	      --with-x11incdir=/usr/arm/lib --disable-gcc-checking

6.5. Silicon Graphics Indigo / IRIX

Reported working. You'll probably have to use the sgi ao driver. Anyone has closer info?

Appendix A - Authors

NOTE: Do *NOT* send bugreports, help & feature requests directly to the authors!

Read Appendix C and subscribe to mplayer-users mailing lists.

The MPlayer project:

  • Árpád Gereöffy (A'rpi/ESP-team)
    • player code (mpeg stream demultiplexer and avi/asf parser, A-V sync, seek...)
    • mp3lib, based on mpglib sources [MP3 audio decoder]
    • getch2 [keyboard handler]
    • some changes in libmpeg2 code (progressive frames, bitrate & fps support)
    • libvo improvements: adding OpenGL support, bugfix in mga driver...
    • triple buffering & YUY2 support (for DivX/MPEG4) into mga_vid driver
    • scripts in the TVout directory (TVout on Matrox G400DH, read documentation)
    • hacking DivX/Mpeg4 VfW codecs to get YUV output
    • opendivx decoder speed optimizations (see opendivx/ChangeLog)
    • OSD & SUB display code
    • ffmpeg/libavcodec integration
    • DivX4Linux (ProjectMayo) support (see documentation)
    • New DVD-Support using libdvdread
    • DVB support
    • MPEG PES output
    • anything that isn't mentioned elsewhere
  • Zoltán Ponekker (Pontscho/Fresh!)
    • configure script and Makefiles for easy compile
    • GUI system
    • 3DNow! support into mp3lib
    • 3DNow! support into fastmemcpy.h
    • various X11 driver changes (keyboard handling, fullscreen, bpp detect, etc)
    • libvo: adding xmga driver, and fullscreen support to xv
    • audio mixer (volume) support
  • Gábor Lénárt (LGB)
    • ./configure script improvements
    • Makefile improvements
    • prelimenary DVD support
    • various X11 cleanups and fixes
    • HTMLization of documentation
  • Gábor Bérczi (Gabucino)
    • documentation writer & maintainer
    • hungarian translation of documentation, homepage, and help output
    • second homepage design&gfx
    • homepage maintainer
    • testing, codecs quality & speed comparsions
    • IRC channels operator (#MPlayer is user channel)
    • experimental MINIX port :) (what's funny about it?)
    • MPsub subtitle format design
  • Szabolcs Berecz (Szabi)
    • codecs.conf file parser
    • config file and command line parser
    • mga_vid fixes, module option etc.
    • fbdev support in libvo
    • type #7 subtitle support
  • László Megyer (Lez, Laaz)
    • SUB reader
    • screensaver+DPMS disable for libvo
  • Gyula László (Chass, Tégla)
    • first fonts (mp_font1.zip)
    • third (current) homepage design&gfx
  • Zoltán Márk Vicián (Se7en)
    • SVGAlib support in libvo
  • Alex Beregszaszi (Al3x)
    • ALSA output driver in libao2
    • vo_ggi output driver in libvo (www.ggi-project.org)
    • xanim codecs support (incomplete yet!)
  • Andreas Ackermann (Acki)
    • LIRC support (see documentation)
    • DGA support in libvo
  • Felix Bünemann (Atmos)
    • SDL driver maintainer
    • Additional YUV formats fixes
    • New font (mp_font2.zip)
    • PNG file output support in libvo
    • flipping support (for Indeo 3/4, etc)
    • SDL audio driver in libao2
    • RAW PCM/WAVE file writer for libao2
    • OggVorbis audio support
    • Various aspect code
    • Win32 port
  • TeLeNiEkO
    • spanish translation of documentation
  • Michael Graffam
    • XF86VidMode support to vo_x11 and vo_dga
    • Video mode switching code to vo_dga
  • Jens Hoffmann
    • Additional YUV formats support
    • found the big BITMAPINFOHEADER problem -> solved ASV2 pixelization
  • Nick Kurshev
    • memcpy optimizations for AMD K7 and Intel Pentium III (fastmemcpy.h)
    • CDROM tune info
    • further 3DNow! optimizations into mp3lib and libac3 and ffmpeg
    • russian translation of documentation
    • radeonfb
    • libvo driver: vo_vesa
  • German Gomez Garcia
    • SPDIF AC3 output for SBLive!
  • Dariush Pietrzak (Eyck)
    • debian packaging support (see debian/* and this documentation)
    • support for vplayer subtitle format
    • prelimenary support for .RT subtitle format
  • Marcus Comstedt
    • initial solaris8-x86 support
  • Jürgen Keil and Marcus Comstedt
    • patched MPlayer to work on Solaris 8 x86
    • configure fixes
    • various fixes (win32, configure, etc)
    • SUN audio driver in libao2
    • mediaLib support in libavcodec
  • Vladimir Kushnir
    • patched MPlayer to work on FreeBSD x86
  • Bertrand BAUDET
    • network streaming support
  • Artur Zaprzala
    • Complete font generator prog + OSD font (TOOLS/subfont-c)
  • lanzz@lanzz.org
    • GIMP font generator plugin (TOOLS/subfont-gimp)
  • Adam Tla/lka
    • osd/sub review, fixes, optimization, utf8 support
    • various fixes
  • Folke Ashberg
    • native AAlib driver (-vo aa)
  • Kamil Toman
    • czech fonts
  • pl
    • ./configure fixes
  • Michael Niedermayer
    • postprocessing support
    • software scaling C/MMX/MMX2/3DNow support (swscale.c)
  • Sven Goethel
    • libvo driver: vo_gl2
  • Bohdan Horst
    • iconv support on FreeBSD
  • joy_ping
    • ao_alsa9 fixes
  • Eric Anholt
    • runtime CPU detection
  • Jiri Svoboda
    • AQT type subtitles support
    • CRTC2 YUV support in mga_vid
  • Oliver Schoenbrunner
    • SGI audio driver
    • MIPS support
  • Jeroen Dobbelaere

Main testers:

  • Tibor Balázs (Tibcu)
  • Péter Sasi (SaPe)
  • Christoph H. Lampert
  • Attila Kinali
  • Dirk Vornheder

The codecs, libs:

  • Aaron Holtzman: <aholtzma@engr.uvic.ca>
    • ac3dec (and libac3) author [AC3 audio decoder]
    • mga_vid driver [Matrox G200/G400 YUV Back-end Scaler]
    • mpeg2dec [Fast MPEG1/MPEG2 video decoder, currently used in player]
  • Michel Lespinasse: <walken@zoy.org>
    • did large libmpeg2 changes for better speed and mpeg conformance
  • Eugene Kuznetsov: <divx@euro.ru>
    • avifile author [AVI player library for linux, using Win32 VfW/ACM codecs]
    • technical help about AVI and ASF formats, and how to get YUV using VfW...
    • divx4linux techical support
  • Zdenek Kabelac: <kabi@informatics.muni.cz>
    • current avifile maintainer(?)
    • some technical help about the win32 stuff and timers
  • Gerard Lantau: <glantau@yahoo.fr>
    • ffmpeg/libavcodec author,maintainer (opensource mpeg, mjpeg, divx en/decoder)
  • Project Mayo: <http://www.projectmayo.com>
    • the OpenDivX codec authors
  • Michael Hipp:
    • mpglib author [isn't used directly but some parts in mp3lib]
  • Mark Podlipec:
    • xa_gsm.c author [MS-GSM audio codec] [from a GSM library by Jutta Degener and Carsten Bormann]

Their code is not used in current player version, but I've got some ideas or other technical help from:

  • John F. McGowan http://www.jmcgowan.com/
    • AVI FAQ author/collector. [site with many useful docs on codecs and avi fmt]
  • Dirk Farin: <farin@ti.uni-mannheim.de>
    • dvdview author [MPEG1/MPEG2 video decoder, used in v0.5-v0.8]
  • Adam Williams: <broadcast@earthling.net>
    • libmpeg3 (and xmovie) author [MPEG1/MPEG2 video decoder, used in v0.1-v0.4]

Appendix A/2 - MPlayer code and documentation maintainers

Homepage

  • Design: Chass
  • Contents: Gabucino

English documentation

  • tech-hun.txt: A'rpi
  • all the others: Gabucino
  • HTMLization: LGB

Documentation translations

  • Hungarian: Gabucino
  • German: Johannes Feigl
  • French: Stephane Marteau
  • Spanish: TeLeNiEkO (outdated)
  • Russian: Nick Kurshev (outdated)
  • Polish: Dariush Pietrzak (outdated)

Platforms/ports

  • DEBIAN packaging: Dariush Pietrzak
  • FreeBSD support: Vladimir Kushnir
  • Solaris 8 support: Jürgen Keil
  • MIPS support: Oliver Schoenbrunner

MPlayer code:

  • fileformat detection, demuxers: A'rpi
  • DVD support: (alpha version was: LGB) now: A'rpi
  • network streaming: Bertrand BAUDET
  • A-V sync code: A'rpi
  • subtitles file parser/reader: Lez (most of them)
  • config files & commandline parser: Szabi
  • fastmemcpy: Nick Kurshev
  • LIRC support: Acki
  • SUB/OSD renderer: Adam Tla/lka

libvo drivers:

  • vo_3dfx.c - OBSOLETED, use xv or tdfxfb
  • vo_tdfxfb.c - Zeljko Stevanovic
  • vo_aa.c - Folke Ashberg
  • vo_dga.c - Acki
  • vo_fbdev.c - Szabi
  • vo_fsdga.c - OBSOLETED, use dga
  • vo_ggi.c - al3x
  • vo_gl.c - A'rpi
  • vo_gl2.c - Sven Goethel
  • vo_md5.c - A'rpi
  • vo_mga.c - A'rpi
  • vo_mpegpes.c - A'rpi
  • vo_null.c - A'rpi
  • vo_odivx.c - A'rpi
  • vo_pgm.c - A'rpi
  • vo_png.c - Atmos
  • vo_sdl.c - Atmos
  • vo_svga.c - se7en
  • vo_syncfb.c - OBSOLETED, use mga
  • vo_vesa.c - Nick Kurshev
  • vo_x11.c - Pontscho
  • vo_xmga.c - Pontscho
  • vo_xv.c - Pontscho

libao2 drivers:

  • ao_alsa5.c - al3x
  • ao_alsa9.c - al3x (fixed by joy_ping)
  • ao_null.c - A'rpi
  • ao_oss.c - A'rpi
  • ao_pcm.c - Atmos
  • ao_sdl.c - Atmos
  • ao_sgi.c - Oliver Schoenbrunner
  • ao_sun.c - Jürgen Keil

TOOLS:

Misc:

Appendix B - Mailing lists

There are some public mailing lists on MPlayer. Subscribing can be achieved on the following addresses: