MPlayer

From LQWiki
Jump to: navigation, search

MPlayer is a popular media player for Linux and other operating systems, that plays a very large variety of audio and video file formats (MPEG, VOB, AVI, OGG/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, FLI, RM, NuppelVideo, YUV4MPEG, FILM, RoQ, PVA files, supported by many native, XAnim, and Win32 DLL codecs, VideoCD, SVCD, DVD, 3ivx, DivX 3/4/5, WMV and more).

In contrast to other media players such as xine, MPlayer is primarily a command-line tool, although a graphical interface called gmplayer is available. Mplayer also comes with mencoder, an encoding tool that generates many of the video formats that MPlayer supports.

Note: MPlayer does not support the DVDNAV software that plays DVD menus. For menued DVD playback, an alternative player such as vlc must be used.

Installing MPlayer

To build mplayer, you need to install its dependencies first, also the software to download ("checkout") the source. For a default installation of SUSE Linux 11.3 this goes like this:

yast -i subversion gcc-c++ automake autoconf make yasm zlib-devel gtk2-devel xorg-x11-devel

Then you will be able to download, compile, link and install mplayer and its GUI like this:

svn co svn://svn.mplayerhq.hu/mplayer/trunk mplayer
cd mplayer
./configure --enable-gui && make -j4 && make install

If you get errors and do not know what to do, read Compiling software.

Using MPlayer

Invoking MPlayer

To get graphical navigation means, call

$ gmplayer

The simplest way to invoke mplayer is just to call the command with a video file, e.g.

$ mplayer myvideo.avi

To start MPlayer in a fullscreen window, use

$ mplayer -fs myvideo.avi

If you're having difficulty launching mplayer using the suggestion above, try invoking it like this

$ mplayer -vo x11 myvideo.avi

DVD Playback

As mentioned above, MPlayer does not support the playback of DVD menus. To play the first title on a DVD, use

$ mplayer dvd://

If the first title is not the main movie, try playing other titles:

$ mplayer dvd://2
$ mplayer dvd://3

Playback control

The following key commands can be used during playback to control MPlayer. (see /usr/share/mplayer/input.conf)

space or p pause / resume playback
f switch between fullscreen and windowed playback
left/right arrows skip 10 seconds forward/backward
up/down arrows skip 1 minute forward/backward
q stop playback and terminate MPlayer
0/9 or numpad * and / raise/lower volume
o switch between On Screen Display (OSD) modes.
v turn subtitles on/off
z/x raise/lower "sub delay" in increments of "-100ms"
t/r raise/lower "sub position" (subtitle position? - comments?)
a switch subtitle alignment "bottom/top/center"
c switch fullscreen display resolution
n change window playback size from 100% to 200% (anybody found out how to reverse this?)
- and + raise/lower "A-V delay" to manually ensure that audio and video stay in sync

Configuring MPlayer

MPlayer is configured through a number of configuration files, including /etc/mplayer.conf

TroubleShooting

New_Face failed

Symptome: When calling gmplayer, you get a pop-up saying "New_Face failed. Maybe the font path is wrong. Please supply the text font file (~/.mplayer/subfont.ttf)".

Reason: You have not installed mplayer's fonts.

Solution: Do as advised, point your konqueror to fonts:///, select a font you like and copy it to ~/.mplayer/subfont.ttf.

References

See also

External links