<!doctype linuxdoc system>
<article>
<title>The xine Video Player HOWTO
<author>Rich Wareham, <tt>&lt;richwareham@users.sourceforge.net&gt;</tt>
<date>v1.31, 2002 August 2
<abstract>This document describes how to install, configure and use the xine 
Video Player. It relates only to versions of xine after 0.5 and, in general, those
of the 0.9.x series.
</abstract>

<toc>

<sect>Introduction
<p>
This document has been written to provide end-users with information on how
to use the xine video player to play video files and un-encrypted DVDs. 
Please note that xine in its unmodified state will not play CSS-encrypted DVDs. 
Links are given in this HOWTO for plugins which allow such DVDs to be played.
<p>
This document only relates to versions of the xine video player after 0.5 due
to the large number of architectural changes xine underwent at that time.

<sect1>New versions of this document
<p>
New versions of this document can be obtained from various locations including:

<itemize>
<item><htmlurl url="http://xine.sourceforge.net/" name="http://xine.sourceforge.net/">
<item><htmlurl url="http://dvd.sourceforge.net" name="http://dvd.sourceforge.net/">
</itemize>

Finally the very latest version of this document should also be available
in various formats from:

<htmlurl url="http://dvd.sourceforge.net/" name="http://dvd.sourceforge.net/">

<p>
This HOWTO is written in English (that is English as opposed to American). Other versions may
be available but the English one is most likely to be up-to-date.

<sect1>Feedback
<p>
All comments, error reports, additional information and criticism of
all sorts should be directed to:
<verb>
  richwareham@users.sourceforge.net
</verb>

<sect1>Disclaimer
<p>
No liability for the contents of this documents can be accepted.  Use
the concepts, examples and other content at your own risk.
Additionally, this is an early version, with many possibilities for
inaccuracies and errors.

One of many possible setups will be described. In the Linux world,
there is usually a number of ways in which to accomplish things.

As far as I know, all of the programmes mentioned here are released under the
GNU General Public License or the Lesser GNU Public License.

<sect1>Copyright information
<p>

This document is copyrighted &copy;2001 The xine Project and distributed under the
following terms:

<itemize>
<item>This document may be reproduced and distributed in whole or
in part, in any medium physical or electronic, as long as this
copyright notice is retained on all copies. Commercial
redistribution is allowed and encouraged; however, the author would
like to be notified of any such distributions.

<item>All translations, derivative works, or aggregate works
incorporating any parts of this document must be covered under this
copyright notice.  That is, you may not produce a derivative work
from this HOWTO and impose additional restrictions on its
distribution. 
</itemize>

<sect1>How do I submit changes or additions to the HOWTO?
<p>
The preferred method is to edit the file xine-HOWTO.sgml to
incorporate the changes, create a diff file by typing something like
<verb>
  diff -uw original-file new-file
</verb>

and send it to <tt>richwareham@users.sourceforge.net</tt>.  If you do not
know SGML, that's OK.  Changes or new information in any form will be
accepted.  Creating the diff file just makes it easier on the HOWTO
maintainer.  <tt>:-)</tt>

<sect>About xine
<p>
xine is a free GNU General Public License (GPL) licensed video player for 
Unix-like systems. It supports many popular video and audio formats.

xine plays the video and audio data of the stream and synchronises
the playback of both. Depending on the properties of the stream,
playback will need more or less processor power. Full frame rate
for MPEG 2 has been seen on a 400 MHz PII system.

xine can play Video CDs, SVCDs and DVDs directly. Unfortunately the legal
status of encrypted/locked DVD playback is uncertain in some countries
so we cannot include any DVD unlock/decrypt code with xine. To play back
such DVDs you'll need external programs or
a special xine plugin. More details can be found in the Playing DVDs section.

xine tries to be simple to use and effective. No bells and
whistles are being developed at this time. The primary aim is
to achieve good playback of video.

<sect1>Where can I obtain xine?
<p>
xine can be obtained from <htmlurl url="http://xine.sourceforge.net/">.
The most current version as of the time of writing is 0.9.12. xine is
available as a <tt>tar.gz</tt> archive and Debian and RPM packages.

<sect1>xine Features
<p>
xine supports playback of the following video formats:
<itemize>
<item>MPEG-1 and MPEG-2.
<item>MPEG-4, also known as `OpenDivX'.
<item>Microsoft MPEG-4, also known as `DivX ;-)'.
<item>Motion JPEG.
<item>Quicktime Sorenson video codec v2 (note newer Quicktime files may not play)
<item>and many more!
</itemize>

