2002-06-13 00:15:32 +00:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2001-08-21 21:01:54 +00:00
|
|
|
<HTML>
|
2002-03-07 17:55:34 +00:00
|
|
|
|
|
|
|
<HEAD>
|
2002-08-04 00:07:55 +00:00
|
|
|
<TITLE>CD, DVD, VCD - MPlayer - The Movie Player for Linux</TITLE>
|
2003-02-27 14:01:19 +00:00
|
|
|
<LINK REL="stylesheet" TYPE="text/css" HREF="../default.css">
|
2002-06-13 00:15:32 +00:00
|
|
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
2002-03-07 17:55:34 +00:00
|
|
|
</HEAD>
|
|
|
|
|
2002-06-13 00:15:32 +00:00
|
|
|
<BODY>
|
2001-08-26 17:28:49 +00:00
|
|
|
|
2001-08-21 21:01:54 +00:00
|
|
|
|
2002-08-20 00:33:04 +00:00
|
|
|
<H2><A NAME="drives">4.1 CD/DVD drives</A></H2>
|
2001-08-24 18:48:13 +00:00
|
|
|
|
2002-08-03 19:19:22 +00:00
|
|
|
<P>Linux documentation excerpt:</P>
|
2002-08-03 01:32:14 +00:00
|
|
|
|
2002-08-03 19:19:22 +00:00
|
|
|
<P>Modern CD-ROM drives can attain very high head speeds, yet some CD-ROM drives
|
|
|
|
are capable of running at reduced speeds. There are several reasons that might
|
|
|
|
make you consider changing the speed of a CD-ROM drive:</P>
|
2002-08-03 01:32:14 +00:00
|
|
|
|
|
|
|
<UL>
|
2002-12-24 18:28:11 +00:00
|
|
|
<LI>There have been reports of read errors at high speeds, especially
|
2002-08-03 19:19:22 +00:00
|
|
|
with badly pressed CD-ROMs. Reducing the speed can prevent data loss under
|
|
|
|
these circumstances.</LI>
|
|
|
|
<LI>Many CD-ROM drives are annoyingly loud, a lower speed may reduce the
|
|
|
|
noise.</LI>
|
2002-08-03 01:32:14 +00:00
|
|
|
</UL>
|
|
|
|
|
2002-12-24 18:28:11 +00:00
|
|
|
<P>You can reduce the speed of IDE CD-ROM drives with <CODE>hdparm</CODE> or a
|
|
|
|
program called <CODE>setcd</CODE>. It works like this:</P>
|
2002-08-03 01:32:14 +00:00
|
|
|
|
|
|
|
<P> <CODE>hdparm -E [speed] [cdrom device]</CODE></P>
|
2001-08-24 18:48:13 +00:00
|
|
|
|
|
|
|
<P> <CODE>setcd -x [speed] [cdrom device]</CODE></P>
|
|
|
|
|
2002-08-03 01:32:14 +00:00
|
|
|
<P>You can also try</P>
|
2001-08-24 18:48:13 +00:00
|
|
|
|
2002-08-23 10:50:19 +00:00
|
|
|
<P> <CODE>echo current_speed:4 > /proc/ide/[cdrom device]/settings</CODE></P>
|
2001-08-24 18:48:13 +00:00
|
|
|
|
2002-08-03 01:32:14 +00:00
|
|
|
<P>but you will need root privileges. The following command may also help:</P>
|
2001-08-24 18:48:13 +00:00
|
|
|
|
2002-08-23 10:50:19 +00:00
|
|
|
<P> <CODE>echo file_readahead:2000000 > /proc/ide/[cdrom device]/settings</CODE></P>
|
2001-08-24 18:48:13 +00:00
|
|
|
|
2002-08-03 01:32:14 +00:00
|
|
|
<P>This sets prefetched file reading to 2MB, which helps with scratched CD-ROMs.
|
2002-12-19 21:35:30 +00:00
|
|
|
If you set it to too high, the drive will continuously spin up and down, and
|
|
|
|
will dramatically decrease the performance.
|
2002-12-24 18:28:11 +00:00
|
|
|
It is recommended that you also tune your CD-ROM drive with
|
|
|
|
<CODE>hdparm</CODE>:</P>
|
2001-08-24 18:48:13 +00:00
|
|
|
|
|
|
|
<P> <CODE>hdparm -d1 -a8 -u1 (cdrom device)</CODE></P>
|
|
|
|
|
2002-12-24 18:28:11 +00:00
|
|
|
<P>This enables DMA access, read-ahead, and IRQ unmasking (read the
|
|
|
|
<CODE>hdparm</CODE> man page for a detailed explanation).</P>
|
2001-08-24 18:48:13 +00:00
|
|
|
|
2002-08-03 01:32:14 +00:00
|
|
|
<P>Please refer to "<CODE>/proc/ide/[cdrom device]/settings</CODE>" for
|
|
|
|
fine-tuning your CD-ROM.</P>
|
2001-08-24 18:48:13 +00:00
|
|
|
|
2002-12-24 18:28:11 +00:00
|
|
|
<P>SCSI drives do not have a uniform way of setting these parameters (Do you
|
|
|
|
know one? Tell us!) There is a tool that works for
|
|
|
|
<A HREF="http://das.ist.org/~georg/">Plextor SCSI drives</A>.</P>
|
|
|
|
|
2002-10-19 13:29:25 +00:00
|
|
|
<P>FreeBSD:</P>
|
|
|
|
|
|
|
|
<P> Speed: <CODE>cdcontrol [-f device] speed [speed]</CODE></P>
|
|
|
|
<P> DMA: <CODE>sysctl hw.ata.atapi_dma=1</CODE></P>
|
|
|
|
|
2002-08-03 19:19:22 +00:00
|
|
|
|
2002-08-20 00:33:04 +00:00
|
|
|
<H2><A NAME="dvd">4.2 DVD playback</A></H2>
|
2001-08-24 18:48:13 +00:00
|
|
|
|
2003-01-30 23:46:07 +00:00
|
|
|
<P>For the complete list of available options, please read the man page.
|
|
|
|
The Syntax for a standard Digital Versatile Disc (DVD) is as follows:</P>
|
|
|
|
|
2003-05-25 19:29:33 +00:00
|
|
|
<P><CODE>mplayer dvd://<track> [-dvd-device <device>]</CODE></P>
|
2003-01-30 23:46:07 +00:00
|
|
|
|
2003-05-25 19:29:33 +00:00
|
|
|
<P>Example: <CODE>mplayer dvd://1 -dvd-device /dev/hdc</CODE></P>
|
2003-01-30 23:46:07 +00:00
|
|
|
|
|
|
|
<P>The default DVD device is <CODE>/dev/dvd</CODE>. If your setup differs,
|
|
|
|
make a symlink or specify the correct device on the command line with the
|
|
|
|
<CODE>-dvd-device</CODE> option.</P>
|
2002-10-27 15:36:33 +00:00
|
|
|
|
|
|
|
<H4>New-style DVD support (mpdvdkit2)</H4>
|
|
|
|
|
2002-10-20 12:20:39 +00:00
|
|
|
<P>MPlayer uses <CODE>libdvdread</CODE> and <CODE>libdvdcss</CODE> for
|
2002-08-03 01:32:14 +00:00
|
|
|
DVD decryption and playback. These two libraries are contained in the
|
2002-10-20 12:20:39 +00:00
|
|
|
<CODE>libmpdvdkit2/</CODE> subdirectory of the MPlayer source tree, you
|
2002-08-03 01:32:14 +00:00
|
|
|
do not have to install them separately. We opted for this solution because
|
2002-12-24 18:28:11 +00:00
|
|
|
we had to fix a <CODE>libdvdread</CODE> bug and apply a patch which adds
|
2002-12-28 13:52:09 +00:00
|
|
|
<B>cracked CSS keys caching support</B> to <CODE>libdvdcss</CODE>. This results
|
|
|
|
in a large speed increase because the keys do not have to be cracked every time
|
|
|
|
before playing.</P>
|
2002-04-27 09:08:30 +00:00
|
|
|
|
2002-10-20 12:20:39 +00:00
|
|
|
<P>MPlayer can also use system-wide <CODE>libdvdread</CODE> and
|
2002-08-03 01:32:14 +00:00
|
|
|
<CODE>libdvdcss</CODE> libraries, but this solution is <B>not</B> recommended,
|
2002-12-24 18:28:11 +00:00
|
|
|
as it can result in bugs, library incompatibilities and slower speed.</P>
|
2002-01-08 17:35:44 +00:00
|
|
|
|
2002-10-27 15:36:33 +00:00
|
|
|
<H4>DVD Navigation support (dvdnav)</H4>
|
|
|
|
|
|
|
|
<P>Support for DVD navigation via <CODE>dvdnav</CODE> was being worked on, but
|
2002-12-24 18:28:11 +00:00
|
|
|
it was never finished properly and it is currently unmaintained. Who knows, it
|
|
|
|
might even compile.</P>
|
2002-04-27 09:08:30 +00:00
|
|
|
|
2002-08-20 00:33:04 +00:00
|
|
|
<H4>Old-style DVD support - OPTIONAL</H4>
|
2001-08-24 18:48:13 +00:00
|
|
|
|
2002-10-27 15:36:33 +00:00
|
|
|
<P>Useful if you want to play encoded VOBs from <B>hard disk</B>. Compile and
|
2002-10-20 12:20:39 +00:00
|
|
|
install <B>libcss</B> 0.0.1 (not newer) for this (If MPlayer fails to
|
2002-10-27 17:33:44 +00:00
|
|
|
detect it, use the <CODE>-csslib /path/to/libcss.so</CODE> option). To use it,
|
|
|
|
you need to be root, use a suid root MPlayer binary or let MPlayer call the
|
2002-10-28 00:55:07 +00:00
|
|
|
suid-root fibmap_mplayer wrapper program.</P>
|
2001-08-24 18:48:13 +00:00
|
|
|
|
2002-10-27 15:36:33 +00:00
|
|
|
<H4>DVD structure</H4>
|
|
|
|
|
2002-12-24 18:28:11 +00:00
|
|
|
<P>DVD disks have 2048 bytes per sector with ECC/CRC. They usually have an UDF
|
2002-10-31 05:07:43 +00:00
|
|
|
filesystem on a single track, containing various files (small .IFO and .BUK
|
|
|
|
files and big (1GB) .VOB files). They are real files and can be copied/played
|
2002-12-24 18:28:11 +00:00
|
|
|
from the mounted filesystem of an unencrypted DVD.</P>
|
2002-10-27 15:36:33 +00:00
|
|
|
|
2002-12-24 18:28:11 +00:00
|
|
|
<P>The .IFO files contain the movie navigation information (chapter/title/angle
|
|
|
|
map, language table, etc) and are needed to read and interpret the .VOB
|
|
|
|
content (movie). The .BUK files are backups of them. They use <B>sectors</B>
|
|
|
|
everywhere, so you need to use raw addressing of sectors of the disc to
|
|
|
|
implement DVD navigation or decrypt the content.</P>
|
2002-10-27 15:36:33 +00:00
|
|
|
|
2002-12-24 18:28:11 +00:00
|
|
|
<P>The whole old-style DVD support with <CODE>libcss</CODE> therefore needs a mounted DVD
|
|
|
|
filesystem and raw sector-based access to the device. Unfortunately you must
|
|
|
|
(under Linux) be root to get the sector address of a file. You have the
|
2002-10-31 05:07:43 +00:00
|
|
|
following choices:</P>
|
2002-10-27 15:36:33 +00:00
|
|
|
|
|
|
|
<UL>
|
2002-12-24 18:28:11 +00:00
|
|
|
<LI>Be root or use a suid-root mplayer binary.</LI>
|
2002-10-28 00:55:07 +00:00
|
|
|
<LI>Let MPlayer call the suid-root fibmap_mplayer wrapper program to access
|
2002-12-24 18:28:11 +00:00
|
|
|
the DVD (used in the old-style DVD playback over <CODE>libcss</CODE>).</LI>
|
|
|
|
<LI>Don't use the kernel's filesystem driver at all and reimplement it in
|
|
|
|
userspace. <CODE>libdvdread</CODE> 0.9.x and <CODE>libmpdvdkit</CODE> do this (new-style DVD
|
|
|
|
support). The kernel UDF filesystem driver is not needed as they already
|
|
|
|
have their own builtin UDF filesystem driver. Also the DVD does not have to
|
|
|
|
be mounted as only the raw sector-based access is used.</LI>
|
2002-10-27 15:36:33 +00:00
|
|
|
</UL>
|
|
|
|
|
2002-12-24 18:28:11 +00:00
|
|
|
<P>Sometimes <CODE>/dev/dvd</CODE> cannot be read by users, so the <CODE>libdvdread</CODE>
|
|
|
|
authors implemented an emulation layer which transfers sector addresses to
|
|
|
|
filenames+offsets, to emulate raw access on top of a mounted filesystem
|
2002-10-31 05:07:43 +00:00
|
|
|
or even on a hard disk.</P>
|
2002-10-27 15:36:33 +00:00
|
|
|
|
2002-12-24 18:28:11 +00:00
|
|
|
<P><CODE>libdvdread</CODE> even accepts the mountpoint instead of the device name for raw
|
|
|
|
access and checks <CODE>/proc/mounts</CODE> to get the device name. It was
|
2002-10-31 05:07:43 +00:00
|
|
|
developed for Solaris, where device names are dynamically allocated.</P>
|
2002-10-27 15:36:33 +00:00
|
|
|
|
|
|
|
<P>The default DVD device is <CODE>/dev/dvd</CODE>. If your setup differs,
|
2002-10-31 05:07:43 +00:00
|
|
|
make a symlink, or specify the correct device on the command line with the
|
|
|
|
<CODE>-dvd-device</CODE> option.</P>
|
2002-10-27 15:36:33 +00:00
|
|
|
|
|
|
|
<H4>DVD authentication</H4>
|
|
|
|
|
|
|
|
<P>The authentication and decryption method of the new-style DVD support is done
|
2002-12-24 18:28:11 +00:00
|
|
|
using a patched <CODE>libdvdcss</CODE> (see above). The method can be specified through the
|
|
|
|
environment variable <CODE>DVDCSS_METHOD</CODE>, which can be set to
|
2002-10-27 15:36:33 +00:00
|
|
|
<CODE>key</CODE>, <CODE>disk</CODE> or <CODE>title</CODE>.</P>
|
|
|
|
|
|
|
|
<P>If nothing is specified it tries the following methods
|
|
|
|
(default: key, title request):</P>
|
|
|
|
|
|
|
|
<OL>
|
|
|
|
<LI><B>bus key:</B> This key is negotiated during authentication (a long mix
|
|
|
|
of ioctls and various key exchanges, crypto stuff) and is used to encrypt
|
|
|
|
the title and disk keys before sending them over the unprotected bus
|
|
|
|
(to prevent eavesdropping). The bus key is needed to get and predecrypt the
|
2002-10-31 05:07:43 +00:00
|
|
|
crypted disk key.</LI>
|
2002-12-24 18:28:11 +00:00
|
|
|
<LI><B>cached key:</B> MPlayer looks for already cracked
|
2002-10-27 15:36:33 +00:00
|
|
|
title keys which are stored in the <CODE>~/.mplayer/DVDKeys</CODE> directory
|
|
|
|
(fast ;).</LI>
|
|
|
|
<LI><B>key:</B> If no cached key is available, MPlayer tries to
|
2002-10-31 05:07:43 +00:00
|
|
|
decrypt the disk key with a set of included player keys.</LI>
|
2002-10-27 15:36:33 +00:00
|
|
|
<LI><B>disk:</B> If the key method fails (e.g. no included player keys),
|
|
|
|
MPlayer will crack the disk key using a brute force algorithm.
|
2002-12-24 18:28:11 +00:00
|
|
|
This process is CPU intensive and requires 64 MB of memory (16M 32Bit
|
2002-10-27 15:36:33 +00:00
|
|
|
entries hash table) to store temporary data. This method should always
|
|
|
|
work (slow).</LI>
|
2002-10-31 05:07:43 +00:00
|
|
|
<LI><B>title request:</B> With the disk key MPlayer requests the crypted title
|
2002-10-27 15:36:33 +00:00
|
|
|
keys, which are inside <I>hidden sectors</I> using <CODE>ioctl()</CODE>.
|
|
|
|
The region protection of RPC-2 drives is performed in this step and may
|
|
|
|
fail on such drives. If it succeeds, the title keys will be decrypted with
|
2002-10-31 05:07:43 +00:00
|
|
|
the bus and disk key.</LI>
|
2002-10-27 15:36:33 +00:00
|
|
|
<LI><B>title:</B> This method is used if the title request failed and does
|
|
|
|
not rely on any key exchange with the DVD drive. It uses a crypto attack to
|
|
|
|
guess the title key directly (by finding a repeating pattern in the
|
2002-12-24 18:28:11 +00:00
|
|
|
decrypted VOB content and guessing that the plain text corresponding to the
|
|
|
|
first encrypted bytes is a continuation of that pattern).
|
2002-10-27 15:36:33 +00:00
|
|
|
The method is also known as "known plaintext attack" or "DeCSSPlus".
|
|
|
|
In rare cases this may fail because there is not enough encrypted data on
|
|
|
|
the disk to perform a statistical attack or because the key changes in the
|
2002-12-24 18:28:11 +00:00
|
|
|
middle of a title. This method is the only way to decrypt a DVD stored on a
|
|
|
|
hard disk or a DVD with the wrong region on an RPC2 drive (slow).</LI>
|
2002-10-27 15:36:33 +00:00
|
|
|
</OL>
|
|
|
|
|
2002-12-24 18:28:11 +00:00
|
|
|
<P>RPC-1 DVD drives only protect region settings through software.
|
2002-10-27 15:36:33 +00:00
|
|
|
RPC-2 drives have a hardware protection that allows 5 changes only. It might
|
|
|
|
be needed/recommended to upgrade the firmware to RPC-1 if you have a RPC-2 DVD
|
2002-12-24 18:28:11 +00:00
|
|
|
drive. Firmware upgrades can be found on this
|
|
|
|
<A HREF="http://www.firmware-flash.com">firmware page</A>. If there is
|
2002-10-27 15:36:33 +00:00
|
|
|
no firmware upgrade available for your device, use the
|
|
|
|
<A HREF="http://www.linuxtv.org/download/dvd/dvd_disc_20000215.tar.gz">regionset
|
2002-12-24 18:28:11 +00:00
|
|
|
tool</A> to set the region code of your DVD drive (under Linux).
|
2002-10-27 15:36:33 +00:00
|
|
|
<B>Warning:</B> You can only set the region 5 times.</P>
|
2001-08-24 18:48:13 +00:00
|
|
|
|
2002-08-03 19:19:22 +00:00
|
|
|
|
2002-08-20 00:33:04 +00:00
|
|
|
<H2><A NAME="vcd">4.3 VCD playback</A></H2>
|
2002-08-03 19:19:22 +00:00
|
|
|
|
2002-10-27 15:36:33 +00:00
|
|
|
<P>For the complete list of available options, please read the man page.
|
2002-12-24 18:28:11 +00:00
|
|
|
The Syntax for a standard Video CD (VCD) is as follows:</P>
|
|
|
|
|
2003-05-25 19:29:33 +00:00
|
|
|
<P><CODE>mplayer vcd://<track> [-cdrom-device <device>]</CODE></P>
|
2002-12-24 18:28:11 +00:00
|
|
|
|
2003-05-25 19:29:33 +00:00
|
|
|
<P>Example: <CODE>mplayer vcd://2 -cdrom-device /dev/hdc</CODE></P>
|
2002-12-24 18:28:11 +00:00
|
|
|
|
|
|
|
<P>The default VCD device is <CODE>/dev/cdrom</CODE>. If your setup differs,
|
|
|
|
make a symlink or specify the correct device on the command line with the
|
|
|
|
<CODE>-cdrom-device</CODE> option.</P>
|
|
|
|
|
|
|
|
<P><B>Note:</B> At least Plextor and some Toshiba SCSI CD-ROM drives have
|
|
|
|
horrible performance reading VCDs. This is because the the CDROMREADRAW ioctl
|
|
|
|
is not fully implemented for these drives. If you have some knowledge of SCSI
|
2003-02-10 18:33:57 +00:00
|
|
|
programming, please <A HREF="../tech/patches.txt">help us</A> implement generic
|
2002-12-24 18:28:11 +00:00
|
|
|
SCSI support for VCDs.</P>
|
2003-01-25 04:05:36 +00:00
|
|
|
|
|
|
|
<P>In the meantime you can extract data from VCDs with
|
|
|
|
<A HREF="http://140.132.1.204/OS/Linux/packages/X/viewers/readvcd/">readvcd</A>
|
|
|
|
and play the resulting file with MPlayer.</P>
|
2002-08-03 19:19:22 +00:00
|
|
|
|
2002-10-27 15:36:33 +00:00
|
|
|
<H4>VCD structure</H4>
|
2002-08-03 19:19:22 +00:00
|
|
|
|
2002-12-24 18:28:11 +00:00
|
|
|
<P>VCD disks consist of one or more tracks:</P>
|
2002-08-03 19:19:22 +00:00
|
|
|
|
|
|
|
<UL>
|
2002-12-24 18:28:11 +00:00
|
|
|
<LI>The first track is a small 2048 bytes/sector data track with an iso9660
|
|
|
|
filesystem, usually containing Windows VCD player programs and maybe other
|
|
|
|
information (images, text, etc).</LI>
|
|
|
|
<LI>The second and other tracks are raw 2324 bytes/sector MPEG (movie) tracks,
|
|
|
|
containing one MPEG PS data packet per sector instead of a filesystem.
|
|
|
|
Similar to audio CD tracks, these tracks <B>cannot be mounted</B> (Did you
|
|
|
|
ever mount an audio CD to play it?). As most movies are inside this track,
|
2003-05-25 19:29:33 +00:00
|
|
|
you should try <CODE>vcd://2</CODE> first.</LI>
|
2002-12-24 18:28:11 +00:00
|
|
|
<LI>There exist VCD disks without the first track (single track and no
|
|
|
|
filesystem at all). They are still playable, but cannot be mounted.</LI>
|
2002-08-03 19:19:22 +00:00
|
|
|
</UL>
|
|
|
|
|
2002-12-24 18:28:11 +00:00
|
|
|
<H4>About .DAT files:</H4>
|
|
|
|
|
|
|
|
<P>The ~600 MB file visible on the first track of the mounted VCD is not a real
|
|
|
|
file! It is a so called ISO gateway, created to allow Windows to handle such
|
|
|
|
tracks (Windows does not allow raw device access to applications at all).
|
|
|
|
Under Linux you cannot copy or play such files (they contain garbage). Under
|
|
|
|
Windows it is possible as its iso9660 driver emulates the raw reading of
|
|
|
|
tracks in this file. To play a .DAT file you need the kernel driver which can
|
|
|
|
be found in the Linux version of PowerDVD. It has a modified iso9660
|
|
|
|
filesystem (<CODE>vcdfs/isofs-2.4.X.o</CODE>) driver, which is able to emulate
|
|
|
|
the raw tracks through this shadow .DAT file. If you mount the disc using
|
|
|
|
their driver, you can copy and even play .DAT files with mplayer. But it
|
|
|
|
<B>will not work</B> with the standard iso9660 driver of the Linux kernel!
|
2003-05-25 19:29:33 +00:00
|
|
|
Use <CODE>vcd://</CODE> instead. Alternatives for VCD copying are
|
2002-12-24 18:28:11 +00:00
|
|
|
the new <A HREF="http://www.elis.rug.ac.be/~ronsse/cdfs/">cdfs</A> kernel
|
|
|
|
driver (not part of the official kernel) that shows CD <I>sessions</I>
|
|
|
|
as image files and <A HREF="http://cdrdao.sourceforge.net/">cdrdao</A>, a
|
|
|
|
bit-by-bit CD grabbing/copying application.</P>
|
2002-10-27 15:36:33 +00:00
|
|
|
|
2001-08-21 21:01:54 +00:00
|
|
|
</BODY>
|
|
|
|
</HTML>
|