]> git.sesse.net Git - vlc/blob - doc/intf-vcd.txt
Add a copyright.
[vlc] / doc / intf-vcd.txt
1 This file documents the ``Extended'' VLC Video CD Plugin
2
3 Copyright (C) 2003 Rocky Bernstein (rocky@panix.com)
4
5 Permission is granted to copy, distribute and/or modify this document
6 under the terms of the GNU Free Documentation License, Version 1.1 or
7 any later version published by the Free Software Foundation; with the
8 Invariant Sections being ``Free Software'' and ``Free Software Needs
9 Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,''
10 and with the Back-Cover Texts as in (a) below.
11
12 (a) The Free Software Foundation's Back-Cover Text is: ``You have
13 freedom to copy and modify this GNU Manual, like GNU software.  Copies
14 published by the Free Software Foundation raise funds for GNU
15 development.''
16
17 -----------------------------------------------------------------
18 Quick start
19 -----------------------------------------------------------------
20
21 The newer Video CD plugin (using libcdio and vcdimager) has some
22 navigation and playback capabilities. However full integration with
23 into vlc is a bit lacking and will probably take some a bit of work
24 and time.
25
26 Although, this plugin replaces the older VCD plugin, the old plugin is
27 still built and installed and used when the newer plugin is not found.
28
29 This document describes only the newer VCD plugin.
30
31 The next section is a general overview of Video CD's in general. If
32 you are in a hurry to find out how to use this plugin or know this
33 already, this section can be skipped. 
34
35 After that we describe the terms and concepts used in the remainder
36 Again, in a hurry, this section can be skipped or skimmed. If you come
37 across a term like "segment," or "lid" that confuses you, look in
38 this section.
39
40 The next section describes the MRL format that this plugin uses. If
41 you want to know how to control where to start playing, read this.
42 Even if you are familiar with vlc MRL's, you probably want to look
43 at this section. Some of the units in a VCD are a little different
44 than those in a DVD or audio CD. 
45
46 The next section gives key bindings that are used by this
47 plugin. Again to be able to control the plugin, especially for
48 playback control, you may need to read this section. 
49
50 The next section describes the configuration parameters you can set
51 for the plugin. Most of the default values I hope are what most
52 people will want to start out with. But for fine control of the
53 defaults, read this section.
54
55 One configuration variable is the debug output. The next section
56 describes the meaning of debug flags and how to troubleshoot the
57 plugin.
58
59 -----------------------------------------------------------------
60 About VCDs, SVCDs, and XVCDs.
61 -----------------------------------------------------------------
62 From: http://www.vcdhelp.com/vcd
63
64  VCD stands for 'Video Compact Disc' and basically it is a CD that
65  contains moving pictures and sound. If you're familiar with regular
66  audio/music CDs, then you will know what a Video CD looks like. A VCD
67  has the capacity to hold up to 74/80 minutes on 650MB/700MB CDs
68  respectively of full-motion video along with quality stereo
69  sound. VCDs use a compression standard called MPEG to store the video
70  and audio. A VCD can be played on almost all standalone DVD Players
71  and of course on all computers with a DVD-ROM or CD-ROM drive with
72  the help of a software based decoder / player. It is also possible to
73  use menus and chapters, similar to DVDs, on a VCD and also simple
74  photo album/slide shows with background audio. The quality of a very
75  good VCD is about the same as a VHS tape based movie but VCD is
76  usually a bit more blurry. If you want better quality checkout
77  SVCD,CVD or DVD.
78
79 From: http://www.vcdhelp.com/svcd.htm
80
81  SVCD stands for "Super VideoCD". A SVCD is very similar to a VCD, it
82  has the capacity to hold about 35-60 minutes on 74/80 min CDs of very
83  good quality full-motion video along with up to 2 stereo audio tracks
84  and also 4 selectable subtitles. A SVCD can be played on many
85  standalone DVD Players and of course on all computers with a DVD-ROM
86  or CD-ROM drive with the help of a software based decoder / player. It
87  is also possible to use menus and chapters, similar to DVDs, on a
88  SVCD and also simple photo album/slide shows with background
89  audio. The quality of a SVCD is much better than a VCD, especially
90  much more sharpen picture than a VCD because of the higher
91  resolution. But the quality depends how many minutes you choose to
92  store on a CD, less minutes/CD generally means higher quality.
93
94 From: http://www.vcdhelp.com/xvcd.htm
95
96  XVCD stands for eXtendedVCD. XVCD has same features as VCD but it is
97  possible to use higher bitrates and higher resolution to get higher
98  video quality. XVCD is basicly everything that uses MPEG1 video, is
99  not within the VCD standard and burnt in "VCD"-Mode.
100
101  XSVCD stands for eXtendedSVCD. XSVCD has same features as SVCD but it
102  is possible to use higher bitrates and higher resolution to get
103  higher video quality. XSVCD is basicly everything that uses MPEG2
104  video, is not within the SVCD standard and burnt in "SVCD"-Mode.
105
106
107 -----------------------------------------------------------------
108 Concepts used by this plugin.
109 -----------------------------------------------------------------
110
111 The remote control of a Video CD players (or the front panel)
112 generally has special keys or buttons. The author of a Video CD can
113 assign what action to use when these buttons are pressed. They buttons
114 are:
115
116  RETURN: Often used to return to the previous menu or previouly
117  interruped video segment. 
118
119  DEFAULT: Possibly take the default selection value. This function can
120  only be assigned when the LID refers to in a "Program Selection List"
121  or "Extended Program Selection List"
122
123  NEXT: Possibly the next entry, chapter, track, or menu.
124
125  PREVIOUS: Possibly the previous entry, chapter, track, or menu.
126
127 Contiguous non-overlapping regions of a Compact Disc are called
128 "Tracks".  The sum of the tracks forms the entire CD.  The CD
129 specifications standards say that between tracks there is to be a
130 150-sector gap.
131
132 In the MRL list described below, we generally don't list the first
133 track which we would call call "Track 0", but other tools like
134 VCDimager, cdinfo, and the CD-reading world in the general call this
135 "Track 1".  This first track usually contains an ISO 9660-format
136 filesystem with metadata describing what's on the CD. It may also
137 contain "segments" or small MPEGs that generally make up still frames
138 and menus.  Aside from the segments which are merely only parts of
139 track 0, it doesn't make sense to try to "play" track 0 (or track 1
140 depending on how you want to count), which is why we don't list it.
141 It seems natural to call the first thing you would want to play "track
142 1" (which in fact is track 2 to everyone else).
143
144 There are two other units that this plugin lists and are used
145 internally. One we call an "entry". This is a starting point of a
146 track which can include the beginning of the track, and when an entry
147 points to the beginning of a track, it is equivalent to listing the
148 track. However Video CD's often have multiple entry points into a
149 track. Logically this corresponds to a "Chapter" or "Scene" of a
150 larger uninterruptable unit. One might think a CD "track" could serve
151 this purpose with a collection of tracks making up a work or
152 movie. Alas, there is "track pregap" space between tracks which appear
153 as a time gaps when hardware players go between tracks - something
154 that doesn't have to happen switching between entries because there in
155 fact is no gap.
156
157 Another unit we use is a called a "segment." These are used in menus
158 an still frames. A menu doesn't have to have a still-frame associated
159 with it; A menu might be implimented as a short looped movie clip.
160 However Video CD specifications allow still frames to have higher
161 resolution than motion clips. And several segments can reside in track
162 0.
163
164 A "playback list item" (also called a "list id or LID) combines
165 "entries" and "segments" and "tracks" together with some navigation
166 logic. "Playback Control" is simply starting playback at a particular
167 playback list item, and unless otherwise specified you'd start with
168 the first playback item which we call P1.
169
170 Below we will refer to an "item" as combination of a unit name (track,
171 entry, segment, playback) and a whole number.
172
173 -----------------------------------------------------------------
174 MRLS:
175 -----------------------------------------------------------------
176
177 This vlc Video CD plugin, identifies itself in the vlc GUI preferences
178 vcdx. It also registers itelf to handle a class of MRL's that start
179 with vcdx://.
180
181 The VCDX MRL takes the following form:
182
183   vcdx://[path to file or vcd device][@[letter]number]]
184
185 (Note: eventually the trailing "x" will be dropped. In MRL's "vcd"
186 works as well as "vcdx".
187
188 A simple vcdx:// runs the default item (e.g. perhaps track 1 or the
189 playback control) the default VCD device (perhaps /dev/cdrom). Whether
190 to use playback control and the default device are user-configurable.
191
192 It is however also possible to specify both Video CD device/filename
193 and the kind of item explicitly in the MRL.
194
195 For example vcdx:/dev/dvd specifies the default entry using device
196 /dev/dvd which might useful if this is your DVD which is different
197 than your CD-ROM device and your DVD drive can play CD's. And
198 vcdx://test_svcd_ntsc.cue specifies the cue file for CD image on disk.
199 (test_svcd_ntsc.bin is the corresponding bin file, but using that
200 won't work.)
201
202 After the optional device name or file name, you can name the kind of
203 unit which preceded by an '@'. An MRL which ends in an @ is like
204 not adding it at all: the default entry type and number is used. Items
205 come in 4 flavors: "Track," "Entry," "Playback," and "Segment." See
206 the preceding section for an explaination of these terms. These units
207 are indicated with the capital first letter of each type: T, E, P, S,
208 s. 
209
210 --- In the future when we are able to control MRL display: 
211 An uppercase S in the MRL display indicates a NTS segment while a
212 lowercase S indicates a PAL segment. 
213 ----
214
215 However when you enter a MRL, the case of these letters is
216 insignificant.
217
218 You can configure various things that affect MRLs are selected when
219 there is some ambiguity in the MRL name. vcdx-PBC sets whether to 
220 to use PBC in a MRL is none is given.  Another configuration
221 setting, vcdx-device, determines what device to use if that part is
222 not given. 
223
224 Some examples of MRLS are given below. In the examples, we assume the
225 following configuration settings:
226
227   vcdx-PBC=1
228   vcdx-device=/dev/cdrom
229
230 vcdx://                   - Play (navigate) default item (in this
231                             case Entry ID 0) from the default device (in this
232                             case set to /dev/cdrom)
233 vcdx://@                  - same as above
234 vcdx:///dev/cdrom@        - same effect as above since the default device
235                             is set to /dev/cdrom. 
236 vcdx:///dev/cdrom@E0      - same as above. But note that this is
237                             because we have autoplay:entry which is
238                             no longer the default value
239 vcdx:///dev/cdrom2@       - Play (navigate) the default item of /dev/cdrom2
240 vcdx:///dev/cdrom2        - should be same as above but is currently broken?
241 vcdx:///dev/cdrom2@T1     - Play Track 1 from /dev/cdrom2
242 vcdx:///dev/cdrom@S1      - Play segment 1 from /dev/cdrom. This
243                             assumes there *is* a segment 1. Check
244                             the MRL list to see if that is the case.
245 vcdx://@P1                - Play Playlist item 1 from default device
246                             If there is no playback control, MRL will
247                             get converted into vcdx:/:E0. Again
248                             check the MRL list to see if there is a P1.
249 vcdx://@P1*               - probably same as above.
250 vcdx:///dev/cdrom@E1      - Play Entry id 1 from default device
251 vcdx://@S0                - Play segment 0 from default device
252 vcdx://@3                 - Play track 3 from default device
253 vcdx:///dev/cdrom2:1      - Play track 1 from /dev/cdrom2
254 vcdx:///tmp/ntsc.cue@     - Play default item (E0) of /tmp/ntsc.bin. Note
255                             trailing @
256 vcdx://ntsc.cue/@E0       - Play entry 0 of ntsc.bin
257 vcdx:///tmp/ntsc.nrg/@E0  - Play entry 0 of /tmp/ntsc.nrg (Nero
258                             file) Works for some simple Nero images.
259
260 -----------------------------------------------------------------
261 Key bindings and non-PBC navigation.
262 -----------------------------------------------------------------
263
264 At present vlc doesn't have special hot-keys for "NEXT", "PREVIOUS",
265 "RETURN" or "DEFAULT". So we use some of other hot-key names that
266 don't seem to correspond to anything for a VCD. The key mapping names
267 are:
268
269 VLC NAME         VCD NAME
270 --------------------------
271 NAVIGATE UP      RETURN
272 NAVIGATE DOWN    DEFAULT
273 NAVIGATE LEFT    PREVIOUS
274 NAVIGATE RIGHT   NEXT
275
276 Also this plugin understand numeric input. Since the hot-keys don't
277 have assignments for numbers, the digits on the keyboard (also
278 available from the keypad if num-lock is on) are hard-coded. Even
279 though this isn't customizable, it's probably what most people would
280 expect and want.
281
282 The enter a number just type the digits of the number. To finish
283 specifying a number use the whatever key is bound to vlc's
284 "ACTIVATE" hot key - the default value is the "Enter" key.
285
286 However the next/previous/return buttons can be prefaced with a number
287 and that has the effect of hitting that button that many times. So
288 let's say you want to go forward 5 "Chapters" and hitting the "Next"
289 key 5 times would do that Instead, you could just enter the digit 5
290 followed by the key that is assigned to "NAVIGATE RIGHT", probably the
291 right-arrow key.
292
293 If you have better suggestions as to what functions the VCD buttons
294 would be better bound to how what fixed algorithm to use when not in
295 PBC, let me know.
296
297 -----------------------------------------------------------------
298 Configuration settings:
299 -----------------------------------------------------------------
300
301 Configuration settings in xine are generally put in ~/.vlc/vlcrc, but
302 can be configured via a vlc GUI. A description of the ones specific to
303 VCDX are listed below.
304
305 - -
306
307 vcdx-device
308
309 This specifies the name of the video device that will be used by default.
310 If you don't specify anything, the plugin scan for a suitable CD-ROM
311 device containing a Video CD in it.
312
313 The default device in a MRL when none is listed. The default is
314 determined by the appropriate name for the OS that you are running.
315
316 - - 
317
318 vcd-debug
319
320 An integer (interpreted as a bit mask) which shows additional
321 debugging information see the Debugging Section below for more
322 information about the bits that can be set.
323
324 -----------------------------------------------------------------
325 Troubleshooting Guide
326 -----------------------------------------------------------------
327
328 The VCD plugin leaves a bit to be desired and has many bugs. I expect
329 that there will not be covered below. But the below is a start.
330
331 This gives higher-level troubleshooting. More detailed and
332 lower-level information is given in the next section DEBUGGING. 
333
334 1. Do you even have the plugin loaded? 
335
336    When you run the vlc GUI, under Settings/Preferences you should see
337    a "plugins" expandable list and under that another "access" list do
338    you see a expandalbe entry under "access" labeled "vcdx"? If so,
339    skip on to step 2.
340
341    a) If no "vcdx" expandable list, thent the VCDX plugin isn't
342    loaded. Does a shared object exist?  The plugin shared object is
343    called "libvcdx_plugin.so" It should be in the directory that has
344    ...vlc/access. If this isn't around you need to build and install
345    the VCDX plugin.
346
347    b) if libvcdx_plugin.so is in the fileystem, there might be a
348    loader error; perhaps libcdio or libvcdinfo are not installed or
349    are the wrong version. Use ldd on the file to see that it has all
350    of the libraries dependencies satisfied. Also you might be able
351    check if there was an attempt to load it by tracking system
352    calls. On Linux and other OS's) "strace" can be used to see if the
353    file gets accessed. On Solaris use "truss". 
354
355    For example on Linux, amonst the many line of output when I run
356    "strace -e trace=file vlc" I see this amongst lots of other
357    output:
358
359    ...
360    stat64("/usr/local/lib/vlc/access/libvcdx_plugin.so", {st_mode=S_IFREG|0755, st_size=302990, ...}) = 0
361   open("/usr/local/lib/vlc/access/libvcdx_plugin.so", O_RDONLY) = 5
362
363    The parameters inside the calls may be different depending on where
364    vlc is installed and what release is installed. If the the file is
365    found and "opened", 
366   
367    There may also be a message may under "setup/logs".
368
369 2. (There plugin was loaded and preferences found).  In the "vcdx" tab
370    of preference. An important selection is "vcdx-device."  If this is
371    set to the empty string, VCDX will try to scan your drives for a
372    suitable device if the driver has the capability to scan for
373    drives. However you can set the device to something of your
374    choosing. On GNU/Linux, this may be "/dev/cdrom" and on Solaris it
375    may be "/vol/dev/aliases/cdrom0".  If you set this field, make sure
376    these are correct for your particular setup. For example, I
377    generally play out of the DVD device and this is called /dev/dvd
378    rather than /dev/cdrom.
379
380 3. (Video CD Setup devices seems correct and there is a CD in the
381    drive).  
382    
383    when you run
384       vlc vcdx://
385
386    you should see your CD disk light go on if you have one. And the CD
387    should be read. 
388    
389    a. If not something's wrong like step 2. Another tack may be to try
390    to read a disk image of a Video CD and thus elimate any problems
391    with hardware. You can get a test Video CD disk image to test here:
392
393    http://www.vcdimager.org/pub/vcdimager/examples/test_svcd/test_svcd_pal.zip
394  
395    After unzipping this run there should be files test_svcd_pal.cue 
396    and test_svcd_pal.bin. Get out of xine and run from the directory
397    that contains those files: 
398      vcdx://test_svcd_pal.cue@E0
399    
400    If you see something playing then this is a hardware problem. 
401
402 -----------------------------------------------------------------
403 Debugging
404 -----------------------------------------------------------------
405
406 **General vlc debugging...
407
408 Before delving to things specific to this plugin, some preparation may
409 be in order. You'll probably want to configure vlc with "--enable-debug".
410 plugin with debug information. Instead of "make'ing" with "make", use
411 "make debug" and instead of installing using "make install" use "make
412 install-debug". 
413
414 I use gdb to debug. Debugging vlc with the entire suite of plugins
415 under gdb is slow because it has to read in symbol tables from all the
416 plugins. There are two ways to make loading faster when debugging. The
417 simplest is just to go to the plugin directory and remove unused
418 plugins. Another approach is create a new directory and make
419 (symbolic) links into the complete plugin directory. Another way to
420 speed up gdb loading is to attach the debugger after vlc has started up
421 via a command like:
422
423   gdb -p *pid-of-vlc-process*
424
425
426 **vcdx debugging...
427
428 It's a fact of life that this plugin is in an incomplete state and has
429 bugs. So to facilitate tracking down problems we let you see what's
430 going on dynamically. Various debugging settings will cause output to
431 appear on vlc plugin log and/or "standard error" (assuming you've run
432 xine in a way that you can capture this).
433
434 You think of debug switches as a bit mask, that you specifiy as an
435 integers the various "bit" values (given in decimal) are listed below.
436
437    name        value       description
438    ------      ----------  -----------
439    meta info            1  Trace Meta information
440    event info           2  Trace keyboard events
441    MRL                  4  Things involved getting lists of what's in the VCD
442    ext call             8  Trace vlc calls to the plugin routines
443    all calls   (10)    16  Trace all calls
444    LSN         (20)    32  Trace updates to the Logical sector number
445                            (basically reads)
446    PBC         (40)    64  Trace things involved with playback control
447    libcdio     (80)   128  Turn on CDIO debugging
448    seek-set    (100)  256  Trace "seek set" calls
449    seek-cur    (200)  512  Trace "seek cur" calls
450    still       (400) 1024  Trace Still-frames
451    vcdinfo     (800) 2048  Turn on VCDINFO debugging
452
453
454 **Video CD debugging...
455
456 The tool vcd-info from the cdio branch of vcdimager can be used to
457 show the entire contents of a Video CD or selected portions of
458 that. Until the cdio branch of vcdimager is completely merged with
459 vcdimager, the cd-info branch vresion has a few more
460 features. (However consult vcdimager for complete of the program).
461
462 vcdxrip can be used to extract portions of a Video CD and or create an
463 XML description file of the Video CD. This XML file and the extracted
464 files can be used by vcdxbuild to recreate another Video CD.
465
466 And finally see also tools cd-info an cd-read from libcdio.
467
468 -----------------------------------------------------------------
469 Other references
470 -----------------------------------------------------------------
471 http://www.vcdhelp.com/
472 http://www.vcdimager.org/
473 http://www.vcdimager.org/guides/#guides
474
475 $Id: intf-vcd.txt,v 1.2 2003/12/01 04:05:42 rocky Exp $