On x86 platforms, xine may make use of Video For Windows Dynamic-Link-Libraries (DLLs)
for playback of Indeo, Cinepak, Windows Media 7/8 and many other files.
<p>
xine supports the following audio formats:
<itemize>
<item>MPEG audio layers 1,2 and 3 (also known as `MP3').
<item>a/52 (also known as AC3 and Dolby Digital).
<item>DTS (via an external decoder).
<item>Ogg Vorbis (a patent free alternative to MP3).
</itemize>

on x86 platforms, xine may make use of Video For Windows Dynamic-Link-Libraries (DLLs)
for playback of DivX audio (WMA), ADPCM, GSM and many other files.
<p>
xine understands the following file formats (methods of combining separate
audio and video streams into one file):
<itemize>
<item>Un-encrypted DVDs (see section on DVDs for more information).
<item>Video CD. This does not include the Video-on-CD hybrid format.
<item>MPEG program streams (i.e. <tt>.mpg</tt> or <tt>.mpeg</tt> files).
<item>MPEG transport streams (<tt>.ts</tt>).
<item>Ogg Vorbis container streams (<tt>.ogg</tt>).
<item>Microsoft Audio Video Interleave (<tt>.avi</tt>).
<item>Microsoft Advanced Streaming Format (<tt>.asf</tt>).
<item>Quicktime -- Note: xine does not support the Sorenson codec used in many Quicktime
files.
<item>Raw MPEG audio and video streams (<tt>.mpv</tt> and <tt>.mp3</tt>).
</itemize>

<sect1>Supported platforms and requirements
<p>
xine needs a locally attached graphics device and monitor (playback over
a networked X-session is at best slow and more usually completely 
unwatchable).

xine needs either MIT-SHM (The MIT Shared Memory Extension), which is
supported in XFree86 for quite some time (3.3.x will be fine),
or the X-Video Extension (Xv) which is faster and supports fullscreen
operation but is only provided by some XFree86 4.x drivers.
For more
information on Xv (and if it is supported on your video card), 
refer to the section on increasing the performance of xine below
or look at the XFree86 organisation's website 
(<htmlurl url="http://www.xfree86.org/">). 

Experimental plugins exist for accelerated output via OpenGL and the SyncFB device
available for Matrox cards (more information at 
<htmlurl url="http://teletux.sourceforge.net/" name="http://teletux.sourceforge.net/">.
See the README.syncfb file included
in the xine distribution for more details. The main advantage of using this
driver is the synchronisation of the video picture with the refresh of your 
monitor removing the `tearing' artifacts which may occur in fast-moving scenes.

Under Linux, xine also supports the use of the Dxr3/Holywood+ DVD decoder cards for
DVD output. xine can only use these cards to play MPEG and DVD input and can
transcode other formats for display via the Dxr3. More information about
setting up the Dxr3 device is available on <htmlurl url="http://dxr3.sourceforge.net"
name="http://dxr3.sourceforge.net">.

It is recommended that, if you do not use Xv, you set your screen colour
depth to 16 bits-per-pixel (bpp) for reasons of speed. Xv seems to work 
fine at both 16bpp and 24bpp.

You need to have a sound card which is supported by the OSS or ALSA drivers. 
The ESD and aRts sound daemons are also supported. The remainder of this HOWTO assumes 
that you have correctly setup and configured your sound card and X server.

Software decoding of video is a computationally intensive task. It is recommended that,
for smooth DVD playback, an x86 system should have at least a 400MHz processor. Greater
resources are required for the unaccelerated XShm output plugin.

xine has successfully been installed and run on non-x86 platforms
(e.g. PPC or Solaris/IRIX Unices).

<sect1>Where can I ask questions about or report bugs on xine?
<p>
There is a mailing list called <tt>xine-user</tt> hosted at 
Sourceforge on which you may ask questions. Full details are
available on the xine website (<htmlurl url="http://xine.sourceforge.net/">).
Please review the FAQ and this HOWTO to see if your question is answered before
posting to the list.

There is also an IRC chat room, <tt>#xine</tt> which is hosted on
<tt>irc.openprojects.net</tt>.

<sect>Compiling and installing xine<label id="compiling">
<p>
The following instructions assume that you are installing from the 
source archives available from the xine website. You will need at 
least two packages (named <tt>xine-lib.x.y.z.tar.gz</tt> and
<tt>xine-ui.x.y.z.tar.gz</tt>). Ensure that both archives correspond
to the same version of xine.

Firstly it is recommended that you remove any previous instances of
xine form your system. You can do this using the following instructions.
Here <verb>$PREFIX</verb> is the directory xine is installed in
(e.g. if your xine program is <verb>/usr/bin/xine</verb> then 
<verb>$PREFIX</verb> <verb>/usr/bin/</verb>).
<verb>
  $ rm -r $PREFIX/share/xine
  $ rm -r $PREFIX/lib/xine
  $ rm $PREFIX/bin/xine
  $ rm $PREFIX/lib/libxine.*
</verb>

Download the files to some convenient directory. Open a terminal and change
to that directory. For example, if you downloaded the file to 
the directory <tt>/home/rich/src/</tt> type the following:
<verb>
  $ cd /home/rich/src/
</verb>

The <tt>xine-lib</tt> file is the xine run-time library which
contains the code for the xine engine itself. The <tt>xine-ui</tt>
file contains a number of user interfaces for xine. Currently there
is a X-windows based graphical user interface and an experimental
text-only interface (which renders video as so-called 'ASCII-art').

Type the following. It will extract the xine library and user interface source 
archives. Substitute <tt>x.y.z</tt>
for the version of xine that you downloaded.
<verb>
  $ tar xvzf xine-lib.x.y.z.tar.gz
  $ tar xvzf xine-ui.x.y.z.tar.gz
</verb>

<sect1>Where are the installation instructions?
<p>
The full installation instructions are included in the file <tt>INSTALL</tt>. 
What follows here
are a brief cut-down version of the instructions.

<sect1>Quick-start installation guide
<p>
Extract the xine source archives as outlined in the section entitled 
<ref id="compiling" name="Compiling and installing xine">. The 
<tt>xine-lib</tt> archive <bf>must be installed first</bf>. Change to the
<tt>xine-lib.x.y.z</tt> directory and configure the 
source code for your machine and compile the code by typing:
<verb>
  $ ./configure
  $ make
</verb>

You may wish to use the <tt>./configure --help</tt> command to see if
you have to setup any machine specific options.

Now, as the user <tt>root</tt>, enter the following command:
<verb>
  $ make all install
</verb>

<bf>IMPORTANT!</bf> Before you can compile <tt>xine-ui</tt>, you may need to inform your
system of the location of the xine libraries, you may need to set
the <tt>LD_LIBRARY_PATH</tt> environment variable to the directory
you installed the xine library and/or run the <tt>ldconfig</tt> program. For example,
if you had installed xine-lib to <tt>/usr/local</tt>, you may need to enter the
following command before compiling <tt>xine-ui</tt>.

<verb>
  $ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
</verb>

Once the xine library is installed, you can repeat these steps with
the <tt>xine-ui.x.y.z</tt> directory.

<sect1>Installing xine in a different directory
<p>
To install xine in, for example, the directory <tt>/usr/local/xine</tt>, 
use the following option to <tt>configure</tt>
<verb>
  $ ./configure --prefix=/usr/local/xine
</verb>

and, as <tt>root</tt> enter
<verb>
  $ make install
</verb>

<sect1>How can I supply additional flags to the C-compiler?
<p>
You can do so by setting the <tt>GLOBAL_CFLAGS</tt> variable and then run 
<tt>./configure</tt> again.

This can be useful to specify additional include paths or library 
paths to the compiler. For example:
<verb>
  $ export GLOBAL_CFLAGS="-I/usr/include -L/home/guenter/xine_libs"
</verb>

<sect1>Pre-built binaries
<p>
If you do not wish to compile xine from source, there are several pre-built
`packages' available from the xine web-site. Also there are several packages
containing common third-party plugins and patches available at
<htmlurl url="http://cambuca.ldhs.cetuc.puc-rio.br/~jcm/skyblade/"
name="http://cambuca.ldhs.cetuc.puc-rio.br/~jcm/skyblade/">.

Note that there are other methods of installing packages, you may
wish to use graphical programmes such as <tt>kpackage</tt>.

<sect2>Debian packages (.deb)
<p>
If you are using the `unstable' branch of Debian, you can install xine
by using the following command as <tt>root</tt>: 
<verb>
  $ apt-get install xine-ui
</verb>

<sect2>Red-Hat packages (.rpm)
<p>
Download the RPMs from the xine web-site and enter the following
command as <tt>root</tt>, substituting in the name of the file you downloaded.
<verb>
  $ rpm -ivh xine-lib.x.x.x.rpm xine-ui.x.x.x.rpm
</verb>

<sect>Using xine
<p>
<sect1>Quick Start
<p>
You can start xine with or without command-line parameters. If you wish to
play a VCD or DVD, the simplest method is to invoke xine with the following
command:
<verb>
  $ xine
</verb>

Then click on the DVD or VCD button on the xine control panel. This causes Xine
to scan for a DVD or VCD as appropriate. If xine finds one, you can press the
`play' button to start the movie.

When xine first starts up, the main Xine window will be displayed (black with
the xine logo in it). Clicking the <bf>right</bf> mouse button in the window
will toggle the display of the xine control panel.

The xine control panel has a selection of familiar VCR-type controls for 
playing, pausing, stopping and moving to the beginning or end of file as 
appropriate.

For a usage summary, use the following command-line
<verb>
  $ xine --help
</verb>

<sect1>Specifying a video source on the command-line.
<p>
xine specifies video sources using a <it>media resource locater</it> (MRL). 
Valid MRLs are:

<itemize>
<item><tt>file://some/file.vob</tt> - Specifies the file <tt>/some/file.vob</tt>.
<item><tt>fifo://[[mpeg1:mpeg2]:/]some/fifo</tt> - xine gets the video from the
special FIFO pipe <tt>/some/fifo</tt>. By default, xine assumes the stream is mpeg-2,
use <tt>mpeg1</tt> or <tt>mpeg2</tt> in the MRL to specify it explicitly.
<item><tt>stdin://[mpeg1:mpeg2]</tt> - xine takes the video stream from stdin. As with
the <tt>fifo://</tt> MRL, xine assumes mpeg2 unless told otherwise.
<item><tt>dvd://VTS_xx_y.VOB</tt> - Use the VOB file specified on a DVD. This is
different to using the <tt>file://</tt> MRL as xine reads the data directly from the DVD rather
than using the Unix file system.
<item><tt>vcd://track</tt> - Plays the track specified on a VCD.
<item><tt>html://server.somewhere.tld/foo/bar.mpg</tt> - Streams the specified URL
and attempts to play it.
<item><tt>mms://server/dir/file</tt> - An streaming protocol developed by some
obscure company in Washington. Sometimes used for videos on news sites.
</itemize>

In all cases, xine is invoked by
<verb>
  $ xine &lt;mrl>
</verb>

For example, to play the file <tt>/some/where/foo.vob</tt>:
<verb>
  $ xine file://some/where/foo.vob
</verb>

In addition to the above methods, you can specify a file directly, for example:
<verb>
  $ xine /some/where/foo.vob
</verb>

You may also imply the MRL <tt>stdin://mpeg2</tt> with:
<verb>
  $ xine -
</verb>

<sect2>Examples
<p>
The following both play the file <tt>/path/foo.vob</tt>:
<verb>
  $ xine /path/foo.vob
  $ xine file://path/foo.vob
</verb>

xine supports the xdnd protocol (Version 3) so if you have a file browser 
application supporting that protocol (e.g. gmc) you can drop video files
on xine for playback.

Playing track 3 from a VCD:
<verb>
  $ xine vcd://3
</verb>

Example for direct DVD access:
<verb>
  $ xine dvd://VTS_01_1.VOB
</verb>

<sect1>Selecting Audio tracks
<p>
Some video files can have multiple audio tracks (e.g. DVDs). There are two ways to select
audio tracks. The simplest is to use the arrows next to the audio track icon on the
xine control panel (usually a speaker).

Alternatively, you can use the <tt>-a</tt> command line parameter. For example to play the
third audio track in the file <tt>/path/foo.mpg</tt>:
<verb>
  $ xine -a 3 /path/foo.mpg
</verb>

For MPEG-1 video, only mpeg audio (layer 1, 2 and 3) is supported.

MPEG-2 streams can have different types of audio streams, though.
xine supports AC3 (dolby digital), mpeg and LPCM sound. These
are mapped to the following tracks:
<verb>
  Track    selected audio stream

   0- 7    AC3 stream 0-7
   8-15    MPG audio stream 0-7
  16-23    PCM audio stream 0-7
</verb>

For example, to play PCM stream 0 use
<verb>
  $ xine -a 16 file.vob
</verb>

<sect1>Changing skin
<p>
xine supports skinning (like the XMMS or Winamp programs). The skin may
be changed by clicking on its name in the `control' dialogue box. To identify the
correct button on the main xine control panel, hover your mouse over the buttons
for a short while and a small window pops up to identify each button.

<sect1>Displaying subtitles
<p>
DVDs and VOB files may contain subtitle information within them that xine can 
use to display subtitles over the video. This feature is by default off but 
one can enable it by changing the subtitle track number to the right of the 
subtitle icon on the xine control panel.

Alternatively, you may use the <tt>-u</tt> command-line parameter. For 
example, to display the subtitles with id 0, use:
<verb>
  $ xine -u 0 &lt;file or MRL>
</verb>

<sect1>Changing video output method
<p>
To change the method of video output, use the <tt>-V</tt> command line
parameter. For example to start using the MIT-SHM (XShm) output method, use
<verb>
  $ xine -V XShm 
</verb>

and to use the XVideo (Xv) output:
<verb>
  $ xine -V Xv
</verb>

xine `remembers' changes to the video output so your change will still take
effect after exiting and restarting xine.

<sect1>Forcing the use of a particular audio driver
<p>
The <tt>-A</tt> command-line parameter can be used to select the OSS 
(<tt>oss</tt>), ALSA 0.9 (<tt>alsa</tt>), 
ESD (<tt>esd</tt>), ARTS (<tt>arts</tt>) or NULL 
(<tt>null</tt>) output driver. For example,
to force the use of the ALSA driver:
<verb>
  $ xine -A oss /path/file.mpg
</verb>

The NULL driver does not use any sound hardware and is best used for testing
purposes.

xine `remembers' changes to the audio output so your change will still take
effect after exiting and restarting xine.

<sect1>Auto-play
<p>
xine can be set to automatically play when it starts through the use of 
the <tt>-p</tt>
command-line parameter. For example:
<verb>
  $ xine -p /path/file.mpg
</verb>

The <tt>-p</tt> parameter also accepts an optional single character to 
control xine farther:
<itemize>
<item><tt>f</tt> - Start xine in Fullscreen mode (Xv only).
<item><tt>h</tt> - Hide the control panel.
<item><tt>q</tt> - Quit xine when finished playing the video.
<item><tt>d</tt> - Attempt to retrieve playlist from DVD.
<item><tt>v</tt> - Attempt to retrieve playlist from VCD.
</itemize>

For example, to auto-play, in fullscreen mode and attempt to retrieve the 
playlist from a
DVD:
<verb>
  $ xine -pfhd
</verb>

<sect1>Configuring xine
<p>
xine is a highly configurable program. This configuration may be performed from
the settings window (locate the correct button in the GUI as above for the
control window).

More information on a particular setting may usually be found by examining the 
comments in the <tt>~/.xine/config</tt> file.

<sect1>Tips and tricks
<p>
The following are some tips and tricks for getting the most out of xine.

<sect2>Removing the console output
<p>
As xine is still in its developmental stage, it outputs a lot of information to
the console when it runs. To remove this output start xine like this:
<verb>
  $ xine mrl 2>&1 >/dev/null
</verb>

<sect2>Doing this automatically
<p>
You can use this simple shell script to automatically do this when loading
xine.
<verb>
  #!/bin/sh
  xine "$@" 2>&1 >/dev/null
</verb>

<sect1>Tweaking xine
<p>
The xine config file (<tt>~/.xine/config</tt>) has a number of useful options.
They can be changed from the xine stup dialogue box (click the 'spanner' icon on
most skins).

<sect>Playing DVDs with xine
<p>
DVD support in xine is a little complex due to the uncertain legal situation regarding
software capable of decoding DVDs encrypted with the Content Scrambling System (CSS).
If you wish to just watch un-encrypted DVDs with no support for menus,
title selection or multiple-angles, the bundled xine DVD plugin will suffice. In general,
however, most DVDs are encrypted and most people want support for the more advanced
features.

<sect1>DVD terminology
<p>
Since DVDs are a complex subject, people often get confused with terminology and
myths surrounding them. The following is a brief primer on the important aspects of
DVD technology. It is included here since they are often the source of common mistakes.
<p>
<itemize>
<item><bf>Region Coding</bf> -- A DVD has encoded on it a set of `regions' for which
the Copyright owner has licensed distribution of the DVD contents. There are two
kinds of DVD drive in existence, those who defer to the decoding software to allow
playback (so-called RPC1 drives) and those which prevent playbeack themselves of 
out-of-region discs (RPC2 drives). As of 1st January 2000, all licensed DVD drive
manufacturers were required to produce only RPC2 drives. An RPC2 drive must have its
region set before playback may commence. A suitable utility to perform this for Linux
is available from <htmlurl 
url="http://www.linuxtv.org/download/dvd/dvd_disc_20000215.tar.gz"
name="http://www.linuxtv.org/download/dvd/dvd_disc_20000215.tar.gz">.
<item><bf>CSS</bf> -- The intended aim of the CSS is orthogonal to regon coding; it is
not intended to prevent playback, rather to prevent unauthorised copying. In practice
all DVD players must implement some form of CSS support to playback encrypted discs.
Due to the uncertain legal implications of CSS support code created as a by-product
of reverse engineering in some countries (most notably the United States of America),
it was decided that xine would not officially contain any CSS support. To play
encrypted discs a separate CSS-enabled plugin must be downloaded (see later).
</itemize>
<sect1>Preparing your system to watch DVDs
<p>
DVD plugins expect to find your DVD device at <tt>/dev/dvd</tt> although most 
allow this to be specified within the MRL and/or from the xine configuration
dialogue box. In the interests of simplicity you may wish to symlink your DVD
device to <tt>/dev/dvd</tt>. For example, suppose your DVD drive was <tt>/dev/hdc</tt>,
you could create the symlink via:
<verb>
  $ ln -s /dev/hdc /dev/dvd
</verb>
<p>
If you are using DevFS the procedure is more complex, however since you are using DevFS
I assume you have read the <tt>devfsd</tt> manpage <tt>;-)</tt>.
<p>
Many people also forget to give themselves read access to the DVD device (and find
that they can only watch DVDs as <tt>root</tt>).

<sect1>`Alternate' DVD plugins
<p>
Disclosure: The main author of this HOWTO also authored parts of the DVDNAV plugin.
<p>
Due to the limitations of the default xine DVD plugin, a number of people have attempted
to create better plugins for separate distribution. There are three popular DVD plugins
available for xine.
<sect2>The DVDNAV plugin
<p>
This is probably one of the more ambitious plugins for xine. Its ultimate aim is complete
support for all DVD features (including interactive menus, multiple angles, etc.). 
Initial versions have been available for some time but once the Ogle DVD player
(<htmlurl url="http://www.dtek.chalmers.se/groups/dvd/" 
name="http://www.dtek.chalmers.se/groups/dvd/">) came to prominence, some of the original
code was replaced with code from Ogle for which the original creators of Ogle deserve
thanks.
<p>
Since the specifications for the special DVD features is not freely-accessible, the
plugin has had to reverse-engineer some of the specifications so the DVDNAV plugin
may be of questionable legality in those countries which take an overly dim view
of reverse engineering.
<p>
The plugin may be obtained from <htmlurl url="http://dvd.sourceforge.net/"
name="http://dvd.sourceforge.net">. It requires the following support libraries
to be installed <bf>before</bf> the plugin. Links to them are available on the
plugin's web-site above. They are:
<itemize>
<item>libdvdcss (version &gt;=1.0.0).
<item>libdvdread (versions 0.9.3 and above).
<item>libdvdnav (version &gt;=0.1.2).
</itemize>
<p>
This plugin is also available in the unstable branch of the Debian GNU/Linux distribution
and may be installed via the following commands:
<verb>
  $ apt-get install xine-dvdnav
</verb>
<sect2>The Captain CSS plugin
<p>
One of the oldest plugins this supports CSS DVDs with no dependencies on external
libraries. Recent versions of the plugin have also used some code from the DVDNAV plugin
to support DVD special features.
<p>
The web-site for this plugin changes often and it is probably best to follow the link
on the main xine web-site.
<sect2>The DMD (Digital Movie Disc) plugin
<p>
A simple CSS-enabled plugin designed for viewing DVDs without any special features.
It does, however, support multiple angles. It may be obtained from
<htmlurl url="http://www.geocities.com/xinedvdplugin/" 
name="http://www.geocities.com/xinedvdplugin/">.

<sect>Watching AVI files with xine
<p>
Since version 0.3.6 xine has been able to play Windows AVI files out of the
 box. To do this it uses the Windows driver files (DLLs) to play some
files. By default,
xine expects to find these in the <tt>PREFIX/lib/win32/</tt> directory,
where <tt>PREFIX</tt> is the directory you installed xine into. If you
didn't specify any <tt>--prefix</tt> option to <tt>./configure</tt>, this
will be <tt>/usr/local</tt>. This path can be overridden in the xine configuration
dialogue box.

A tar-ball containing DLLs to watch most AVI files is
available from <htmlurl url="http://bpinaud.dyndns.org/video/w32codec.tar.bz2"
name="http://bpinaud.dyndns.org/video/w32codec.tar.bz2"> and 
<htmlurl url="http://divx.euro.ru/" name="http://divx.euro.ru/">
(the file is called <tt>binaries.zip</tt>). Note that this is only available
on Intel-like platforms.

xine also supports the decoding of DivX ;-) and MJPEG avi files natively using
an embedded copy of the
<htmlurl url="http://ffmpeg.sourceforge.net/"
name="ffmpeg"> library. xine attempts to use this decoder in preference as it
also may work on non-x86 platforms.

