Mercurial > mplayer.hg
annotate DOCS/cd-dvd.html @ 8496:2222dd8d8b18
too big readahead can be bad
author | gabucino |
---|---|
date | Thu, 19 Dec 2002 21:35:30 +0000 |
parents | 39d486e8836d |
children | 559217c44624 |
rev | line source |
---|---|
6405
d0f408a8b150
Background color now set by CSS, added doctype and charset, misc HTML fixes
diego
parents:
6393
diff
changeset
|
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
1612 | 2 <HTML> |
4982
6cb9d9a1716d
HTML: different font handling - idea from new hp dezign
gabucino
parents:
4908
diff
changeset
|
3 |
6cb9d9a1716d
HTML: different font handling - idea from new hp dezign
gabucino
parents:
4908
diff
changeset
|
4 <HEAD> |
6882
f3f87f6bf5cf
Added a uniform title: something - MPlayer - The Movie Player for Linux.
diego
parents:
6879
diff
changeset
|
5 <TITLE>CD, DVD, VCD - MPlayer - The Movie Player for Linux</TITLE> |
6391 | 6 <LINK REL="stylesheet" TYPE="text/css" HREF="default.css"> |
6405
d0f408a8b150
Background color now set by CSS, added doctype and charset, misc HTML fixes
diego
parents:
6393
diff
changeset
|
7 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> |
4982
6cb9d9a1716d
HTML: different font handling - idea from new hp dezign
gabucino
parents:
4908
diff
changeset
|
8 </HEAD> |
6cb9d9a1716d
HTML: different font handling - idea from new hp dezign
gabucino
parents:
4908
diff
changeset
|
9 |
6405
d0f408a8b150
Background color now set by CSS, added doctype and charset, misc HTML fixes
diego
parents:
6393
diff
changeset
|
10 <BODY> |
1704 | 11 |
1612 | 12 |
7047 | 13 <H2><A NAME="drives">4.1 CD/DVD drives</A></H2> |
1682 | 14 |
6877 | 15 <P>Linux documentation excerpt:</P> |
1612 | 16 |
6878 | 17 <P>Modern CD-ROM drives can attain very high head speeds, yet some CD-ROM drives |
18 are capable of running at reduced speeds. There are several reasons that might | |
19 make you consider changing the speed of a CD-ROM drive:</P> | |
20 | |
21 <UL> | |
6960 | 22 <LI>There have been reports of read errors at these high speeds, especially |
6878 | 23 with badly pressed CD-ROMs. Reducing the speed can prevent data loss under |
24 these circumstances.</LI> | |
25 <LI>Many CD-ROM drives are annoyingly loud, a lower speed may reduce the | |
26 noise.</LI> | |
27 </UL> | |
1612 | 28 |
6877 | 29 <P>You can reduce the drive speed with hdparm or a program called setcd. |
30 It works like this:</P> | |
31 | |
32 <P> <CODE>hdparm -E [speed] [cdrom device]</CODE></P> | |
1682 | 33 |
34 <P> <CODE>setcd -x [speed] [cdrom device]</CODE></P> | |
1612 | 35 |
6877 | 36 <P>You can also try</P> |
1682 | 37 |
7076
3275af5787e0
Applied patch by Andras Mohari <mayday@varoshaza.nagyatad.hu>, slightly
diego
parents:
7048
diff
changeset
|
38 <P> <CODE>echo current_speed:4 > /proc/ide/[cdrom device]/settings</CODE></P> |
1682 | 39 |
6877 | 40 <P>but you will need root privileges. The following command may also help:</P> |
1682 | 41 |
7076
3275af5787e0
Applied patch by Andras Mohari <mayday@varoshaza.nagyatad.hu>, slightly
diego
parents:
7048
diff
changeset
|
42 <P> <CODE>echo file_readahead:2000000 > /proc/ide/[cdrom device]/settings</CODE></P> |
1612 | 43 |
6877 | 44 <P>This sets prefetched file reading to 2MB, which helps with scratched CD-ROMs. |
8496 | 45 If you set it to too high, the drive will continuously spin up and down, and |
46 will dramatically decrease the performance. | |
6877 | 47 It is recommended that you also tune your CD-ROM drive with hdparm:</P> |
1682 | 48 |
49 <P> <CODE>hdparm -d1 -a8 -u1 (cdrom device)</CODE></P> | |
1612 | 50 |
6877 | 51 <P>This enables DMA access, read-ahead, and IRQ unmasking (read the hdparm man |
52 page for a detailed explanation).</P> | |
1612 | 53 |
6877 | 54 <P>Please refer to "<CODE>/proc/ide/[cdrom device]/settings</CODE>" for |
55 fine-tuning your CD-ROM.</P> | |
1612 | 56 |
7795 | 57 <P>FreeBSD:</P> |
58 | |
59 <P> Speed: <CODE>cdcontrol [-f device] speed [speed]</CODE></P> | |
60 <P> DMA: <CODE>sysctl hw.ata.atapi_dma=1</CODE></P> | |
61 | |
6878 | 62 |
7047 | 63 <H2><A NAME="dvd">4.2 DVD playback</A></H2> |
1682 | 64 |
7934 | 65 <P>For the complete list of available options, please read the man page.</P> |
66 | |
67 <H4>New-style DVD support (mpdvdkit2)</H4> | |
68 | |
7814 | 69 <P>MPlayer uses <CODE>libdvdread</CODE> and <CODE>libdvdcss</CODE> for |
6877 | 70 DVD decryption and playback. These two libraries are contained in the |
7814 | 71 <CODE>libmpdvdkit2/</CODE> subdirectory of the MPlayer source tree, you |
6877 | 72 do not have to install them separately. We opted for this solution because |
7934 | 73 we had to fix a libdvdread bug, and apply a patch which adds <B>cracked CSS |
74 keys caching support</B> to libdvdcss. This results in a large speed increase | |
75 because the keys do not have to be cracked every time before playing.</P> | |
1612 | 76 |
7814 | 77 <P>MPlayer can also use system-wide <CODE>libdvdread</CODE> and |
6877 | 78 <CODE>libdvdcss</CODE> libraries, but this solution is <B>not</B> recommended, |
79 as it can result in bugs, library incompatibilities, and slower speed.</P> | |
80 | |
7934 | 81 <H4>DVD Navigation support (dvdnav)</H4> |
82 | |
83 <P>Support for DVD navigation via <CODE>dvdnav</CODE> was being worked on, but | |
7935 | 84 it was never finished properly and is therefore <B>not recommended</B>!</P> |
4057 | 85 |
7047 | 86 <H4>Old-style DVD support - OPTIONAL</H4> |
4057 | 87 |
7934 | 88 <P>Useful if you want to play encoded VOBs from <B>hard disk</B>. Compile and |
7814 | 89 install <B>libcss</B> 0.0.1 (not newer) for this (If MPlayer fails to |
7935 | 90 detect it, use the <CODE>-csslib /path/to/libcss.so</CODE> option). To use it, |
91 you need to be root, use a suid root MPlayer binary or let MPlayer call the | |
7943 | 92 suid-root fibmap_mplayer wrapper program.</P> |
7934 | 93 |
94 <H4>DVD structure</H4> | |
95 | |
96 <P>DVD disks use all 2048 b/s sectors with ecc/crc. They usually have an UDF | |
7992 | 97 filesystem on a single track, containing various files (small .IFO and .BUK |
98 files and big (1GB) .VOB files). They are real files and can be copied/played | |
99 from a mounted file system of an unencrypted DVD.</P> | |
7934 | 100 |
101 <P>The .IFO files contain the movie navigation informations (chapter/title/angle | |
7992 | 102 map, language table, etc) and is needed to read and interpret the .VOB content |
103 (movie). The .BUK files are backups of them. They use <B>sectors</B> everywhere, | |
104 so you need to use raw addressing of sectors of the disc to implement DVD | |
105 navigation. It's also needed to decrypt the content.</P> | |
7934 | 106 |
107 <P>The whole old-style DVD support with libcss needs therefore a mounted DVD | |
7992 | 108 filesystem and a raw sector-based access to the device. Unfortunately you must |
109 be root (under Linux) to get the sector address of a file. You got the | |
110 following choices:</P> | |
7934 | 111 |
112 <UL> | |
7943 | 113 <LI>Force the user to be root or use a suid-root mplayer binary.</LI> |
114 <LI>Let MPlayer call the suid-root fibmap_mplayer wrapper program to access | |
7935 | 115 the DVD (used in the old-style DVD playback over libcss).</LI> |
7934 | 116 <LI>Don't use the kernel's filesystem driver at all and re-implement it in |
117 userspace. libdvdread 0.9.x and libmpdvdkit does this (New-style DVD | |
118 support). The kernel udf filesystem drivers isn't needed as they already | |
119 have their own, built-in udf fs driver. Also the dvd, doesn't needs to be | |
120 mounted as only the raw sector-based access is used.</LI> | |
121 </UL> | |
122 | |
123 <P>Sometimes /dev/dvd can't be read by users, so the libdvdread authors | |
7992 | 124 implemented an emulation layer which transfers sector addresses to |
125 filenames+offsets, to emulate raw access on the top of a mounted filesystem | |
126 or even on a hard disk.</P> | |
7934 | 127 |
128 <P>libdvdread even accepts the mountpoint instead of the device name for raw | |
7992 | 129 access and checks in <CODE>/proc/mounts</CODE> to get the device name. It was |
130 developed for Solaris, where device names are dynamically allocated.</P> | |
7934 | 131 |
132 <P>The default DVD device is <CODE>/dev/dvd</CODE>. If your setup differs, | |
7992 | 133 make a symlink, or specify the correct device on the command line with the |
134 <CODE>-dvd-device</CODE> option.</P> | |
7934 | 135 |
136 <H4>DVD authentication</H4> | |
1612 | 137 |
7934 | 138 <P>The authentication and decryption method of the new-style DVD support is done |
139 using a patched libdvdcss (see above). The method can be specified over the | |
140 environment variable <CODE>DVDCSS_METHOD</CODE> which can be set to | |
141 <CODE>key</CODE>, <CODE>disk</CODE> or <CODE>title</CODE>.</P> | |
142 | |
143 <P>If nothing is specified it tries the following methods | |
144 (default: key, title request):</P> | |
145 | |
146 <OL> | |
147 <LI><B>bus key:</B> This key is negotiated during authentication (a long mix | |
148 of ioctls and various key exchanges, crypto stuff) and is used to encrypt | |
149 the title and disk keys before sending them over the unprotected bus | |
150 (to prevent eavesdropping). The bus key is needed to get and predecrypt the | |
7992 | 151 crypted disk key.</LI> |
7934 | 152 <LI><B>cached key:</B> MPlayer looks for eventually already cracked |
153 title keys which are stored in the <CODE>~/.mplayer/DVDKeys</CODE> directory | |
154 (fast ;).</LI> | |
155 <LI><B>key:</B> If no cached key is available, MPlayer tries to | |
7992 | 156 decrypt the disk key with a set of included player keys.</LI> |
7934 | 157 <LI><B>disk:</B> If the key method fails (e.g. no included player keys), |
158 MPlayer will crack the disk key using a brute force algorithm. | |
159 This process is CPU intensive and requires 64 MB of memory (16M 32bit | |
160 entries hash table) to store temporary data. This method should always | |
161 work (slow).</LI> | |
7992 | 162 <LI><B>title request:</B> With the disk key MPlayer requests the crypted title |
7934 | 163 keys, which are inside <I>hidden sectors</I> using <CODE>ioctl()</CODE>. |
164 The region protection of RPC-2 drives is performed in this step and may | |
165 fail on such drives. If it succeeds, the title keys will be decrypted with | |
7992 | 166 the bus and disk key.</LI> |
7934 | 167 <LI><B>title:</B> This method is used if the title request failed and does |
168 not rely on any key exchange with the DVD drive. It uses a crypto attack to | |
169 guess the title key directly (by finding a repeating pattern in the | |
170 decrypted VOB content and guessing that that the plain text for first | |
171 encrypted bytes are a continuation of that pattern). | |
172 The method is also known as "known plaintext attack" or "DeCSSPlus". | |
173 In rare cases this may fail because there is not enough encrypted data on | |
174 the disk to perform a statistical attack or because the key changes in the | |
175 middle of a title. On the other hand it is the only way to decrypt a DVD | |
176 stored on a hard disk or a DVD with the wrong region on an RPC2 drive | |
177 (slow).</LI> | |
178 </OL> | |
179 | |
180 <P>RPC-1 DVD drives only protect region settings over software DVD players. | |
181 RPC-2 drives have a hardware protection that allows 5 changes only. It might | |
182 be needed/recommended to upgrade the firmware to RPC-1 if you have a RPC-2 DVD | |
183 drive. Firmware upgrades can be found | |
184 <A HREF="http://perso.club-internet.fr/farzeno/firmware/">here</A>. If there is | |
185 no firmware upgrade available for your device, use the | |
186 <A HREF="http://www.linuxtv.org/download/dvd/dvd_disc_20000215.tar.gz">regionset | |
187 tool</A> to set the region code of your DVD-drive (under Linux). | |
188 <B>Warning:</B> You can only set the region 5 times.</P> | |
1612 | 189 |
6878 | 190 |
7047 | 191 <H2><A NAME="vcd">4.3 VCD playback</A></H2> |
6878 | 192 |
7934 | 193 <P>For the complete list of available options, please read the man page. |
7992 | 194 The Syntax for a standard Video CD (VCD) is as followed: |
195 <CODE>mplayer -vcd <track> [-cdrom-device <device>]</CODE>.<BR> | |
196 Example: <CODE>mplayer -vcd 2 -cdrom-device /dev/hdc</CODE></P> | |
6878 | 197 |
7934 | 198 <H4>VCD structure</H4> |
6878 | 199 |
7934 | 200 <P>VCD disks consists of 2 or more track:</P> |
201 | |
6878 | 202 <UL> |
7934 | 203 <LI>The first track is a few MB 2048 bytes/sector data track, with an iso9660 |
204 filesystem, usualy containing win32 VCD player programs and maybe other infos | |
205 (jpegs, text, etc).</LI> | |
206 <LI>The second and other tracks are raw 2324 bytes/sector mpeg tracks, without | |
207 any filesystem but raw mpeg ps data, one packet per sector. they contain the | |
208 movie(s)... The tracks <B>can't be mounted</B>! It is similar to audio | |
209 tracks (e.g. You never mounted an audio cd to play it, or did you? No). | |
210 As most movies are inside track too, you should try <CODE>-vcd 2</CODE> | |
211 first.</LI> | |
212 <LI>There exist VCD disks without the first track too (single track and no | |
213 filesystems at all). They are still playable, but can't be mounted.</LI> | |
6878 | 214 </UL> |
215 | |
7934 | 216 <P>About .DAT files:</P> |
217 | |
218 <P>The ~600 MB file visible on the first track of the mounted vcd isn't a real | |
7992 | 219 file! It's a so called iso gateway, created to allow Windows to handle such |
220 tracks (Windows doesn't allow raw device access to applications at all). | |
221 Under linux, you cannot copy or play such files (they contain garbage). | |
222 Under Windows it is possible as its iso9660 driver emulates the raw reading of | |
223 tracks in this file. To play a .DAT file you need a kernel driver which can be | |
224 found in the Linux version of PowerDVD. It has a modified iso9660 filesystem | |
225 (vcdfs/isofs-2.4.X.o) driver, which is able to emulate the | |
226 raw tracks through this shadow .DAT file. If you mount the disc using their | |
227 driver, you can copy and even play .DAT files with mplayer. But it <B>won't | |
228 work</B> with the standard iso9660 driver of the kernel! It is recommended to | |
229 use the <CODE>-vcd</CODE> option instead. Alternate options for VCD copy are | |
230 the new cdfs kernel driver (shows CD <I>sessions</I> as image files) and | |
231 cdrdao (a bit-to-bit cd grabber/copier application).</P> | |
7934 | 232 |
233 <P>The default VCD device is <CODE>/dev/cdrom</CODE>. If your setup differs, | |
7992 | 234 make a symlink, or specify the correct device on the command line with the |
235 <CODE>-cdrom-device</CODE> option.</P> | |
7934 | 236 |
1612 | 237 </BODY> |
238 </HTML> |