If you are a first-time installer: be sure to read everything from here to
the end of the Installation section, and follow the links you will find. If
you have any other questions, return to the Table of Contents and
search for the topic, read the FAQ, or try grepping
through the files.
The main rule of this documentation: if it's not documented, it
does not exist. If I don't say you encode audio from TV tuner, you
can't. A healthy quantity of combining ability is welcomed, though.
Good luck. You'll need it :) And for another good advice, let me quote
Chris Phillips from the
mplayer-users
mailing list:
I said a while ago that there is such a difference between a newbie and
a dumbass. No matter what you actually know about a system (linux, cars,
girls :D) you should ALWAYS be able to take a step back and be objective,
otherwise, you're just dumb IMHO. A girl i live with assumed the vacuum
cleaner was broken because it didn't suck things up. never thought to change
the bag, becasue she'd never done it before... now that's just stupid, not a
case of simply not knowing what to do... Simply not being that familiar with
your surroundings is no excuse for a) laziness and b) ignorance. So many
people seem to see the word "error" and then stop... few seem to actually
read the words on the OTHER side of the colon.
MPlayer is a movie player for LINUX (runs on many other Unices, and
non-x86 CPUs, see the ports section). It plays most
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, RealPlayer, and
Win32 DLL codecs. You can watch VideoCD, SVCD, DVD,
3ivx, RealMedia, and DivX movies too (and you don't need
the avifile
library at all!). Another big feature of MPlayer is the wide range of
supported output drivers. It works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev,
AAlib, DirectFB, but you can also use GGI and SDL (and this way all their
drivers) and some lowlevel card-specific drivers (for Matrox, 3Dfx and Radeon,
Mach64, Permedia3) too! Most
of them supports software or hardware scaling, so you can enjoy movies in
fullscreen. MPlayer supports displaying through some hardware MPEG
decoder boards, such as the DVB and
DXR3/Hollywood+. And what about the nice big antialiased
shaded subtitles (10 supported types) with European/ISO 8859-1,2
(Hungarian, English, Czech, etc), Cyrillic, Korean fonts, and the onscreen
display (OSD)?
The 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 temporarily rebuild their indexes with the -idx option, or
permanently with MEncoder, thus enabling seeking!
As you see, stability and quality are the most important things,
but the speed is also amazing.
MEncoder (MPlayer's Movie Encoder) is a simple movie encoder,
designed to encode MPlayer-playable movies
(AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET/PVA) to other
MPlayer-playable formats (see below). It can encode with various codecs, like
DivX4 (1 or 2 passes), libavcodec,
PCM/MP3/VBR MP3 audio. Also has powerful plugin system
for video manipulation.
MEncoder features
encoding from the wide range of fileformats and decoders of MPlayer
encoding/multiplexing to interleaved AVI files with proper index
creating files from external audio stream
1, 2 or 3 pass encoding
VBR MP3 audio - IMPORTANT NOTE: VBR MP3 audio doesn't
always play nicely on Windows players! On the other hand, currently
MEncoder's CBR encoding is totally broken on Win32 players :)
PCM audio
stream copying
input A/V synchronizing (PTS-based, can be disabled with -mc 0 option)
FPS correction with -ofps option (useful when encoding
29.97fps VOB to 24fps AVI)
using our very powerful plugin system (crop, expand, flip, postprocess,
rotate, scale, rgb/yuv conversion)
can encode DVD/VOBsub AND text subtitles into the output file
can rip DVD subtitles to Vobsub format
Planned features
even wider variety of available en/decoding formats/codecs
(creating VOB files with DivX4/Indeo5/VIVO streams :)
MPlayer and MEncoder can be distributed under the terms of the GNU General
Public License Version 2.
This began a year ago...
I (A'rpi) have 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...
mpg12play v0.1-v0.3: Sep 22-25, 2000
The first try, hacked together in a half hour!
I've used libmpeg3 from www.heroinewarrior.com up to the version 0.3,
but there were image quality and speed problems with it.
mpg12play v0.5-v0.87: Sep 28-Oct 20, 2000
Mpeg codec replaced with DVDview by Dirk Farin, it was a great stuff,
but it was slow and was written in C++ (I hate C++!!!)
mpg12play v0.9-v0.95pre5: Oct 21-Nov 2, 2000
Mpeg codec was libmpeg2 (mpeg2dec) by Aaron Holtzman & Michel Lespinasse.
It's great, optimized very fast C code with perfect image quality and
100% MPEG standard conformance.
MPlayer v0.01: Nov 11, 2000
The first MPlayer.
MPlayer v0.3-v0.9: Nov 18-Dec 4, 2000
It was a pack of two programs: mpg12play v0.95pre6 and my new simple AVI
player 'avip' based on avifile's Win32 DLL loader.
MPlayer v0.10: Jan 1, 2001
The MPEG and AVI player in a single binary!
MPlayer v0.11pre series:
Some new developers joined and from 0.11 the mplayer project is a team-work!
Added .ASF file support, and OpenDivX (see www.projectmayo.com) en/decoding.
MPlayer v0.17a "The IdegCounter" Apr 27, 2001
The release version of the 0.11pre after 4 months of heavy development!
Try it, and be amazed! Thousands of new features added... and of course
old code was improved too, bugs removed etc.
MPlayer 0.18 "The BugCounter" Jul 9, 2001
2 months since 0.17 and here's a new release.. Completed ASF support,
more subtitle formats, introduced libao (similar to libvo but to audio),
even more stable than ever, and so on. It's a MUST!
MPlayer 0.50 "The Faszom(C)ounter" Oct 8, 2001
Hmm. Release again. Tons of new features, beta GUI version, bugs fixed,
new vo and ao drivers, ported to many systems, including opensource DivX
codecs and much more. Try it!
MPlayer 0.60 "The RTFMCounter" Jan 3, 2002
MOV/VIVO/RM/FLI/NUV fileformats support, native CRAM, Cinepak, ADPCM codecs,
and support for XAnim's binary codecs; DVD subtitles support, first
release of MEncoder, TV grabbing, cache, liba52, countless fixes.
MPlayer 0.90pre10 "The BirthdayCounter" Nov 11, 2002
Although this is not a release, I am going to mention it because it
came out 2 years after MPlayer v0.01. Happy birthday, MPlayer!
MPlayer 0.90rc1 "The CodecCounter" Dec 7, 2002
Again not a release, but after adding Sorenson 3 (QuickTime) and Windows
Media 9 support, MPlayer is the world's first movie player with support
for all known video formats!
In this chapter I'll try to guide you through the compiling and
configuring process of MPlayer. It's not easy, but it won't necessarily
be hard. If you experience a different behavior than what I explain, please
search through this documentation and you'll find your answers. If you
see links, please follow them and read carefully what they contain. It
will take some time, but it DOES worth it.
You need a fairly recent system. On Linux, 2.4.x kernels are recommended.
Software requirements:
binutils - suggested version is 2.11.x . This program is
responsible for generating MMX/3DNow!/etc instructions, thus very important.
gcc - suggested versions are: 2.95.3, 2.95.4 and 3.1.
NEVER use 2.96 or 3.0.x! They generate faulty code for MPlayer.
If you decide to change gcc from 2.96, then don't decide in favor of 3.0.x
just because it's newer! Early releases of 3.0.x were even more buggy than
2.96. So downgrade to 2.95.x (downgrade libstdc++ too, other programs may
need it) or don't up/downgrade at all (but in this case, be prepared for
runtime problems). If you vote for 3.x.x, try to use the latest version,
early releases had various bugs, so be sure you use at least 3.1, it's
tested and working. For detailed information about gcc 2.96's bugs (that are
still NOT fixed, they have been WORKED AROUND in MPlayer!), see the
gcc 2.96 section and the
FAQ.
XFree86 - suggested version is always the newest (4.2.1).
Normally, everyone wants this, as starting with XFree86 4.0.2, it contains
the XVideo extension (somewhere referred to
as Xv) which is needed to enable the hardware YUV acceleration (fast
image display) on cards that support it.
Make sure its development package is installed, too, otherwise
it won't work.
For some video cards you don't need XFree86. See list below.
make - suggested version is always the newest (at least 3.79.x). This
usually isn't important.
SDL - it's not mandatory, but can help in some cases (bad audio,
video cards that lag strangely with the xv driver). Always use the newest
(beginning from 1.2.x).
libjpeg - optional JPEG decoder, used by -mf and some QT MOV files.
Useful for both MPlayer and MEncoder if you plan to work with jpeg files.
libpng - recommended and default (M)PNG decoder. Required for GUI.
Useful for both MPlayer and MEncoder.
lame - recommended, needed for encoding MP3 audio with MEncoder,
suggested version is always the newest (at least 3.90).
libogg - optional, needed for playing OGG file format.
libvorbis - optional, needed for playing OGG Vorbis audio.
libfreetype - optional, for TTF fonts support. At least 2.0.9 is
required.
libxmms - optional, for XMMS input plugin support. At least 1.2.7 is
required.
Codecs:
libavcodec: This codec package is capable of decoding
H263/MJPEG/RV10/DivX3/DivX4/DivX5/MP41/MP42/WMV1 encoded video streams and
WMA (Windows Media Audio) v1/v2 audio streams, on
multiple platforms. It is also known to be the fastest for this task.
See the libavcodec section for details.
Features:
gain decoding of videos mentioned above, on non-x86 machines
encoding with most of the mentioned codecs
this codec is the fastest codec available for DivX/3/4/5 and
other MPEG4 types. Recommended!
Win32 codecs: If you plan to use MPlayer on x86
architecture, you will possibly need them. Download and unzip w32codecs.zip
to /usr/lib/win32 BEFORE compiling MPlayer, otherwise no Win32
support will be compiled! Note: the avifile project has a similar codecs package, but it differs
from ours. If you want to use all supported codecs, then install our package
(do not worry, avifile works with it without problems). Features:
you need this if you want to play or encode for example movies recorded
with various hardware compressors, like tuner cards, digital cameras
(example: DV, ATI VCR, MJPEG)
needed if you want to play WMV8, WMV9/WMA9 movies.
Not needed for old
ASF's with MP41 or MP42 video (though VoxWare audio is frequent for these
files - it's done by the Win32 codec), or WMV7. Also not needed
for WMA (Windows Media Audio), libavcodec has opensource decoder
for that.
QuickTime codecs: on x86 platforms these codecs can be used
to decode Sorenson v1/v3, RPZA, and other QuickTime video, and
QDesign audio streams. Installation instructions can be found in the
Sorenson video codec section.
DivX4/DivX5: information about this codec is available in the
DivX4/DivX5 section. You possibly don't want
this codec as libavcodec (see above) is much faster and has better
quality than this, for both decoding and encoding.
Features:
it's about 2 times faster than DivX4 when encoding - about the same
quality
The XAnim codecs are the best (full
screen, hardware YUV zoom) for decoding 3ivx and Indeo 3/4/5 movies,
and some old formats. And they are multiplatform, so this is the only way to
play Indeo on non-x86 platforms (well, apart from using XAnim:). But for
example Cinepak movies are best played with MPlayer's own Cinepak
decoder!
For Ogg Vorbis audio decoding you need to install
libvorbis properly. Use deb/rpm packages if available, or
compile from
source
(this is a nightly updated tarball of Vorbis CVS).
MPlayer can use the libraries of RealPlayer 8 or RealONE to play
files with RealVideo 2.0 - 4.0 video, and Sipro/Cook audio. See
RealMedia file format section for
installation instructions and more information.
Video Cards
There are generally two kind of video cards. One kind (the newer cards) has
hardware scaling and YUV acceleration support, the other cards don't.
YUV cards
They can display and scale (zoom) the picture to any size that fits in
their memory, with small CPU usage (even when zooming), thus
fullscreen playing is nice and very fast.
Matrox G200/G400/G450/G550 cards: although a
Vidix driver is provided, it is recommended
to use the mga_vid kernel module instead, for it works much better.
Please see the mga_vid section about its
installation and usage. It is important to do these steps before
compiling MPlayer, otherwise no mga_vid support will be built. Also
check out the Matrox TV-out section.
If you don't use Linux, your only possibility is the VIDIX
driver: read the VIDIX section.
3Dfx Voodoo3/Banshee cards: please see the
tdfxfb section in order to gain big
speedup. It is important to do these steps before compiling
MPlayer, otherwise no 3Dfx support will be built. Also see the 3dfx TV-out section. If you use X, use
at least 4.2.0, as the 3dfx Xv driver was broken in 4.1.0 and earlier
releases.
ATI cards: Vidix driver is
provided for the following cards:
Radeon, Rage128, Mach64 (Rage XL/Mobility, Xpert98).
Also see the ATI cards
section of the TV-out documentation, to know if you card's TV-out is
supported under Linux/MPlayer.
S3 cards: the Savage and Virge/DX chips have hardware acceleration.
Use as new XFree86 version as possible, older drivers are buggy. Savage chips
have problems with YV12 display, see S3 Xv
section for details. Older, Trio cards have no, or slow hardware
support.
nVidia cards: may or may not be good choice for video playing.
If you do not have a GeForce2 (or newer) card, it's not likely to work
without bugs.
The built-in nVidia driver in XFree86 does not support hardware YUV
acceleration on all nVidia cards. You have to download nVidia's
closed-source drivers from nVidia.com. See the
nVidia Xv driver section for
details. Please also check the nVidia
TV-out section if you wish to use a TV.
3DLabs GLINT R3 and Permedia3: a VIDIX driver is provided
(pm3_vid). Please see the VIDIX section for
details.
Other cards: None of the above?
Try if the XFree86 driver (and your card) supports hardware
acceleration. See the Xv section for
details.
If it doesn't, then your card's video features aren't supported under
your operating system :(
If hardware scaling works under Windows, it doesn't mean it will work
under Linux or other operating systems: it depends on the drivers. Most
manufacturers neither make Linux drivers nor release specifications
for their chips, so you are unlucky using their cards.
See 'Non-YUV cards'.
Non-YUV cards
Fullscreen playing can be achieved by either enabling software scaling
(use the -zoom or -vop scale
option, but I warn you: this is slow), or switching to a small resolution
video mode, for example 352x288. If you don't have YUV acceleration, the
latter method is recommended. Video mode switching can be enabled by
using the -vm option and it works with the following drivers:
using XFree86: see the
DGA driver and
X11 driver sections for details. DGA is
recommended! Also try DGA via SDL, sometimes it's better.
not using XFree86: try the drivers in the following order:
vesa,
fbdev,
svgalib,
aalib.
Some cards:
Cirrus Logic cards:
GD 7548: present on-board and tested in Compaq Armada 41xx notebook
series.
XFree86 3: works in 8/16bpp modes. However, the driver is
dramatically slow and buggy in 800x600@16bpp.
Recommended: 640x480@16bpp
XFree86 4: the Xserver freezes soon after start unless
acceleration is disabled, but then the whole thing gets
slower than XFree86 3. No XVideo.
FBdev: framebuffer can be turned on with the clgenfb
driver in the kernel, though for me it worked only in 8bpp, thus
unusable. The clgenfb source had to be extended with the 7548 ID
before compilation.
VESA: the card is only VBE 1.2 capable, so VESA output can't be
used. Can't be workarounded with UniVBE.
SVGAlib: detects an older Cirrus chip. Usable but slow with
-bpp 8.
Sound cards:
Soundblaster Live!: with this card you can use 4 or 6 (5.1)
channels AC3 decoding instead of 2. Read the
Software AC3 decoding section.
For hardware AC3 passthrough you must use ALSA 0.9 with OSS emulation!
C-Media with SP/DIF out: hardware AC3 passthrough is possible
with these cards, see
Hardware AC3 decoding section.
Features of other cards aren't supported by MPlayer.
It's very recommended to read the sound card
section!
Features:
Decide if you need GUI. If you do, see the GUI section
before compiling.
If you want to install MEncoder (our great all-purpose encoder),
see the MEncoder section.
If you have a V4L compatible TV tuner card, and wish to watch/grab
and encode movies with MPlayer, read the TV input
section.
There is a neat OSD Menu support ready to be used. Check the
OSD Menu section.
Then build MPlayer:
./configure
make
make install
At this point, MPlayer is ready to use. The directory
$PREFIX/etc/mplayer contains the codecs.conf
file, which is used to tell the program all the codecs and their
capabilities. This file should always be kept up to date together with the
main binary.
Check if you have codecs.conf in your home directory
(~/.mplayer/codecs.conf) left from old MPlayer versions, and remove it.
Debian users can build a .deb package for themselves,
it's very simple. Just exec fakeroot debian/rules binary in
MPlayer's root directory. See
Debian packaging for detailed
instructions.
Always browse the output of ./configure, and the
configure.log file, they contain information about what will be
built, and what will not. You may also want to view config.h and
config.mak files.
If you have some libraries installed, but not detected by
./configure, then check if you also have the proper header files
(usually the -dev packages) and their version matches. The
configure.log file usually tells you what is missing.
Though not mandatory, the fonts should be installed in order to gain OSD,
and subtitle functionality. The recommended method is installing a TTF
font file and telling MPlayer to use it. See the
Subtitles and OSD section for details.
The GUI needs GTK (it isn't GTK, but the panels are). The skins are stored
in PNG format, so gtk, libpng (and their devel stuff) has to be installed.
You can build it by specifying --enable-gui during
./configure. Then, to turn on GUI mode, you either
specify gui=yes in your config file
ln -s $PREFIX/bin/mplayer $PREFIX/bin/gmplayer ,
and call gmplayer instead.
Currently you can't use the -gui option on the command line,
due to technical reasons.
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
($PREFIX/share/mplayer/Skin), or to
$HOME/.mplayer/Skin. MPlayer by default looks in these
directories for a directory named default, but you can use the
-skin newskin option, or the skin=newskin config
file directive to use the skin in */Skin/newskin directory.
MPlayer can display subtitles along with movie files. Currently the following
formats are supported:
VobSub
Microdvd
SubRip
SubViewer
Sami
VPlayer
RT
SSA
MPsub
AQTitle
JACOsub
MPlayer can dump the previously listed subtitle formats into the following
destination formats, with the given options:
MPsub: -dumpmpsub
SubRip: -dumpsrtsub
Microdvd: -dumpmicrodvdsub
JACOsub: -dumpjacosub
Sami: -dumpsami
The command line options differ slightly for the different formats:
VobSub subtitles
VobSub subtitles consist of a big (some megabytes) .SUB file, and optional
.IDX and/or .IFO files.
Usage: If you have files like sample.sub,
sample.ifo (optional), sample.idx - you have to pass
MPlayer the -vobsub sample [-vobsubid <id>] options (full
path optional). The -vobsubid option is like -sid
for DVDs, you can choose between subtitle tracks (languages) with it. In case
that -vobsubid is omitted, MPlayer will try to use the languages
given by the -slang option and fall back to the
langidx item in the .IDX file to set the subtitle language. If
that fails, there will be no subtitles.
Other subtitles
The other formats consist of a single text file containing timing,
placement and text information.
Usage: If you have a file like sample.txt, you have to pass the
option -sub sample.txt (full path optional).
Adjusting subtitle timing and placement:
-subdelay <sec>
Delays subtitles by <sec> seconds. Can be negative.
-subfps <rate>
Specify frame/sec rate of subtitle file (float number)
-subpos <0 - 100>
Specify the position of subtitles.
If you experience a growing delay between the movie and the subtitles when
using a MicroDVD subtitle file, most likely the frame rate of the movie and
the subtitle file are different. Please note that the MicroDVD subtitle
format uses absolute frame numbers for its timing, and therefore the
-subfps option cannot be used with this format. As
MPlayer has no way to guess the frame rate of the subtitle file, you
have to manually convert the frame rate. There is a little perl script in the
contrib directory of the MPlayer FTP site to do this conversion
for you.
MPlayer will try to guess the subtitle files you want to use when playing a
movie. If, like in most cases, subtitle and movie files have the same name and
are in the same place, you do not need to set the subtitle options. Just play
the movie, MPlayer will handle the subtitles automatically.
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/subtract 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.
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,
but there are some other (including Korean, Russian, 8859-8 etc) fonts
at contrib/font section of FTP, made by users.
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 <video_name>.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 (Red Hat)
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)
using a TrueType (TTF) font, by the means of the freetype
library. Version 2.0.9 or greater is mandatory! Then you
have two methods:
use the -font /path/to/arial.ttf option to specify
a TrueType font file on every occassion
create a symlink: ln -s /path/to/arial.ttf ~/.mplayer/subfont.ttf
If you chose non-TTF fonts, UNZIP the file you downloaded to ~/.mplayer or
$PREFIX/share/mplayer. Then rename or symlink one of the extracted directories to
font (like: ln -s ~/.mplayer/arial-24
~/.mplayer/font). Now you have to see a timer at the upper left corner
of the movie (switch it off with the "o" key).
OSD has 4 states: (switch with 'o')
(subtitles are always enabled, for disabling them please read the man
page)
volume bar + seek bar (default)
volume bar + seek bar + timer + file position percentage on seeking
volume bar + seek bar + timer + total duration of media
subtitles only
You can change default behaviour by setting osdlevel= variable
in config file, or the -osdlevel command line option.
To use the old method, you don't have to do anything. It uses
usleep() to tune A/V sync, with +/- 10ms accuracy. However
sometimes the sync has to be tuned even finer.
The new timer code uses PC's RTC (Real Time Clock) for this task,
because it has precise 1ms timers. It is automagically enabled when
available, but requires root privileges, a setuid root
MPlayer binary or a properly set up kernel.
If you are running kernel 2.4.19pre8 or later you can adjust the maximum
RTC frequency for normal users through the /proc filesystem.
Use this command to enable RTC for normal users:
echo 1024 > /proc/sys/dev/rtc/max-user-freq
If you do not have such a new kernel, you can also change one line in
drivers/char/rtc.c and recompile your kernel. Find the
section that reads
* We don't really want Joe User enabling more
* than 64Hz of interrupts on a multi-user machine.
*/
if ((rtc_freq > 64) && (!capable(CAP_SYS_RESOURCE)))
and change the 64 to 1024. You should really know what you are doing, though.
You can see the new timer's efficiency in the status line.
The power management functions of some notebook BIOSes with speedstep CPUs
interact badly with RTC. Audio and video may get out of sync. Plugging the
external power connector in before you power up your notebook seems to help.
You can always turn off RTC support with the -nortc switch.
In some hardware combinations (confirmed during usage of non-DMA DVD
drive on an ALi1541 board) usage of the RTC timer causes skippy playback.
It's recommended to use the third method in these cases.
The third timer code is turned on with the -softsleep
option. It has the efficiency of the RTC, but it doesn't use RTC. On the other
hand, it requires more CPU.
Note:NEVER install a setuid root MPlayer binary on a multiuser system!
It's a clear way for everyone to become root.
This section is about how to enable watching/grabbing from V4L compatible
TV tuner. See the man page for a description of TV options and keyboard
controls.
First, you have to recompile. ./configure will autodetect
kernel headers of v4l stuff and the existence of /dev/video*
entries. If they exist, TV support will be built (see the output of
./configure).
Make sure your tuner works with another TV software in Linux, for example
xawtv.
The full listing of the options is available on the manual page. Here
are just a few tips:
Use the channels option. An example: -tv on:channels=26-MTV1,23-TV2
Explanation: using this option, only the 26 and 23 channels will be usable,
and there will be a nice OSD text upon channel switching, displaying the
channel's name. Spaces in the channel name must be replaced by the "_"
character.
Choose some sane image dimensions. The dimensions of the resulting image
should be divisible by 16.
If you capture the video with the vertical resolution higher than half of
the full resolution (i.e. 288 for PAL or 240 for NTSC), make sure you
turned deinterlacing on. Otherwise you'll get a movie which is distorted
during fast-motion scenes and the bitrate controller will be probably even
unable to retain the specified bitrate as the interlacing artifacts produce
high amount of detail and thus consume lot of bandwidth. You can enable
deinterlacing with -vop pp=DEINT_TYPE. Usually
pp=lb does a good job, but it can be matter of personal
preference. See other deinterlacing algorithms in the manual and give it a
try.
Crop out the dead space. When you capture the video, the areas at the
edges are usually black or contain some noise. These again consume lots of
unnecessary bandwidth. More precisely it's not the black areas themselves
but the sharp transitions between the black and the brighter video image
which do but that's not important for now. Before you start capturing,
adjust the arguments of the crop option so that all the crap
at the margins is cropped out. Again, don't forget to keep the resulting
dimensions sane.
Watch out for CPU load. It shouldn't cross the 90% boundary for most of
the time. If you have a large capture buffer, MEncoder can survive an
overload for few seconds but nothing more. It's better to turn off the 3D
OpenGL screensavers and similar stuff.
Don't mess with the system clock. MEncoder uses the system clock for
doing A/V sync. If you adjust the system clock (especially backwards in
time), MEncoder gets confused and you will lose frames. This is an
important issue if you are hooked to a network and run some time
synchronization software like NTP. You have to turn NTP off during the
capture process if you want to capture reliably.
Don't change the outfmt unless you know what you are doing
or your card/driver really doesn't support the default (YV12 colorspace).
In the older versions of MPlayer/MEncoder it was necessary to specify the
output format. This issue should be fixed in the current releases and
outfmt isn't required anymore, and the default suits the most
purposes. For example, if you are capturing into DivX using libavcodec and
specify outfmt=RGB24 in order to increase the quality of the
captured images, the captured image will be actually later converted back
into YV12 so the only thing you achieve is a massive waste of CPU power.
To specify the I420 colorspace (outfmt=i420), you have to
add an option -vc rawi420 due to a fourcc conflict with an
Intel Indeo video codec.
There are several ways of capturing audio. You can grab the sound either
using your soundcard via an external cable connection between video card
and line-in, or using the built-in ADC in the bt878 chip. In the latter
case, you have to load the btaudio driver. Read the
linux/Documentation/sound/btaudio file (in the kernel tree,
not MPlayer's) for some instructions on using this driver.
If MEncoder cannot open the audio device, make sure that it is really
available. There can be some trouble with the sound servers like arts
(KDE) or esd (GNOME). If you have a full duplex soundcard (almost any
decent card supports it today), and you are using KDE, try to check the
"full duplex" option in the sound server preference menu.
Dummy output, to AAlib :) mplayer -tv on:driver=dummy:width=640:height=480 -vo aa
Input from standard V4L mplayer -tv
on:driver=v4l:width=640:height=480 -vo xv
A more sophisticated example. This makes MEncoder capture the full
PAL image, crop the margins, and deinterlace the picture using
a linear blend algorithm. Audio is compressed with a constant
bitrate of 64kbps, using LAME codec. This setup is suitable for
capturing movies. mencoder -tv
on:driver=v4l:width=768:height=576 \
-ovc lavc -lavcopts
vcodec=mpeg4:vbitrate=900 \ -oac
mp3lame -lameopts cbr:br=64 \ -vop
pp=lb,crop=720:544:24:16 -o output.avi
This will additionally rescale the image to 384x288 and compresses
the video with the bitrate of 350kbps in high quality mode. The
vqmax option looses the quantizer and allows the video compressor to
actualy reach so low bitrate even at the expense of the
quality. This can be used for capturing long TV series, where the
video quality isn't so important.
mencoder -tv on:driver=v4l:width=768:height=576 \
-ovc lavc -lavcopts vcodec=mpeg4:vbitrate=350:vhq:vqmax=31:keyint=300 \
-oac mp3lame -lameopts cbr:br=48 \
-vop scale=384:288,pp=tn/lb,crop=720:540:24:18 -sws 1 -o output.avi
It's also possible to specify smaller image dimensions in the
-tv option and omit the software scaling but this
approach uses the maximum available information and is a little more
resistant to noise. The bt8x8 chips can do the pixel averaging only
in the horizontal direction due to a hardware limitation.
The edit decision list (EDL) system allows you to automatically skip or mute
sections of videos during playback, based on a movie specific EDL
configuration file.
This is useful for those who may want to watch a film in "family-friendly"
mode. You can cut out any violence, profanity, Jar-Jar Binks .. from a movie
according to your own personal preferences. Aside from this, there are other
uses, like automatically skipping over commercials in video files you
watch.
The EDL file format is pretty bare-bones. Once the EDL system has reached a
certain level of maturity, an XML-based file format will probably be
implemented (keeping backwards compatibility with previous EDL formats).
The maximum number of EDL entries for the current incarnation of EDL is 1000.
If you happen to need more, change the #define MAX_EDL_ENTRIES
in the edl.h file.
Where the seconds are floating-point numbers and the action is either
0 for skip or 1 for mute. Example:
5.3 7.1 0
15 16.7 1
420 422 0
This will skip from second 5.3 to second 7.1 of the video, then mute at
15 seconds, unmute at 16.7 seconds and skip from second 420 to second
422 of the video. These actions will be performed when the playback timer
reaches the times given in the file.
To create an EDL file to work from, use the
-edlout <filename> flag. During playback, when you want to
mark the previous two seconds to skip over, hit i. A
corresponding entry will be written to the file for that time. You can then go
back and fine-tune the generated EDL file.
MPlayer utilizes a complex playtree. It consists of global options
written as first (for example mplayer -vfm 5), and options
written after filenames, that apply only to the given filename/URL/whatever
(for example mplayer -vfm 5 movie1.avi movie2.avi -vfm 4).
You can group filenames/URLs together using { and }. It's useful with
option -loop: mplayer { 1.avi -loop 2 2.avi } -loop 3
will play files in this order: 1 1 2 1 1 2 1 1 2
file
mplayer [options] [path/]filename
files
mplayer [default options] [path/]filename1 [options for filename1] filename2 [options for filename2] ...
MPlayer has a fully configurable, command driven, control layer which
lets you control MPlayer with keyboard, mouse, joystick or remote
control (using LIRC). See the man page for the complete list of keyboard
controls.
MPlayer allows you bind any key/button to any MPlayer command
using a simple config file. The syntax consist of a key name followed by a
command. The default config file location is
$HOME/.mplayer/input.conf but it can be overridden using the
-input conf switch (relative path are relative to
$HOME/.mplayer).
Example:
##
## MPlayer input control file
##
RIGHT seek +10
LEFT seek -10
- audio_delay 0.100
+ audio_delay -0.100
q quit
> pt_step 1
< pt_step -1
ENTER pt_step 1 1
You can have a full list of known commands by running "mplayer -input cmdlist"
seek (int) val [(int) type=0]
Seek to some place in the movie.
Type 0 is a relative seek of +/- val seconds.
Type 1 seek to val % in the movie.
audio_delay (float) val
Adjust the audio delay of val seconds
quit
Quit MPlayer
pause
Pause/unpause the playback
grap_frames
Somebody know ?
pt_step (int) val [(int) force=0]
Go to next/previous entry in playtree. Val sign tell the direction.
If no other entry is available in the given direction it won't do anything
unless force is non 0.
pt_up_step (int) val [(int) force=0]
Like pt_step but it jump to next/previous in the parent list. It's useful
to break inner loop in the playtree.
alt_src_step (int) val
When more than one source is available it select the next/previous one
(only supported by asx playlist).
sub_delay (float) val [(int) abs=0]
Adjust the subtitles delay of +/- val seconds or set it to val seconds
when abs is non zero.
osd [(int) level=-1]
Toggle osd mode or set it to level when level > 0.
volume (int) dir
Increase/decrease volume
contrast (int) val [(int) abs=0]
brightness (int) val [(int) abs=0]
hue (int) val [(int) abs=0]
saturation (int) val [(int) abs=0]
Set/Adjust video parameters. Val range from -100 to 100.
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, configure will autodetect it. If
everything went fine, MPlayer will print a message like "Setting up
lirc support..." on startup. If an error occurs it will tell you. If it
doesn't tell you anything about LIRC there's no support compiled in. That's
it :-)
The application name for MPlayer is - oh wonder - mplayer.
You can use any mplayer commands and even pass more than one command by
separating them with \n. Don't forget to enable the repeat flag in .lircrc
when it make sense (seek, volume, etc). Here's an excerpt from my
.lircrc:
begin
button = VOLUME_PLUS
prog = mplayer
config = volume 1
repeat = 1
end
begin
button = VOLUME_MINUS
prog = mplayer
config = volume -1
repeat = 1
end
begin
button = CD_PLAY
prog = mplayer
config = pause
end
begin
button = CD_STOP
prog = mplayer
config = seek 0 1\npause
end
If you don't like the standard location for the lirc-config file (~/.lircrc)
use the -lircconf <filename> switch to specify another file.
The slave mode allow you to build simple frontend to MPlayer. When
enabled (with the -slave switch) MPlayer will read
commands separated by new line (\n) from stdin.
MPlayer can play files from network, using the HTTP, MMS or RTSP/RTP
protocol.
Playing goes by simply using adding the URL to the command line.
MPlayer also honors the http_proxy environment variable, and uses
proxy if available. Proxy usage can also be forced:
To build a Debian package, run the following command in the MPlayer source
directory:
fakeroot debian/rules binary
As root you can then install the .deb package as usual:
dpkg -i ../mplayer_<version>.deb
Christian Marillat has been making unofficial Debian MPlayer, MEncoder and
font packages for a while, you can (apt-)get them from his
homepage. These packages are highly
unofficial, however, as Christian made and redistributed these packages when
MPlayer was still not fully GPLed and
binary redistribution was
not allowed. Christian ignored requests to stop redistributing his packages,
which caused bad blood with MPlayer developers. Binary redistribution is not
a problem anymore, but we do not support these packages!
Dominik Mierzejewski created and maintains official Red Hat RPM packages of
MPlayer. They are available from his
homepage.
Please read the instructions there and report problems to him, not us.
There are other RPM versions (SuSE now includes MPlayer in their official
distribution, Mandrake packages are available from the
P.L.F) of MPlayer, but none of them is
officially supported.
MPlayer works on Linux PDAs with ARM CPU e.g. Sharp Zaurus, Compaq Ipaq.
The easiest way to obtain MPlayer is to get it from one of the
Openzaurus package feeds.
If you want to compile it yourself, you should look at the
mplayer
and the
libavcodec
directory in the OpenZaurus distribution buildroot. These always have the
latest Makefile and patches used for building a CVS MPlayer with libavcodec.
If you need a GUI frontend, you can use xmms-embedded.
MPlayer runs on FreeBSD, OpenBSD, NetBSD, BSD/OS and Darwin. There are
ports/pkgsrc/fink/etc versions of MPlayer available that are probably easier
to use than our raw sources.
To build MPlayer you will need GNU make (gmake - native BSD make will not
work) and a recent version of binutils.
If MPlayer complains about not finding /dev/cdrom or
/dev/dvd, create an appropiate symbolic link: ln -s /dev/(your_cdrom_device) /dev/cdrom.
To use Win32 DLLs with MPlayer you will need to re-compile the kernel with
"option USER_LDT" (unless you run FreeBSD -CURRENT, where this
is the default).
Due to limitations in different versions of gas (relocation vs MMX), you will
need to compile in two steps: First make sure that the non-native as is first
in your $PATH and do a gmake -k, then make sure that
the native version is used and do gmake.
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:
(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 ...
Due to bugs in Solaris 8, you may not be able to play DVD discs larger
than 4 GB:
The sd(7D) driver on Solaris 8 x86 has a bug when accessing a disk
block >4GB on a device using a logical blocksize != DEV_BSIZE (i.e. CD-ROM
and DVD media). Due to a 32Bit int overflow, a disk address modulo 4GB is
accessed.
(http://groups.yahoo.com/group/solarisonintel/message/22516)
This problem does not exist in the SPARC version of Solaris 8.
The hsfs problem can be fixed by installing patch 109764-04 (sparc) /
109765-04 (x86).
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.
You can either try to install the GNU install program, and (if you did not
put it in your global path) then point to the location with:
./configure --install-path=PATH
Or you can use the default install delivered with IRIX 6.5 in which case you
will have to edit the Makefile a littlebit by hand. Change the following two
lines:
The Cygwin port is still in its infancy. Currently there is no support for
Win32 DLLs, VCDs or OpenGL. SDL is known to distort sound and image or crash
on some systems. Patches are always welcome.
Best results are achieved with the native DirectX video output driver
(-vo directx) and the native Windows waveout audio driver
(-ao win32). You should also check out the
mplayer-cygwin
mailing list for help and latest information.
You have to copy or symlink etc/cygwin_inttypes.h from the
MPlayer source directory to /usr/include/inttypes.h in order to
make MPlayer compile.
To get native DirectX video, download
DirectX 7 header files,
extract them to /usr/include/ or /usr/local/include/
and recompile. If the image is distorted, try turning off hardware
acceleration with -vo directx:noaccel.
Instructions and files for making SDL run under Cygwin can be found on the
libsdl site.
There are some public mailing lists on MPlayer. Unless explicitly
stated otherwise the language of these lists is English. Please do
not send messages in other languages or HTML mail! Message size limit is 80k.
If you have something bigger put it up for download somewhere. Click the
links to subscribe. On the mailing lists, the same rules about writing
and quoting apply as on usenet. Please follow them, it makes the life of
those who read your mails a lot easier. If you do not know them please
read HOWTO edit messages or
(if you are in a hurry)
Quoting HOWTO.
MPlayer developers list:
http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
This list is about MPlayer development! Talking about interface/API
changes, new libraries, code optimization, configure changes is ontopic
here. Send patches but not bug reports, user questions, feature
requests or flames here to keep the list traffic low.
MPlayer CVS-log:
http://mplayerhq.hu/mailman/listinfo/mplayer-cvslog
All changes in MPlayer code are automatically sent to this list. Only
questions about these changes belong here (if you do not understand why a
change is required or you have a better fix or you have noticed a possible
bug/problem in the commit).
SIGILL (signal 4) on P3 using 2.2.x kernels:
Problem: kernel 2.2.x doesn't have proper (working) SSE support
Solution: upgrade kernel to 2.4.x
Workaround: ./configure --disable-sse
General SIGILL (signal 4):
Problem: you compiled and run mplayer in different machines
(for example compiled on P3 and running on Celeron)
Solution: compile MPlayer on the same machine where you will use it!
Workaround: ./configure --disable-sse etc. options
"Internal buffer inconsistency" during MEncoder run:
Problem: known problem when lame < 3.90 was compiled with gcc 2.96 or 3.x.
Solution: use lame >=3.90.
Workaround: compile lame with gcc 2.95.x and remove any already installed
lame packages, they may have been compiled with gcc 2.96.
Messed up MP2/MP3 sound on PPC:
Problem: known GCC miscompilation bug on PPC platforms, no fix yet.
Workaround: use FFmpeg's (slow) MP1/MP2/MP3 decoder (-ac ffmpeg)
sig11 in libmpeg2, when scaling+encoding:
Problem: known GCC 2.95.2 MMX bug, upgrade to 2.95.3.
Various A-V sync and other audio problems:
General audio delay or jerky sound (exists with all or many files):
most common: buggy audio driver! - try to use different drivers, try
ALSA 0.9 OSS emulation with -ao oss, also try -ao sdl, sometimes it helps.
If your file plays fine with -nosound, then you can be sure it's sound card
(driver) problem.
samplerate problems - maybe your card doesn't support the samplerate
used in your files - try the resampling plugin (-aop)
slow machine (CPU or VGA)
try with -vo null, if it plays well, then you have slow VGA card/driver
Workaround: buy a faster card or read this documentation about how to speed up
Also try -framedrop
Audio delay/de-sync specific to one or a few files:
bad file
Workaround:
-ni or -nobps option (for non-interleaved or bad files)
and/or
-mc 0 (required for files with badly interleaved VBR audio)
and/or
-delay option or +/- keys at runtime to adjust delay
If none of these help, please upload the file, we'll check (and fix).
your sound card doesn't support 48kHz playback
Workaround: buy a better sound card... or try to decrease fps by 10% (use
-fps 27 for a 30fps movie) or use the resampler plugin
slow machine
(if A-V is not around 0, and the last number in the status line increasing)
Workaround: -framedrop
No sound at all:
your file uses an unsupported audio codec
Workaround: read the documentation and help us adding support for it
No picture at all (just plain grey/green window):
your file uses an unsupported video codec
Workaround: read the documentation and help us adding support for it
auto-selected codec can't decode the file, try to select another using -vc
or -vfm options
you try to play DivX 3.x file with OpenDivX decoder or XviD (-vc odivx)
- install Divx4Linux and recompile player
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
Green image using mga_vid (-vo mga / -vo xmga):
- mga_vid misdetected your card's RAM amount, reload it using mga_ram_size option