<sect1>What to do if xine crashes when I try to play AVI files
<p>
It should work OK if
your system meets these requirements:
<itemize>
<item>The Xv driver is working.
<item>The AVI file contains video and audio streams supported by the DLLs
below.
<item>You have the proper DLLs in <tt>/usr/lib/win32/</tt>
</itemize>

but it may crash for no specific reason at the moment. There are known problems
with files which have strange audio streams.

<sect>Getting output from xine onto a TV

xine has the ability to output via the TV-out on some NVidia cards. It does this
using the nvtvd program available from 
<htmlurl url="http://sourceforge.net/projects/nv-tv-out/" 
name="http://sourceforge.net/projects/nv-tv-out/">. Check the web-page to
see if your card is supported. 

Install the program according to the sintructions on the site. If its correctly
installed pressing 'F' twice in xine should switch to TV output mode.

<sect>Platform Specific Notes and Requirements
<p>
<sect1>FreeBSD
<p>
<sect2>xine fails when allocating images
<p>
Make sure you have enough shared memory enabled. This is very
limited by default.

Edit the <tt>/etc/sysctl.conf</tt> file:
<verb>
  kern.ipc.shmmax=67108864
  kern.ipc.shmall=32768
</verb>

<sect2>Playing Video CDs 
<p>
Currently (because of issues with the FreeBSD kernel) xine can only
play VCDs from ATAPI cdrom drives. not from SCSI drives.

