Table of Contents
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, supported by many native and Win32 DLL codecs. You can watch VideoCD, SVCD, DVD 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) 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 (7 supported types!!!) with hungarian, english, cyrillic, czech, korean fonts, and OSD?
MPlayer would be distributable under the terms of the GNU GPL, but distributing binary packages if forbidden, and the MPlayer team ignores bugreports from you if you use one! The OpenDivX code has its own 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.
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...
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_font3.zip and optional (if exists) language updates. It's VERY RECOMMENDED to check section 1.5 for details.
mkdir ~/.mplayer/font cd ~/.mplayer/font unzip mp_font3.zip unzip mp_font3_hu.zip
Only one thing remains: copy the codecs.conf file from the etc
directory (relative to the MPlayer tree) to $HOME/.mplayer/codecs.conf.
The GUI is built upon GTK, so gtk (and it's devel stuff) has to be installed.
You can build it by specifying --enable-new-gui
during ./configure .
Then, to turn on GUI mode, you either
-gui
optiongui=yes
in your config fileln -s /usr/local/bin/mplayer /usr/local/bin/gmplayer
,
and call gmplayer
instead.
Yes, MPlayer also supports many kinds of subtitles. Currently 7 kinds of subtitle can be used by the subreader code. To see what are these subtitle formats, see subreader.c, line ~20.
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:
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')
You can change default behaviour by setting osdlevel=
variable in config file.
2.1. Video Formats, Audio & Video Codecs
2.2. Video & Audio output devices
file | mplayer [options] [path/]filename | ||
VCD | mplayer [options] -vcd trackno /dev/cdrom | ||
DVD | mplayer [options] -dvd titleno [/dev/dvd] | ||
net | mplayer [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
<- or -> | seek backward/forward 10 seconds | ||
up or down | seek backward/forward 1 minute | ||
pgup/pgdown | seek backward/forward 10 minutes | ||
p or SPACE | pause movie (press any key) | ||
q or ESC | stop playing and quit program | ||
+ or - | adjust audio delay by +/- 0.1 second | ||
/ or * | decrease/increase volume | ||
o | toggle OSD: none / seek / seek+timer | ||
m | toggle using master/pcm volume | ||
z or x | adjust subtitle delay by +/- 0.1 second | ||
(the following keys are valid only when using DirectShow DivX codec) | |||
1 or 2 | adjust contrast | ||
3 or 4 | adjust brightness | ||
5 or 6 | adjust hue | ||
7 or 8 | adjust saturation | ||
GUI keyboard control
, and . | previous / next file | ||
gray - or + | decrease / increase volume | ||
enter | start playing | ||
space | pause | ||
s | stop | ||
a | about | ||
l | load file | ||
b | skin browser | ||
e | toggle equalizer | ||
p | toggle playlist | ||
f | toggle fullscreen | ||
m | toggle mute | ||
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. | ||
QUIT | exit MPlayer | ||
RWND | 10 secs back | ||
FRWND | 60 secs back | ||
FWD | skip 10 secs | ||
FFWD | skip 60 secs | ||
INCVOL | increase volume one percent | ||
DECVOL | decrease volume one percent | ||
MASTER | use master mixer channel | ||
PCM | use 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, neither with HTTP nor MMS.
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 -
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) ...
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.
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.
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
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:
Main testers:
The codecs, libs:
Their code is not used in current player version, but I've got some ideas or other technical help from:
Appendix A/2 - MPlayer code and documentation maintainers
Homepage
English documentation
Documentation translations
Platforms/ports
MPlayer code:
libvo drivers:
libao2 drivers:
TOOLS:
There are some public mailing lists on MPlayer. Subscribing can be achieved on the following addresses:
This list is about mplayer development! Talking about interface/API changes, new libraryes, code optimization, ./configure changes, and send patches here. Do NOT send bugreports, user questions, feature requests here! This list should be kept low-traffic.
Send matrox-related questions here
Things related to the hardware decoder card called DVB.
Very low traffic list :) And it's read-only. I'll post something shit there if a new release is done.
Send only questions about CVS changes here. (if you don't understand why a change is required or you've better fix) Be sure in that your target developer reads this list!
NOTE: language of above lists are ENGLISH, unless explicitly stated otherwise. Please do not send messages using other language!
Appendix C - How to report bugs
Special system/cpu-specific bugs/problems:
Various A-V sync and other audio problems:
General audio delay or jerky sound (exists with all or many files):Video-out problems:
First note: options -fs -vm and -zoom are just recommendations, not (yet) supported by all drivers. So it isn't a bug if it doesn't work. Only a few driver supports scaling/zooming, don't expect this from x11 or dga.
OSD/sub flickering:
- x11 driver: sorry, it can't be fixed now
- xv driver: use -double option