LDP/LDP/howto/docbook/DVD-Playback-HOWTO.xml

853 lines
38 KiB
XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" []>
<!-- "DTD/docbookx.dtd" []> -->
<article id="DVD-Playback-HOWTO">
<articleinfo>
<!-- Use "HOWTO", "mini HOWTO", "FAQ" in title, if appropriate -->
<title>DVD Playback HOWTO</title>
<author>
<firstname>David</firstname>
<surname>Jao</surname>
<affiliation>
<!-- Valid email...spamblock/scramble if so desired -->
<address><email>djao@dominia.org</email></address>
</affiliation>
</author>
<!-- All dates specified in ISO "YYYY-MM-DD" format -->
<pubdate>2004-02-26</pubdate>
<!-- Most recent revision goes at the top; list in descending order -->
<revhistory id="revhistory">
<revision>
<revnumber>1.0</revnumber>
<date>2004-02-26</date>
<authorinitials>DJ</authorinitials>
<revremark>Initial Release, reviewed by LDP</revremark>
</revision>
<revision>
<revnumber>0.9</revnumber>
<date>2004-02-07</date>
<authorinitials>DJ</authorinitials>
<revremark>submitted to LDP</revremark>
</revision>
<revision>
<revnumber>0.1</revnumber>
<date>2004-01-26</date>
<authorinitials>DJ</authorinitials>
<revremark>first public release</revremark>
</revision>
</revhistory>
<!-- Provide a good abstract; a couple of sentences is sufficient -->
<abstract>
<para>
This document describes how to view DVD movies on a Linux computer
with a DVD drive.
</para>
</abstract>
</articleinfo>
<!-- Content follows...include introduction, license information, feedback -->
<sect1 id="intro">
<title>Introduction</title>
<para>
In this document we describe how to view DVD movies and video on a Linux
system. We give practical, specific, and straightforward commands for
getting DVD playback up and running quickly on most of the popular Linux
distributions. Special attention is given to the various little-known
performance optimizations that are needed for smooth DVD video playback.
</para>
<!-- Legal Sections -->
<sect2 id="copyright">
<title>Copyright and License</title>
<!-- The LDP recommends, but doesn't require, the GFDL -->
<para>
This document, <emphasis>DVD Playback HOWTO</emphasis>, is
copyrighted &#xA9; 2004 by <emphasis>David Jao</emphasis>.
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.2 or any later version published by the Free Software
Foundation; with no Invariant Sections, with no Front-Cover Texts,
and with no Back-Cover Texts. A copy of the license is available
at <ulink url="http://www.gnu.org/copyleft/fdl.html">
http://www.gnu.org/copyleft/fdl.html</ulink>.
</para>
<para>
Linux&#174; is a registered trademark of Linus Torvalds.
</para>
</sect2>
<sect2 id="disclaimer">
<title>Disclaimer</title>
<para>
No liability for the contents of this document can be accepted.
Use the concepts, examples and information at your own risk.
Although this is highly unlikely, there may be errors and
inaccuracies herein that could be damaging to your system. The
author(s) do not take any responsibility for any damage that you
incur through your own actions.
</para>
<para>
The mere act of accessing or viewing DVD content, or dealing
in software written for such purposes, may be illegal in some
localities. The author(s) cannot accept any responsibility for any
actions of yours which violate the laws of the jurisdictions to
which you are subject.
</para>
<para>
All copyrights are held by their by their respective owners,
unless specifically noted otherwise. Use of a term in this
document should not be regarded as affecting the validity of any
trademark or service mark. Naming of particular products or
brands should not be seen as endorsements.
</para>
</sect2>
<!-- Feedback -->
<sect2 id="feedback">
<title>Feedback</title>
<para>
Questions, comments, suggestions, and feedback are most certainly
welcome and should be sent to the author of this document at
<email>djao@dominia.org</email>.
</para>
</sect2>
</sect1>
<sect1 id="prep">
<title>System Preparation</title>
<sect2 id="prereqs">
<title>Hardware Prerequisites</title>
<para>
A certain level of processing power is necessary for smooth DVD
playback. The system requirements in Linux are somewhat higher than in
Windows, because many of the techniques used for hardware acceleration
of video playback work only in Windows.
</para>
<para>At a minimum, I recommend the following:
</para>
<itemizedlist>
<listitem>
<para>700 MHz or higher CPU,</para>
</listitem>
<listitem>
<para>video card with <xref linkend="overlay" /> support</para>
</listitem>
<listitem>
<para>DVD drive with <xref linkend="dma" /> enabled</para>
</listitem>
</itemizedlist>
</sect2>
<sect2 id="symlink">
<title>Creating the /dev/dvd symlink</title>
<para>If you don't already have a <filename>/dev/dvd</filename> symbolic
link, then run (as root) the
command<programlisting><prompt># </prompt><userinput><command>ln -s</command> /dev/hdc /dev/dvd</userinput>
</programlisting>
to create a symbolic link from
<filename>/dev/dvd</filename> to the
actual hardware device representing your DVD-ROM drive
(which in this example is <filename>/dev/hdc</filename>, but you should
replace it with the actual device file used by your drive). The
<filename>/dev/dvd</filename> link is not merely a matter of
convenience; almost all of the player software mentioned in this HOWTO
assumes that the link is there.</para>
<para>If you don't know which device name your DVD-ROM drive uses, you
can usually find it with the command <command>dmesg | grep
DVD</command> in the console or a shell right after booting up the system.</para>
</sect2>
<sect2 id="region">
<title>Setting the DVD Region</title>
<para>All DVD drives (except for <ulink
url="http://www.dvdcca.org/rpc.html">RPC Phase I drives</ulink> made in
1999 or before) enforce <ulink
url="http://www.dvddemystified.com/dvdfaq.html#1.10">region playback
restrictions</ulink> in the drive firmware and consequently are supposed to
be set to a specific region before they can play back discs from that
region (and only that region). In reality, most Linux DVD playback
software can bypass the DVD drive's built-in region locks, but it takes
extra time for the software to break the region lock, and it is better
to avoid the complications of region locks if you can.</para>
<para>
For the small minority of readers who own RPC-I drives, you do not need
to do anything: your drive is already capable of handling DVDs from all
geographical regions. These drives are old enough by now that everybody
who has one of them probably knows already that they have one.
</para>
<para>
For the majority of readers who have RPC-II drives, there are several
options available:
</para>
<orderedlist>
<listitem>
<para>If you only watch discs from one region, the easiest option
is to use the <ulink
url="http://linvdr.org/projects/regionset/">regionset</ulink> program to
set your DVD drive to the correct region.</para>
</listitem>
<listitem>
<para>If you want to watch discs from multiple regions, you can
try to find a firmware upgrade for your DVD drive in the <ulink
url="http://www.firmware-flash.com/">firmware-flash.com
collection</ulink> of unofficial firmware files. Note that most of these
files require you to boot to DOS or Windows to install.
</para>
</listitem>
<listitem>
<para>You can buy a separate DVD drive for each DVD region that you
wish to use. The prices for DVD-ROM drives have dropped low enough to make
this strategy feasible.
</para>
</listitem>
<listitem>
<para>Of course, you can simply do nothing, and rely on the
built-in ability of Linux software to bypass the region restrictions.
Note that even in this case you should use the <ulink
url="http://linvdr.org/projects/regionset/">regionset</ulink> program to
set the drive to the region that you will be using the most, because an
RPC-II drive without a region setting behaves as if
<emphasis>all</emphasis> the regions are locked out.
</para>
</listitem>
</orderedlist>
</sect2>
<sect2 id="overlay" xreflabel="X Video Overlay">
<title>X Video Overlay</title>
<para>The XFree86 video overlay extension is a very poorly documented
standard feature of XFree86 4.x and is <emphasis>absolutely
essential</emphasis> for high quality video playback under Linux. It is
the only type of hardware playback acceleration that is widely
supported in Linux, and it is by far the single most important
configuration element for DVD playback on a Linux system. </para>
<para>To check if you have this extension, type
<command>xvinfo</command> in an X terminal. If the command returns
several screens full of important-looking output, then congratulations,
you have hardware video overlay and you need not worry about it anymore.
</para><para>
If, on the other hand, xvinfo returns with a negative answer like:
<programlisting><prompt># </prompt><userinput><command>xvinfo</command></userinput>
<computeroutput>
X-Video Extension version 2.2
screen #0
no adaptors present
</computeroutput>
</programlisting>
then that means you don't have hardware overlay support. See <xref
linkend="overlaytrouble" endterm="troubleshooting" /> for tips
on how to get overlay support working.
</para>
</sect2>
<sect2 id="dma" xreflabel="DMA">
<title>Enabling DMA</title>
<para>DMA drive access is critical for DVD playback because it lowers
the CPU overhead of disc reading and leaves more of the CPU free for
video playback. On most systems, enabling DMA support for the DVD drive
means the difference between choppy playback and smooth playback.</para>
<para>To see if you have DMA enabled, type (as root) the
command<programlisting><prompt># </prompt><userinput><command>hdparm</command> -d /dev/hdc</userinput>
</programlisting>(replacing <filename>/dev/hdc</filename> with
your DVD drive's actual device name). If DMA is already on, then you're
done. Otherwise, you should turn it on by typing <command>hdparm -d 1
/dev/hdc</command>. You may want to add this command to a startup
script such as <filename>/etc/rc.d/rc.local</filename> to ensure that
the DMA support is active every time your computer boots.
</para>
<para>See the <xref linkend="dmatrouble" endterm="troubleshooting" /> section
if DMA won't turn on even after you've typed the command to turn it
on.</para>
</sect2>
</sect1>
<sect1 id="install">
<title>Software Installation</title>
<para>
Here we cover the installation of the DVD playback software on various
Linux distributions. For each Linux distribution we indicate how to
install <ulink url="http://www.mplayerhq.hu/">MPlayer</ulink>, <ulink
url="http://xine.sourceforge.net/">Xine</ulink>, <ulink
url="http://www.dtek.chalmers.se/groups/dvd/">Ogle</ulink>, and <ulink
url="http://www.videolan.org/">VideoLAN</ulink> onto the system. These
are the four most popular software packages for DVD playback in Linux.
Usage instructions for these programs will be given in the next section.
</para><para>
Read the section that corresponds to your Linux distribution. All
of the installation commands given below should be run as root.
</para>
<sect2 id="redhat">
<title>Red Hat / Fedora</title>
<para>If you run Red Hat Linux or Fedora, you can download all of the
DVD playback software from the <ulink
url="http://freshrpms.net/">FreshRPMS</ulink> package repository. Since
there are so many packages needed for DVD playback, the easiest way to
install all of them is to use <command>apt-get</command>. Here's how
to do it: </para>
<orderedlist>
<listitem>
<para>Follow the link to the version of apt that matches your Red Hat
version:</para>
<itemizedlist>
<listitem>
<para><ulink url="http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/1/apt/">Fedora
Core 1</ulink></para>
</listitem>
<listitem>
<para><ulink url="http://ftp.freshrpms.net/pub/freshrpms/redhat/9/apt/">Red Hat
Linux 9</ulink></para>
</listitem>
<listitem>
<para><ulink url="http://ftp.freshrpms.net/pub/freshrpms/redhat/8.0/apt/">Red Hat
Linux 8</ulink></para>
</listitem>
<listitem>
<para><ulink
url="http://ftp.freshrpms.net/pub/freshrpms/redhat/7.3/apt/">Red Hat Linux 7.3</ulink></para>
</listitem>
</itemizedlist>
<para>Download the appropriate binary x86 RPM package (in this example,
<filename>apt-0.5.15cnc3-0.1.fr.i386.rpm</filename>) and install it
using the <command>rpm</command> command as follows:<programlisting><prompt># </prompt><userinput><command>rpm -Uvh</command> apt-0.5.15cnc3-0.1.fr.i386.rpm</userinput></programlisting></para>
</listitem>
<listitem>
<para>Run the
commands<programlisting><prompt># </prompt><userinput><command>apt-get</command> update</userinput>
<prompt># </prompt><userinput><command>apt-get</command> install mplayer xine ogle_gui</userinput>
</programlisting>to have apt install everything for you.</para>
</listitem>
</orderedlist>
<sect3> <title>Special note about VideoLAN and Red Hat</title>
<para>The FreshRPMS repository contains the
<filename>videolan-client</filename> package for Red Hat 9 and Red Hat
7.3, but not for Red Hat 8 or Fedora Core 1. If you want to install
VideoLAN on Red Hat 9 or Red Hat 7.3, you can just type
<command>apt-get install videolan-client</command> and let the
program take care of it for you. Fedora Core 1 users who want VideoLAN
will need to visit the <ulink
url="http://www.videolan.org/vlc/download-redhat.html">official VideoLAN
Red Hat page</ulink> instead, and follow the instructions there. I do not
recommend that Fedora users install VideoLAN, since the VideoLAN
packages interfere to a large degree with the FreshRPMS packages installed in the previous step.</para>
<para>There appears to be no easy way to install VideoLAN on Red Hat 8.</para>
</sect3>
</sect2>
<sect2 id="debian">
<title>Debian</title>
<para>These instructions are for Debian, stable only (3.0r1 as of
this writing) -- it is assumed that if you run testing or unstable versions
then you should already know what you are doing.
</para><para>
Make sure the following lines are in your
<filename>/etc/apt/sources.list</filename>
file:<programlisting>deb http://hpisi.nerim.net/ stable main
deb http://www.interq.or.jp/libra/oohara/debian-unofficial/ ./
deb http://download.videolan.org/pub/videolan/debian woody main
</programlisting></para>
<para>(The first line is for MPlayer, the second is for the Xine CSS
plugins, and the third is for VideoLAN.) Then run the
commands:</para><programlisting><prompt># </prompt><userinput><command>apt-get</command> update</userinput>
<prompt># </prompt><userinput><command>apt-get</command> install mplayer-686 mplayer-fonts mplayer-doc ogle</userinput>
<prompt># </prompt><userinput><command>/usr/share/doc/ogle/examples/install-css.sh</command></userinput>
<prompt># </prompt><userinput><command>apt-get</command> install xine-ui xine-d5d-plugin xine-d4d-plugin gnome-vlc libdvdcss2</userinput>
</programlisting>
</sect2>
<sect2 id="slackware">
<title>Slackware</title>
<para>The best site for Slackware add-on packages is <ulink
url="http://www.linuxpackages.net/"></ulink>. You can use their search
engine to find and download the Ogle, Xine, MPlayer, libdvdcss,
libdvdnav, libdvdread, lame, and a52dec packages from the web site. Put
the packages into a single directory and run
<command>pkgtool</command> to install the packages onto your
system.</para>
<para>For VideoLAN, you will have to build it from
source since there is no precompiled package on the LinuxPackages web
site yet. To make matters worse, the version of mpeg2dec included
with Slackware 9.1 is too old to be used with VideoLAN, so you have to
compile a newer version of mpeg2dec as well.
</para>
<para>That said, if you <emphasis>still</emphasis> want to install
VideoLAN, then download the latest source packages for <ulink
url="http://libmpeg2.sourceforge.net/">mpeg2dec</ulink> and <ulink
url="http://www.videolan.org/">VideoLAN</ulink> and run the following
commands. Note that you have to disable ffmpeg support for the VideoLAN
build because the Slackware MPlayer packages omit some of the header files
needed by ffmpeg.</para><programlisting><prompt># </prompt><userinput><command>tar </command>xzvf mpeg2dec-0.4.0.tar.gz</userinput>
<prompt># </prompt><userinput><command>cd </command>mpeg2dec-0.4.0</userinput>
<prompt># </prompt><userinput><command>./configure</command> </userinput>
<prompt># </prompt><userinput><command>make</command> </userinput>
<prompt># </prompt><userinput><command>make</command> install </userinput>
<prompt># </prompt><userinput><command>cd </command>..</userinput>
<prompt># </prompt><userinput><command>tar </command>xzvf vlc-0.7.0.tar.gz</userinput>
<prompt># </prompt><userinput><command>cd </command>vlc-0.7.0</userinput>
<prompt># </prompt><userinput><command>./configure</command> --disable-ffmpeg</userinput>
<prompt># </prompt><userinput><command>make</command> </userinput>
<prompt># </prompt><userinput><command>make</command> install </userinput>
</programlisting></sect2>
<sect2 id="mandrake">
<title>Mandrake</title>
<para>Mandrake users can get packages for all of the video programs from
the <ulink url="http://plf.zarb.org/">Penguin Liberation Front</ulink>
web site. The fastest way is to visit the <ulink
url="http://urpmi.org/easyurpmi/">Easy Urpmi</ulink> site and follow the
instructions to generate a listing of the commands you need to type for
PLF access in urpmi. You should then type in the commands returned by
the web site to set up your system for PLF access.
</para>
<para>After you have set up PLF access, type:
<programlisting><prompt># </prompt><userinput><command>urpmi.update</command> -a</userinput>
<prompt># </prompt><userinput><command>urpmi</command> mplayer libdvdcss2 xine-ui ogle ogle_gui vlc</userinput>
</programlisting>to install all the video programs.</para>
</sect2>
<sect2 id="suse">
<title>SuSE</title>
<para>The YaST package program included with SuSE works only with
official packages, and there are no official packages that support DVD.
Therefore you will have to install the packages for all of the DVD
software manually.</para>
<para>MPlayer and Xine packages for SuSE are available on the <ulink
url="http://packman.links2linux.org/?action=index">PackMan site</ulink>.
For MPlayer, you need the MPlayer, lzo, and xvid packages on that
page as well as the <quote>additionally needed binary packages</quote> listed
on the page for each package. SuSE 9.0 users should note that as of this
writing the MPlayer package for SuSE 9.0 has a broken
<filename>libsmbclient.so.0</filename> dependency. You can work around
this problem with the commands<programlisting><prompt># </prompt><userinput><command>rpm -Uvh</command> --nodeps MPlayer-1.0pre3-pm.1.i686.rpm</userinput>
<prompt># </prompt><userinput><command>ln -s</command> libsmbclient3.so.0 /usr/lib/libsmbclient.so.0</userinput>
</programlisting>
</para>
<para>To install Xine, you should download and install the
libxine1-dvd and xine-ui packages from <ulink
url="http://packman.links2linux.org/?action=index">PackMan</ulink>.
Encrypted DVD support in Xine also requires installing <ulink
url="http://download.videolan.org/pub/libdvdcss/1.2.8/rpm/redhat/">
libdvdcss</ulink> from the VideoLAN site.</para>
<para>Ogle can be installed using the <ulink
url="http://www.dtek.chalmers.se/groups/dvd/redhat.shtml">Red Hat
RPMs</ulink> from the Ogle site. SuSE 9.0 users who want to install the
Ogle_gui package will also need to install <ulink
url="ftp://rpmfind.net/linux/SuSE-Linux/i386/8.2/suse/i586/orbit-0.5.17-116.i586.rpm">
orbit</ulink>,
<ulink
url="ftp://rpmfind.net/linux/SuSE-Linux/i386/8.2/suse/i586/gdk-pixbuf-0.18.0-248.i586.rpm">
gdk-pixbuf</ulink>, <ulink
url="ftp://rpmfind.net/linux/SuSE-Linux/i386/8.2/suse/i586/gnome-libs-1.4.1.7-273.i586.rpm">
gnome-libs</ulink>, and <ulink
url="ftp://rpmfind.net/linux/SuSE-Linux/i386/8.2/suse/i586/libglade-0.16-1015.i586.rpm">
libglade</ulink> from SuSE 8.2.</para>
<para>VideoLAN users will need to download the <ulink
url="http://download.videolan.org/vlc/download-redhat.html">Red Hat
RPMs</ulink> from the VideoLAN site and install them forcibly using
<command>rpm --nodeps</command>. The VideoLAN packages also require
<ulink
url="ftp://rpmfind.net/linux/SuSE-Linux/i386/8.2/suse/i586/XFree86-compat-libs-4.3.0-19.i586.rpm">XFree86-compat-libs</ulink>
and <ulink
url="ftp://rpmfind.net/linux/SuSE-Linux/i386/8.2/suse/i586/freetype-1.3.1-801.i586.rpm">freetype</ulink>
from SuSE 8.2 in order to run.</para>
</sect2>
<sect2 id="gentoo">
<title>Gentoo</title>
<para>The basic command to use is:<programlisting><prompt># </prompt><userinput><command>emerge</command> sync</userinput>
<prompt># </prompt><userinput><command>USE="dvd mmx sse" emerge</command> mplayer xine-ui vlc ogle-gui</userinput>
</programlisting></para><para>
If you have an AMD processor, you should type <command>USE="dvd
mmx 3dnow"</command> instead of using the <varname>sse</varname> flag.
Athlon XP owners can use the <varname>3dnow</varname> and
<varname>sse</varname> flags together.</para>
</sect2>
</sect1>
<sect1 id="usage">
<title>Software Usage</title>
<para>
Although I have tried very hard to keep this HOWTO focused on practical
advice instead of abstract theory, it is necessary to have some minimal
background in television video in order to understand how to get the
best possible video quality under Linux.
</para>
<sect2 id="principles">
<title>General principles: deinterlacing, telecine, and framerates</title>
<para>
Regular television video is <emphasis>interlaced</emphasis>, meaning
that the odd-numbered scanlines are recorded (and displayed) first,
followed by the even numbered scanlines, then the odd ones again, then
the even ones again, etc. Each individual line is displayed 30 times a
second (or 25, depending on where you live), but because of the
interlacing, the television image as a whole is refreshed 60 times a
second (or 50), with only half of the total lines being refreshed each
time.
</para>
<para>
In general, with interlaced motion pictures, there is no way to
reconstruct any single video frame perfectly without artifacts. This
point is important enough to repeat: <emphasis>there is no way to
perfectly reconstruct any single frame!</emphasis> The reason is that
the odd-numbered lines are recorded onto the video tape with a timing
skew of one half-frame relative to the even-numbered lines. If the video
picture is still, this timing skew is no problem, but for moving
pictures it causes half the lines to be displaced from the other half.
On a television screen, you can't see this displacement, since TV
screens (except for high-end HDTV monitors) are of such low quality that
the artifacts aren't visible. However, on a computer screen, this
displacement is very visible and causes comb-like artifacts to appear in
the video. You can see screenshots of interlacing artifacts in the
<ulink url="http://www.lukesvideo.com/interlacing.html">interlacing
section</ulink> of <ulink
url="http://www.lukesvideo.com/">Luke's Video
Guide</ulink>.</para>
<sect3 id="deinterlace">
<title>How to fix interlacing artifacts</title>
<para>The process of removing interlacing artifacts is called
<emphasis>deinterlacing</emphasis>. Unfortunately, all deinterlacing
techniques are imperfect to some extent, and there is no single method
which works best in all situations. It is therefore important to
experiment with all of the different possible deinterlace settings to
see which one works best for a particular disc.
</para>
<para>
<xref linkend="mplayer" /> users can get a list of deinterlacing options
by typing <command>mplayer -pphelp</command> at the command line.
Find the option that you want to use, and then use the <command>-vf
pp=&lt;option&gt;</command> syntax to activate the option. For example,
I usually use the <varname>lb</varname> option, which is
done with the command: <command>mplayer -vf pp=lb</command>, followed by
whatever other options you would normally use to play the DVD.
</para>
<para>
<xref linkend="vlc" /> users can right-click on the movie to get a
list of deinterlacing options (under <guimenuitem>Video
Settings</guimenuitem> or <guimenuitem>Deinterlace</guimenuitem>,
depending on the program version).
</para>
<para>
<xref linkend="xine" /> has a list of
deinterlacing options in the configuration panel; to get to it, right-click on the movie window, open the
<menuchoice><guimenu>Settings</guimenu> <guimenuitem>Setup</guimenuitem>
</menuchoice> dialog, set <quote>Configuration experience level</quote> to
<quote>Advanced</quote>, and then look for <quote>Software deinterlace
method</quote> under the <quote>Video</quote> tab.</para>
<para><xref linkend="ogle" /> has no deinterlacing support, so it is not
recommended to use Ogle for watching interlaced video.
</para>
</sect3>
<sect3 id="telecine">
<title>Telecined video</title>
<para>This section only applies to video in NTSC format (used in North
America, east Asia, and parts of Latin America) -- PAL users (the rest of
the world) can skip ahead.</para>
<para>
The one exception to all of the above discussion about interlacing is in
the case of telecined video. Briefly put, <emphasis>telecine</emphasis>
is a special kind of interlacing that is done only to theatrical (i.e.
cinematic) movies and some forms of hand-drawn animated shows. The
special thing about telecine is that it can usually be perfectly undone.
The details are too complicated to explain here, but you can read about
it in <ulink url="http://www.lukesvideo.com/telecining.html">Luke's
Video Guide</ulink> or <ulink
url="http://www.access-one.com/rjn/laser/legacy/ld12.txt">Bob Niland's
FAQs</ulink> if you're curious.
</para>
<para>The process of undoing the telecine artifacts is called
<emphasis>inverse telecine</emphasis>. The good news is that inverse
telecine, done properly, fully restores the original video quality of
the source video with no artifacts whatsoever. The bad news is that
<xref linkend="mplayer" /> is the only player program in the world right
now that can perform inverse telecine.</para>
<para>To perform inverse telecine in MPlayer, simply add the
<varname>-vf ivtc</varname> option to the MPlayer command. This
option is the right one to use if you are watching a movie you know
originated as a theatrical release, or if you are watching animated
shows. Warning: this option is very CPU intensive. You need at least a 1 GHz
processor to even think about doing it.</para>
</sect3>
<sect3 id="windows">
<title>How come Windows users don't have to deal with all this?</title>
<para>Windows DVD players hide most of the complexity of DVD playback
and fall back to the lowest common demoninator when playing DVDs. The
result is that you get playback quality which is decent in a wide range
of situations but not always the best that can be achieved in any given
situation. For example, no Windows DVD player in the world has an
inverse telecine filter like MPlayer does, so telecined material always
looks dramatically worse in Windows than in MPlayer under Linux.</para>
</sect3>
</sect2>
<sect2>
<title>Specific usage instructions</title>
<para>Here we give specific instructions for launching basic DVD
playback in the various player programs. These commands only cover the
basic steps of operating each program. You are encouraged to refer to
the man pages of each program for further instructions.</para>
<para>Put the DVD that you want to play into your drive before
attempting playback.</para>
<sect3 id="mplayer" xreflabel="MPlayer">
<title>MPlayer</title>
<para>Type <command>mplayer dvd://1</command> to begin playing title
#1 on the disc. To play other title numbers, substitute the appropriate
number in place of <command>1</command>.
</para>
<para>Old versions of MPlayer, such as the one used in Debian, require
the command <command>mplayer -dvd 1</command> instead. In some cases
you also have to explicitly add the option <varname>-vo xv</varname>
in order to make MPlayer use the hardware video overlay port.</para>
<para>Subtitle and audio options for MPlayer have to be specified on the
command line. The format is <varname>-alang NN</varname> or
<varname>-slang NN</varname> where <varname>NN</varname> is the two-letter
language code of the language you want. For example, to play back
Japanese audio with English subtitles, type:<programlisting><prompt># </prompt><userinput><command>mplayer</command> dvd://1 -alang ja -slang en</userinput>
</programlisting>
on the command line.
</para>
</sect3>
<sect3 id="xine" xreflabel="Xine">
<title>Xine</title>
<para>Simply type <command>xine</command> at the command prompt to
start the program.</para>
<para>The first time you start the program, it will display a
configuration screen with a bunch of options. In most cases you can
leave all of the options at the defaults.</para>
<para>The program has a graphical console with a row of labeled buttons
along the bottom. Press the DVD button to start playing the DVD. (However, if
your version of Xine has a D5D button, use that instead.)</para>
<para>Xine supports DVD menus, so you can set language or subtitling
options as you normally would via the disc's own menu.</para>
</sect3>
<sect3 id="ogle" xreflabel="Ogle">
<title>Ogle</title>
<para>Type <command>ogle</command> to start the program. Depending on
which version of the program you have, it may start playing the DVD
automatically. If it doesn't, then click on the <guimenu>File</guimenu>
menu and select <guimenuitem>Open Disc</guimenuitem> to begin reading
the disc.</para>
<para>Ogle, like Xine, supports DVD menus for setting the language or
subtitling options.</para>
</sect3>
<sect3 id="vlc" xreflabel="VideoLAN">
<title>VideoLAN</title>
<para>Use the <command>vlc</command> command to bring up the VideoLAN
GUI and click on the disc icon to open the disc and start playing.
Right click the playback window to bring up the options menu, which
includes deinterlacing, audio, and subtitle options.</para>
</sect3>
</sect2>
</sect1>
<!-- Other Sections of Interest... -->
<sect1>
<title id="troubleshooting">Troubleshooting</title>
<qandaset defaultlabel="number">
<qandaentry>
<question id="overlaytrouble" xreflabel="Overlay Troubleshooting">
<para><command>xvinfo</command> returns <quote>no adaptors
present</quote></para>
</question>
<answer>
<para>Make sure you are running XFree86 4.1 or above. You can find
out your version of XFree86 by typing <command>X
-version</command> at the command prompt.</para>
<para>Use an appropriate driver for your video card. Some Linux
distributions default to using the generic XFree86 VESA driver instead
of the specific driver for your video card. You need to use the
hardware-specific driver for your card in order to get hardware
overlay support.</para>
<itemizedlist>
<listitem>
<para>ATI users should try downloading the improved ATI XFree86
drivers from the <ulink
url="http://gatos.sourceforge.net/">GATOS</ulink> home page, or from the
<ulink url="http://www.ati.com/support/faq/linux.html">official ATI
Linux support page</ulink>.</para>
</listitem>
<listitem>
<para>NVidia users should try downloading the <ulink
url="http://www.nvidia.com/content/drivers/drivers.asp">official NVidia
Linux drivers</ulink> for their video card.</para>
</listitem>
<listitem>
<para>Sometimes upgrading <ulink
url="http://www.xfree86.org/">XFree86</ulink> can provide you with an
improved driver that has hardware overlay support, but such an upgrade is
beyond the scope of this HOWTO.</para>
</listitem>
</itemizedlist>
</answer>
</qandaentry>
<qandaentry>
<question id="overlaybug" xreflabel="Overlay output not working">
<para><command>xvinfo</command> works but overlay output is
garbled</para>
</question>
<answer>
<para>Problems with garbled or missing overlay output usually mean
that you don't have enough video RAM to hold both the regular desktop
display and the video overlay display at once. Typically you need twice
as much video RAM as normal at a given video resolution in order to use
hardware video overlay. In some cases you may even need 3 to 5 times more
RAM because of internal buffering in the video card.</para>
<para>The only easy way to lower your video RAM requirements is to
switch to a lower video resolution while playing videos.</para>
</answer>
</qandaentry>
<qandaentry>
<question id="dmatrouble" xreflabel="DMA Troubleshooting">
<para>DMA isn't working</para>
</question>
<answer>
<para>You can tell that DMA is broken if using the command
<command>hdparm -d1</command> on your DVD drive returns a message like the
following:<programlisting><prompt># </prompt><userinput><command>hdparm</command> -d1 /dev/hda</userinput>
<computeroutput>
/dev/hda:
setting using_dma to 1 (on)
HDIO_SET_DMA failed: Operation not permitted
using_dma = 0 (off)
</computeroutput></programlisting></para><para>
The only way to fix this problem is to compile a kernel with DMA support
for your particular chipset. It is beyond the scope of this HOWTO to
explain how to compile a kernel, but the steps which are particularly
relevant to DMA support are as follows:</para>
<orderedlist>
<listitem><para>Download a <emphasis>recent</emphasis> kernel so that
you have the greatest possible chance of DMA being supported on your
chipset.</para>
</listitem>
<listitem><para>Unpack your kernel and type <command>make
xconfig</command>
in the kernel build directory. Under <quote>ATA/IDE/MFM/RLL support</quote>,
select <quote>IDE, ATA, and ATAPI Block devices</quote> and enable
<quote>Generic PCI bus-master DMA support</quote> and <quote>Use DMA by
default when available</quote>.</para>
</listitem>
<listitem><para>On the same page there are several dozen chipset-specific DMA
drivers that continue downward for several screens. Find and select one
relevant to your chipset, if there are any. For example if you have
an AMD Athlon based VIA chipset, enable the <quote>VIA82CXXX chipset
support</quote> item.</para>
</listitem>
</orderedlist>
<para>For more information on compiling kernels, see the <ulink
url="http://en.tldp.org/HOWTO/Kernel-HOWTO/">Kernel HOWTO</ulink> as
well as the <ulink url="http://www.tldp.org/HOWTO/Ultra-DMA.html">Linux
Ultra-DMA Mini-Howto</ulink>.</para>
</answer>
</qandaentry>
<qandaentry>
<question id="choppyvideo" xreflabel="Video is choppy">
<para>Video playback is choppy
</para>
</question>
<answer>
<para>On a fast enough computer (say, over 1 GHz), choppy video
playback usually means that your overlay support or DMA support is
misconfigured. See the previous troubleshooting items.
</para>
<para>On a very slow computer (say, 0-500 MHz), there is nothing
you can do short of hardware upgrades to make DVD playback run well.
</para>
<para>For borderline computers (anything in between), you can
gain a modest (~10%) performance boost by upgrading from kernel 2.2 to
kernel 2.4 and using an SSE-optimized player program like
MPlayer.
</para>
<para>Finally, if all else fails, run MPlayer with the option
<command>mplayer -framedrop</command> to patch over occasional glitches
in video playback.
</para>
</answer>
</qandaentry>
<qandaentry>
<question id="choppysound" xreflabel="Sound is choppy">
<para>Sound playback is choppy
</para>
</question>
<answer>
<para>The most common cause of sound playback problems is from
sound cards that do not support 48 kHz audio playback. For people in
this category, I strongly suggest that you purchase a new sound card.
Even a cheap PCI sound card can give you a substantial upgrade in sound
quality for less than the cost of two DVDs.
</para>
<para>Failing that, you can lighten the load on your sound playback
system by not using a sound daemon such as ESounD or aRts and playing
the DVD audio directly to the OSS driver. To do this with MPlayer, run
<command>mplayer -ao=oss</command> along with whatever other options
you normally use.
</para>
</answer>
</qandaentry>
<qandaentry>
<question id="cssgarbled" xreflabel="Out of region discs garbled">
<para>Out of region discs play back garbled
</para>
</question>
<answer>
<para>In the past, older versions of most of the programs
discussed here have had trouble decrypting out-of-region discs. The
result of a failed decryption looks like the colored video noise that
you see.
</para><para>Upgrading to the newest available version of any of the
programs should solve this problem.</para>
</answer>
</qandaentry>
<qandaentry>
<question id="csstimeout" xreflabel="Out of region discs hang">
<para>Out-of-region discs hang on playback
</para>
</question>
<answer>
<para>Watch the DVD drive's access light while the program is
hanging. Is the light still blinking in an access pattern? If it is (and
usually it will be), that means the program is still in the middle of
decrypting the disc.
</para><para>Decrypting the DVD involves mounting a fairly
large-scale computational effort to recover the key. It is not at all
unusual for a computer to take five or even ten minutes to decrypt a
single DVD key.</para>
<para>In-region discs never have this problem because the DVD drive
firmware automatically decrypts discs that match with the drive's own
region.</para>
</answer>
</qandaentry>
</qandaset>
</sect1>
<sect1 id="moreinfo">
<title>Further Information</title>
<itemizedlist>
<listitem><para><ulink url="http://dag.wieers.com/howto/dvd/">Dag
Wieers' overview</ulink> of the Linux DVD playback programs</para></listitem>
<listitem><para><ulink
url="http://www.bunkus.org/dvdripping4linux/en/separate/index.html">Moritz
Bunkus's DVD ripping guide</ulink> for Linux</para></listitem>
</itemizedlist>
</sect1>
</article>