Currently (Jan 2001), FreeBSD-stable (and thus the current releases also)
needs a patch to the kernel sources to make VCDs work (please check
the FreeBSD documentation if you are unsure on how to build a custom
kernel with this patch included).

The file you have to patch is <tt>/sys/dev/ata/atapi-cd.c</tt> and the
patch is included in the <tt>README.freebsd</tt> file included with
the xine source distribution.

<sect>Increasing Performance<label id="performance">
<p>
Playing Videos (especially DVDs) is <it>very</it> processor intensive. To help
smooth playback, xine attempts to use various forms of hardware acceleration.
The following info is mostly relevant to x86 PCs and Linux so please send in
any tips for other architectures/Unices.

<sect1>Hardware
<p> This section lists some hardware which is useful.
<sect2>AGP bus and graphics card.
<p>
An AGP graphics card allows the computer to send video data more efficiently
to the card. Consequently this allows for smoother video. It is strongly
recommended that you have one.
<sect2>Speeding up RAM (expert only!)
<p>
If you are a BIOS bit-twiddler you can try putting all RAM related timing
settings (like CAS delay, RAS to CAS delay, etc) in the BIOS to 2.
You might want to try some really
  nasty tricks, as explained on (for example)
  <htmlurl url="http://www.overclockers.com/tips105/index03.asp">.
  This website centers around a Windows-tool to tweak the chipset,
  you can do the same on FreeBSD with pciconf. On some linux
  distributions there are similar tools.
  Please contact heiko (<tt>heiko@users.sourceforge.net</tt>) 
if you have any problems or tips about via
  apollo pro chipset tweaking.

<p>A nice performance tuning tool can also be found at
<htmlurl url="http://powertweak.sourceforge.net">.

<sect1>Set up and use raw devices for dvd access
<p>
  Raw devices are available in linux kernel 2.4.x and there
  are patches for older kernels available from
<htmlurl url="ftp://ftp.kernel.org/pub/linux/kernel/people/sct/raw-io/">.
To use raw devices, first connect a free raw device to your dvd
  device, use something like
<verb>
  $ raw /dev/raw1 /dev/hdc
</verb>
  then create a link named "rdvd" pointing to that raw device
<verb>
  $ ln -s /dev/raw1 /dev/rdvd
</verb>
<p>
Some distributions may require you to set up the link as:
<verb>
  $ raw /dev/raw/raw1 /dev/hdc
  $ ln -s /dev/raw/raw1 /dev/rdvd
</verb>
instead. Also some distributions may lack the <tt>/dev/rawctl</tt> device which
may be created using
<verb>
  $ mknod /dev/rawctl c 162 0
</verb>

<sect1>The XVideo extension
<p>
The XVideo extension is a feature of versions of the XFree86 X-server from version
4.0 onwards. It currently is supported on the following cards:
<descrip>
<tag/3DFX Voodoo 3/ The 3dfx driver works in
XFree86 version 4.0.3 and above.
<tag/nVidia GeForce/ Xv only works with nVidia's own drivers (prior to
XFree86 4.2.0). After 4.2.0 Xv works with the standard drivers.
NVidia's own drivers can
be downloaded from <htmlurl url="http://www.nvidia.com/">
<tag/nVidia TNT2 and TNT1/ As with the GeForce, only NVidia's drivers work prior to XFree86 4.2.0.
<tag/ATI cards/ Xv is reported to work with Rage 128 and Mach64 based cards
with drivers from the GATOS project (<htmlurl url="http://www.linuxvideo.org/">). With XFree86 4.2.0
and higher it should owrk 'out-of-the-box'.
<tag/Matrox Gx00 and G450 cards/ Xv works `out-of-the-box' except that it only 
works on the first screen on G450 cards.
<tag/Intel i810 and i815/ Xv works `out-of-the-box'.
<tag/Savage chips/ Xv has been reported to work with some Savage cards using a
modified driver module. There is more information and a list of working
cards on <htmlurl url="http://www.probo.com/timr/savage40.html">.
</descrip>

If the Xv extension is correctly
installed, the output of the <tt>xvinfo</tt> program should be similar to the
following:
<verb>
  Adaptor #1: "Matrox G-Series Backend Scaler"
    number of ports: 1
    port base: 47
    operations supported: PutImage 
    supported visuals:
      depth 16, visualID 0x23
      depth 16, visualID 0x24
      depth 16, visualID 0x25
      depth 16, visualID 0x26
    number of attributes: 3
      "XV_COLORKEY" (range 0 to 16777215)
              client settable attribute
              client gettable attribute (current value is 2110)
      "XV_BRIGHTNESS" (range -128 to 127)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_CONTRAST" (range 0 to 255)
              client settable attribute
              client gettable attribute (current value is 128)
    maximum XvImage size: 1024 x 1024
    Number of image formats: 0
</verb>

You may also need to load the v4l (Video4Linux) X extension. Type
<tt>xdpyinfo | grep XV</tt>. 
If '<tt>XVideo</tt>' forms part of the output, then you have it. If not add 
'<tt>load "v4l"</tt>' in the <tt>Modules</tt> section of your 
XF86Config file (normally <tt>/etc/X11/XF86Config</tt>) and try again.
Then try the '<tt>xvinfo</tt>' command. If the output is
'no adapter present', you 
don't have XV support. Check if your video card is supported on the
XFree86 website (<htmlurl url="http://www.xfree86.org/">), install 
any necessary software and try again. 

<sect1>MTRR (Linux)
<p>
From the Linux Kernel documentation:
<verb>
  On Intel P6 family processors (Pentium Pro, Pentium II and later)
  the Memory Type Range Registers (MTRRs) may be used to control
  processor access to memory ranges. This is most useful when you have
  a video (VGA) card on a PCI or AGP bus. Enabling write-combining
  allows bus write transfers to be combined into a larger transfer
  before bursting over the PCI/AGP bus. This can increase performance
  of image write operations 2.5 times or more.

  The Cyrix 6x86, 6x86MX and M II processors have Address Range
  Registers (ARRs) which provide a similar functionality to MTRRs. For
  these, the ARRs are used to emulate the MTRRs.

  The AMD K6-2 (stepping 8 and above) and K6-3 processors have two
  MTRRs. These are supported.

  The Centaur C6 (WinChip) has 8 MCRs, allowing write-combining. These
  are supported.
</verb>

Making sure MTRRs are setup correctly can <it>considerably</it> improve 
playback when using the XShm output method. To check that your kernel 
supports MTRR, check for the presence of the <tt>/proc/mtrr</tt> file.

Type <tt>cat /proc/mtrr</tt> and check that there is an entry relating to your
video card's memory. If not then consult the file <tt>mtrr.txt</tt> file in the
Linux kernel source documentation.

<sect1>Optimising drive access
<p>
The following applies only to IDE drive units. Firstly make sure that your
motherboard supports the UDMA/33 protocol (or a higher numbered UDMA protocol).
You can use the <tt>hdparm</tt> utility to make Linux use this interface to
optimise drive data transfers.

More details on <tt>hdparm</tt> can be found on 
<htmlurl url="http://linux.oreillynet.com/pub/a/linux/2000/06/29/hdparm.html"
name="http://linux.oreillynet.com/pub/a/linux/2000/06/29/hdparm.html">.

<bf>Warning:</bf> <tt>hdparm</tt> is a dangerous utility and incorrect use may
impact on your computer's ability to read the drive. USE IT AT YOUR OWN RISK.

Check the output of the <tt>hdparm drive_device</tt> includes the following
line:
<verb>
  S hdparm /dev/dvd
  ...
    using_dma    = 1 (on)
  ...
</verb>

If it is off or if you want to change any options consult the <tt>hdparm</tt>
manual page for details.

<sect>Troubleshooting
<p>
The following section lists some common problems and their solutions. If you 
are a regular xine user and feel that there is a common problem not stated 
here, please e-mail
the HOWTO maintainer:
<verb>
  richwareham@users.sourceforge.net
</verb>

<sect1>I see "tvmode: not connected to nvtvd for switching". What's that ?
<p>
xine can use the TV-output features of some video cards to display video
on TV screens. If you don't care about this feature or your card is
not supported you may safely ignore this message.

<sect1>xine keeps complaining about not being able to connect to a socket
<p>
If you get errors like the following in xine's output:
<verb>
xine: could not connect to socket
xine: No such file or directory
</verb>

They may be safely disregarded. They are due to xine attempting to use
a particular program called LIRC to allow control via a Infra-red remote
control. If you don't have/wish for this feature, pretend the errors aren't
there.
<p>
You can stop xine trying to use LIRC by passing it the '<tt>-L</tt>' command
line option.

<sect1>I use a kernel between 2.4.10 and 2.4.15 inclusive and xine and am getting strange errors
<p>
There is a problem with 2.4.10 and upwards which can somtimes cause xine 
to pause at 
odd times. If you suffer from this problem, try downgrading 
the kernel to 2.4.9 or upgrading to 2.4.16.

<sect1>I don't get a DVD button in xine
<p>
Make sure that you have the <tt>/dev/dvd</tt> file setup correctly (see the 
section on playing DVDs above).

<sect1>All seems good but halfway through a DVD the playback stops or loops
<p>
There is a bug in the 2.4.1 kernel. You will need to upgrade.

<sect1>I get this message: <tt>demux error! 00 00 00 (should be 0x000001)</tt>
<p>
Probably xine can't access your input source. Most commonly this happens
when you're trying to play locked/encrypted DVDs. xine
can't play such DVDs out-of-the box (for legal reasons). 

You could use an css-enabled DVD input plugin to avoid this. More information
is available on <htmlurl url="http://xine.cjb.net/">. Note that playing CSS
encrypted DVDs is not an official feature of xine.

You may also have mounted your DVD drive. xine tries to bypass the normal
Linux filesystem and so wont work if the DVD is mounted. Try unmounting it
with the <tt>umount</tt> command.

Another reason could be that your (RPC-2) DVD drive isn't set up
for the right region.

<sect1>I get lots of ``200 frames delivered, 200 frames skipped, 0 frames 
discarded''
<p>
You may have selected the wrong audio channel or you're trying to
play a stream that uses features xine doesn't support (yet).

<sect1>When I play a particular file/stream, xine shows some pictures but 
there's no audio
<p>
Try another audio channel:
<verb>
  $ xine -a channel stream.vob
</verb>

some .VOB files have audio on strange channels (e.g. 3, 7, 10). Also make sure
you are not using the 'null' audio output pugin. Finally check that the 
volume slider is fully up :).

<sect1>Using Linux, I get an error which contains <tt>status=0x51 { DriveReady SeekComplete Error }</tt>
<p>
To fix this error, try enabling `Use multi-mode by default' in your
kernel (re-compile setting ATA/IDE/MFM/RLL support -> IDE, ATA and ATAPI
Block devices -> Use multi-mode by default to `Y'). The relevant piece
of kernel documentation states:
<verb>
  CONFIG_IDEDISK_MULTI_MODE:

  If you get this error, try to say Y here:

  hda: set_multmode: status=0x51 { DriveReady SeekComplete Error }
  hda: set_multmode: error=0x04 { DriveStatusError }

  If in doubt, say N.
</verb>

<sect1>I am having trouble playing a SVCD
<p>
xine <it>can</it> play SVCDs but you'll have to experiment with the audio 
channels.
Normally, you should find an audio track #8 and, for bilingual SVCDs #9, so
<verb>
  $ xine -a 8
</verb>

should allow you to press the ``vcd'' button and play your SVCDs

<sect1>xine drops a lot of frames
<p>

Your hardware may be too slow for xine. 
Make sure you turn on all
speed optimizing options. 
See the section entitled <ref id="performance" 
name="Increasing the Performance of xine">
for more details.

<sect1>Fullscreen doesn't work
<p>
Check the Xv extenstion is working properly.

<sect1>The AC3 via S/PDIF does not work with my soundcard
<p>
The AC3 via S/PDIF is supported by ALSA only for some soundcards
(mostly those with Trident 4DWaveNX, YMF or Emu10k1 chips). So if you have a
suitable soundcard use
<verb>
  $ xine -S -A alsa 
</verb>

The <tt>-S</tt> switch disables the internal AC3 decoder. For very 
slow machines you could improve video playback (without
sound) when you start xine as
<verb>
  $ xine -S -A null
</verb>

<sect1>Where and how do I get the latest development version?
<p>
First a word of warning. The development version is just that. It is meant for
developers. It may not even compile and may not function correctly if it does.
If you <it>have</it> to be on the bleeding edge of development then
check it out of our CVS:
<verb>
  $ cvs -d :pserver:anonymous@cvs.xine.sourceforge.net:/cvsroot/xine login
  (enter an empty password)
  $ cvs -d :pserver:anonymous@cvs.xine.sourceforge.net:/cvsroot/xine co xine-lib
  $ cvs -d :pserver:anonymous@cvs.xine.sourceforge.net:/cvsroot/xine co xine-ui
</verb>

<sect1>How do I use the dvd plugin and/or <tt>dvd://</tt> MRL?
<p>
The DVD plugin delivered with xine currently does not support playback 
of locked and/or encrypted DVDs. Look at the Playing DVDs section for 
details for obtaining a special xine `plugin' which allows playback
of there DVDs.
Due to the uncertain legal situation regarding CSS encryption we do
not include anything of that nature in the xine distribution, nor do
we generally endorse the use of such software (you should check if
the use of such software is legal where you live).
We hope that this situation will change soon.

For unlocked/unencrypted dvds it is a good idea first to check what
files are on the dvd by mounting it. The files are called something
like <tt>.../VIDEO_TS/VTS_xx_x.VOB</tt>, where x are numbers.
If you look for the big .VOB files on a dvd these are probably where the
movie is in. Currently we don't support seamless playback of complete
movies - you will have to play back all of its individual parts.

To play that VOB file use something like
<verb>
  $ xine dvd://VTS_xx_x.VOB
</verb>

Make sure you do not supply any path name (no VIDEO_TS/).

xine tries to open the dvd using /dev/dvd. On FreeBSD this will only
work if you create a symlink to your dvd-devicenode for the time being.

<sect1>I get the message unable to open dvd drive (/dev/dvd) or
xine is unable to detect my DVD player
<p>
You probably don't have /dev/dvd (check that). If so, simply
create a link /dev/dvd that points to your DVD device. 
Something like 
<verb>
  $ cd /dev
  $ ln -s hdc dvd
</verb>
should do the job.

<sect1>How do I play streams from STDIN?
<p>
use something like
<verb>
  $ cat stream.mpg | xine stdin://mpeg1
</verb>

or, if you've got an mpeg-2 stream use
<verb>
  $ cat stream.vob | xine stdin://mpeg2
</verb>

<sect1>How do I change the skin?
<p>
xine has the ability to have its user interface customised using `skins'. 
Eventually you will be able to change skin from the control panel but for now
you have to edit a file.

Run xine at least once - it should write it's config file
<tt>.xine/config</tt> to your home directory. Now edit that file and change
the line "skin:default" to match the skin you would like to use.

<sect1>How can I change color/brightness/contrast?
<p>
At the moment this is only supported on some Xv drivers. You'll find
three entries like these in our ~/.xine/config:
<verb>
  brightness:0
  saturation:0
  contrast:128
</verb>

the values and possible ranges depend on your Xv driver so you'll have 
to experiment a bit to get a good picture.

<sect1>Some parts of my X Desktop get transparent when xine plays the video!
<p>
Looks like some colours on your GUI match the colourkey Xv uses. You can
change the colorkey value to avoid this. There should be a line like
<verb>
  colorkey:2110
</verb>

to your <tt>~/.xine/config</tt> where you can change the colour that's used by xine 
for the video overlay.

<sect1>I get no sound, but ``audio driver 'oss' failed, using null driver instead.''
<p>
First of all, make sure that your OSS Audio drivers are working (ie you can
play music with other software).

The most common reason for this is that some other program is accesing your
audio device. If you're using linux, the command ``<tt>fuser /dev/dsp</tt>'' should give
you the PID of the process.

<sect1>After running xine several times it fail's to allocated shared memory
<p>
This should be fixed in xine 0.3.3 or later. However, this can only work if
you exit xine the "correct" way (e.g. using the panel or pressing "q").
Do <bf>not</bf> simply close the video output window using your window manager - 
xine won't release shared memory in this case (!).

<sect1>I have problems when using xine on FreeBSD
<p>
Check if you find what you are looking for in the file README.freebsd
which is distributed with the xine source code.

<sect1>I think I am pronouncing xine wrong
<p>
It is pronounced [ksi:n]. ksi like the `ks' in `knocks' and n like the
`een' in `been'.

<sect1>I think I found a bug!
<p>
xine is still in developement. Only the latest version of xine is supported by 
the mailing-list so if you don't have the latest version, please upgrade and 
try again. The latest version is always announced on and available from the
xine homepage. If you still have problems, please contact us and send us a full 
bug report. Please include all xine console output and some details about 
your hardware (CPU, GPU, sound card,...) card and operating system. A bug 
report of the form `I cant play the x DVD' is not much use.

You can reach us via email: 

<verb>
  xine Mailing List <xine-user@lists.sourceforge.net>
</verb>

<sect>Contributing to xine
<p>
xine is in continuous development. If you are interested in getting involved
then check out the development version from CVS and check the list in the file
<tt>TODO</tt>.

Please send patches to
<verb>
  xine Mailing List &lt;xine-user@lists.sourceforge.net>
</verb>

Remember that xine is a volumnteer effort and so it may take some time for the
developers to respond to your post.

<sect>Further resources
<p>
<sect1>DVD information
<p>
You can find information on DVD related issues from the following places
<itemize>
<item><htmlurl url="http://www.linuxvideo.org/"> - Another DVD-specific open source
project. Contains lots of information and resources for Linux Video applications.
<item><htmlurl url="http://www.videolan.org/"> - French site (in english) which aims to
provide software for distributing MPEG2 video and DVD over a LAN.
<item><htmlurl url="http://www.opendvd.org/"> - Good site giving lots of information on
the politics of DVD software.
</itemize>

<sect1>Developer resources
<p>
<itemize>
<item><htmlurl url="http://www.linuxtv.org/"> - Lots of useful Digital TV/DVD related
sourcecode and information.
</itemize>

</article>
