File: dvdauthor.sgml

package info (click to toggle)
dvdauthor 0.7.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,436 kB
  • sloc: ansic: 21,379; sh: 634; yacc: 460; lex: 199; makefile: 83
file content (687 lines) | stat: -rw-r--r-- 33,365 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
<refentry id="dvdauthor">

<refmeta>
<refentrytitle>dvdauthor</refentrytitle>
<manvolnum>1</manvolnum>
</refmeta>

<refnamediv>
<refname>dvdauthor</refname>
<refpurpose>assembles multiple mpeg program streams into a suitable DVD filesystem</refpurpose>
</refnamediv>

<refsynopsisdiv>
<cmdsynopsis>
<command>dvdauthor</command>
<arg>-o <replaceable>output-dir</replaceable></arg>
<arg choice="req">-x <replaceable>xml-control-file</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>dvdauthor</command>
<arg>-o <replaceable>output-dir</replaceable></arg>
<group><arg>-j</arg><arg>--jumppad</arg><arg>-g</arg><arg>--allgprm</arg></group>
<group><arg>-T</arg><arg>--toc</arg></group>
<arg><replaceable>menu or title options</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<refsect1><title>DVD Background</title>
<para>

At a high level, a DVD is a collection of menus and titles.
Conceptually, a menu contains buttons which can be assigned actions
and provides a list of choices to the end user, while a title contains
the main content of the DVD.  However, in reality many of the features
available in menus (including buttons, pausing, and looping) are also
available in titles.

</para>
<para>

The menus and titles are divided into titlesets and the VMGM menu set.
A titleset can contain a number of menus and titles which are meant to
act together.  The "menu", "audio", "subtitle", and "angle" buttons on
the DVD player's remote control will all access menus in the same
titleset as the title which is being played.  All the titles and menus
of a given titleset have the same video, audio, and subtitle settings
(the definitions for the menus are independent from the definitions
for the titles), so if you want to have different settings (for
example widescreen vs standard aspect ratios), then you need separate
titlesets.  Titlesets are not meant to jump to one another, so the
VMGM menu domain is used.  It is a collection of menus (no titles)
that can access the menus and titles of all the titlesets.

</para>
<para>

One of the most frustrating things when deciding how to author a DVD
is that there are often many ways to accomplish the same task.  For
example, you must decide whether to locate menus at the VMGM level or
the titleset level.  A typical setup is to locate the high level menus
at the VMGM level, and the low level configuration menus (scene /
audio / subtitle selection) at the titleset.  If there are DVD extras,
perhaps with a lower quality audio track and a 4:3 aspect ratio, then
they would be in a separate titleset with a menu to select among the
extras located at the titleset level.

</para>
</refsect1>
<refsect1><title>dvdauthor Description</title>

<para><command>dvdauthor</command> works in discrete operations.  It
authors each titleset one at a time, and then finally authors the VMGM
to complete the disc.  At that point the contents can be written out
to a DVD.  If you are controlling <command>dvdauthor</command> with
command line arguments, then each step will occur independently;
however if you are using the XML control file, then you have the
option of combining some or all the steps into one.</para>

<para>The VOBs passed to <command>dvdauthor</command> must have DVD
NAV (VOBU) packets multiplexed in at the correct locations.  Many
tools can do this, including <command>mplex</command> from mjpegtools
1.6.0 or later.  <command>dvdauthor</command> will then fill these
packets in with the correct data.  Special care has been taken to
ensure <command>dvdauthor</command> is fifo compliant; that is every
source VOB can be the output of another program (such as
<command>mplex</command>).  This can make execution faster on many
systems by avoiding extra filesystem accesses.</para>

</refsect1>

<refsect1><title>Command Line Description</title>

<variablelist>

<varlistentry><term><literal>-o <replaceable>output-dir</replaceable></literal></term>
<term><literal>-O <replaceable>output-dir</replaceable></literal></term>
<listitem><para>The destination directory to store the DVD-Video file structure in.
If -O is specified, then any existing directory is (safely) deleted (only items that
look like part of a DVD-Video structure are removed).</para></listitem></varlistentry>

<varlistentry><term><literal>-x <replaceable>xml-control-file</replaceable></literal></term>
<listitem><para>Specifies the control file describing the output structure to create.</para></listitem></varlistentry>

</variablelist>

<para>Note that the remaining command-line options are <emphasis>deprecated</emphasis>. Use the
XML control file instead.</para>

<variablelist>

<varlistentry><term><literal>-j</literal></term><term><literal>--jumppad</literal></term>
<listitem><para>Enables the creation of jumppads, which allow greater flexibility in choosing jump/call destinations.</para></listitem></varlistentry>

<varlistentry><term><literal>-g</literal></term><term><literal>--allgprm</literal></term>
<listitem><para>Enable the use of all 16 general purpose registers.  Prohibits the use of jumppad and some complex expressions that require temporary registers.</para></listitem></varlistentry>

<varlistentry><term><literal>-T</literal></term>
<listitem><para>Creates the table of contents file instead of a
titleset. If this option is used, it should be listed first, and you
may not specify any titles.</para></listitem>
</varlistentry>


<varlistentry><term><literal>-m</literal></term>
<listitem><para>Creates a menu.</para></listitem></varlistentry>

<varlistentry><term><literal>-t</literal></term>
<listitem><para>Creates a title.</para></listitem></varlistentry>

<varlistentry><term><literal>-v <replaceable>video-opts</replaceable></literal></term><term><literal>--video=<replaceable>video-opts</replaceable></literal></term>
<listitem><para>A plus (+) separated list of video options.  Dvdauthor
will try to infer any unspecified options.  pal, ntsc, 4:3, 16:9,
720xfull, 720x576, 720x480, 704xfull, 704x576, 704x480, 352xfull,
352x576, 352x480, 352xhalf, 352x288, 352x240, nopanscan, noletterbox, crop.
Default is 4:3, 720xfull</para></listitem></varlistentry>

<varlistentry><term><literal>-a <replaceable>audio-opts</replaceable></literal></term><term><literal>--audio=<replaceable>audio-opts</replaceable></literal></term>
<listitem><para>A plus (+) separated list of options for an audio
track, with each track separated by a comma (,).  For example -a
ac3+en,mp2+de specifies two audio tracks: the first is an English
track encoded in AC3, the second is a German track encoded using
MPEG-1 layer 2 compression.  ac3, mp2, pcm, dts, 16bps, 20bps, 24bps,
drc, surround, nolang, 1ch, 2ch, 3ch, 4ch, 5ch, 6ch, 7ch, 8ch, and any
two letter ISO 639 language abbreviation.  Default is 1 track, mp2,
20bps, nolang, 2ch.  'ac3' implies drc, 6ch.
</para></listitem></varlistentry>

<varlistentry><term><literal>-s <replaceable>subpicture-opts</replaceable></literal></term><term><literal>--subpictures=<replaceable>subpicture-opts</replaceable></literal></term>
<listitem><para>A plus (+) separated list of options for a subpicture
track, with each track separated by a comma (,). nolang and any two
letter language abbreviation (see -a) Default is no subpicture
tracks.</para></listitem>
</varlistentry>

<varlistentry><term><literal>-e <replaceable>entry(s)</replaceable></literal></term><term><literal>--entry=<replaceable>entry(s)</replaceable></literal></term>
<listitem><para>Makes the current menu the default for certain
circumstances. It is a comma separated list of any of:</para><para>for
TOC menus: title</para><para>for VTS menus: root, ptt, audio,
subtitle, angle</para></listitem>
</varlistentry>

<varlistentry><term><literal>-p <replaceable>palette-file</replaceable></literal></term><term><literal>--palette=<replaceable>palette-file</replaceable></literal></term>
<listitem><para>Specifies where to get the subpicture
palette. Settable per title and per menu. If the filename ends in .rgb
(case insensitive) then it is assumed to be RGB, otherwise it is
YUV. Entries should be 6 hexadecimal
digits. <replaceable>FILE</replaceable> defaults to
xste-palette.dat</para></listitem>
</varlistentry>

<varlistentry><term><literal>-c <replaceable>chapterpts</replaceable></literal></term><term><literal>--chapters=<replaceable>chapterpts</replaceable></literal></term>
<listitem><para>Specifies a comma (,) separated list of chapter
markers. Each marker is of the form [[h:]mm:]ss[.frac] and is relative
to the SCR of the next file listed (independent of any timestamp
transposing that occurs within dvdauthor). The chapter markers ONLY
apply to the next file listed. Defaults to 0.</para></listitem>
</varlistentry>

<varlistentry><term><literal>-f <replaceable>mpeg-file</replaceable></literal></term><term><literal>--file=<replaceable>mpeg-file</replaceable></literal></term><term><literal><replaceable>mpeg-file</replaceable></literal></term>
<listitem><para>Specifies either a file, a pipe, or a shell command
ending in | which supplies an MPEG-2 system stream with VOB sectors
inserted in the appropriate places (using mplex -f 8 to
generate)</para></listitem>
</varlistentry>

<varlistentry><term><literal>-b <replaceable>buttondef</replaceable></literal></term><term><literal>--button=<replaceable>X1xY1-X2xY2,commandlist</replaceable></literal></term>
<listitem><para>creates a button of the specified size. See
LANGUAGE DESCRIPTION for a description of <replaceable>commandlist</replaceable>.</para></listitem>
</varlistentry>

<varlistentry><term><literal>-i <replaceable>[pre|post]=commandlist</replaceable></literal></term><term><literal>--instructions=<replaceable>[pre|post]=commandlist</replaceable></literal></term>
<listitem><para>Executes the <replaceable>commandlist</replaceable>
instructions either before or at the end of the menu/title.  See
LANGUAGE DESCRIPTION for the format of <replaceable>commandlist.</replaceable></para></listitem>
</varlistentry>


</variablelist>

</refsect1>

<refsect1><title>XML Description</title>
<para>
Here is the basic structure of the control file:
</para>
<synopsis>
&lt;dvdauthor [dest="<replaceable>output-dir</replaceable>"] [jumppad="1|on|yes" | allgprm="1|on|yes"] [format="ntsc|pal"] [provider="<replaceable>provider</replaceable>"]&gt;
   &lt;vmgm&gt;
      [&lt;fpc&gt;<replaceable>commands;</replaceable>&lt;/fpc&gt;]
      &lt;menus [lang="<replaceable>language-code</replaceable>"]&gt;
         &lt;video [format="ntsc|pal"] [aspect="4:3|16:9"]
                [resolution="<replaceable>XxY</replaceable>"] [caption="field1|field2"]
                [widescreen="nopanscan|noletterbox|crop"] /&gt;
         &lt;audio [format="mp2|ac3|dts|pcm"] [channels="<replaceable>numchannels</replaceable>"]
                [quant="16bps|20bps|24bps|drc"] [dolby="surround"]
                [samplerate="48khz|96khz"] [lang="<replaceable>language</replaceable>"]
                [content="normal|impaired|comments1|comments2"] /&gt;
         [&lt;audio ... /&gt;]
         &lt;subpicture [lang="<replaceable>language-code</replaceable>"]&gt;
            &lt;stream mode="normal|widescreen|letterbox|panscan"
                [content="normal|large|children|normal_cc|large_cc|children_cc|forced|director|large_director|children_director"]
                id="<replaceable>streamid</replaceable>" /&gt;
            [&lt;stream ... /&gt;]
         &lt;/subpicture&gt;
         [&lt;subpicture ... /&gt;]
         &lt;pgc [entry="title"] [palette="<replaceable>yuvfile|rgbfile</replaceable>"]
              [pause="<replaceable>seconds</replaceable>|inf"]&gt;
            &lt;subpicture&gt;
               [&lt;stream ... /&gt;]
            &lt;/subpicture&gt;
            &lt;pre&gt; <replaceable>commands;</replaceable> &lt;/pre&gt;
            &lt;vob file="<replaceable>file.mpg</replaceable>" [chapters="<replaceable>chapter-list</replaceable>"]
                 [pause="<replaceable>seconds</replaceable>|inf"]&gt;
                 &lt;cell [start="<replaceable>timestamp</replaceable>"] [end="<replaceable>timestamp</replaceable>"]
                    [chapter="1|on|yes" | program="1|on|yes"] [pause="<replaceable>seconds</replaceable>|inf"]&gt;
                    <replaceable>commands;</replaceable>
                 &lt;/cell&gt;
            &lt;/vob&gt;
            [&lt;vob ... /&gt;]
            &lt;button [name="<replaceable>buttonname</replaceable>"]&gt; <replaceable>commands;</replaceable> &lt;/button&gt;
            [&lt;button ... /&gt;]
            &lt;post&gt; <replaceable>commands;</replaceable> &lt;/post&gt;
         &lt;/pgc&gt;
         [&lt;pgc ... /&gt;]
      &lt;/menus&gt;
      [&lt;menus ... /&gt;]
   &lt;/vmgm&gt;
   &lt;titleset&gt;
      &lt;menus [lang="<replaceable>language-code</replaceable>"]&gt;
         [&lt;video ... /&gt;]
         [&lt;audio ... /&gt;]
         &lt;pgc [entry="<replaceable>entries</replaceable>"]
              [palette="<replaceable>yuvfile|rgbfile</replaceable>"] [pause="<replaceable>seconds</replaceable>|inf"]&gt;
            [...]
         &lt;/pgc&gt;
         [&lt;pgc ... /&gt;]
      &lt;/menus&gt;
      [&lt;menus ... /&gt;]
      &lt;titles&gt;
         [&lt;video ... /&gt;]
         [&lt;audio ... /&gt;]
         &lt;pgc [entry="notitle"] [palette="<replaceable>yuvfile|rgbfile</replaceable>"] [pause="<replaceable>seconds</replaceable>|inf"]&gt;
            [...]
         &lt;/pgc&gt;
         [&lt;pgc ... /&gt;]
      &lt;/titles&gt;
   &lt;/titleset&gt;
   [&lt;titleset ... /&gt;]
&lt;/dvdauthor&gt;
</synopsis>

<para>
A breakdown of the control file:
</para>

<variablelist>

<varlistentry><term><literal>&lt;dvdauthor [dest="<replaceable>output-dir</replaceable>"] [jumppad="1|on|yes" | allgprm="1|on|yes"] [format="ntsc|pal"] [provider="<replaceable>provider</replaceable>"]&gt;</literal></term>
<listitem><para>
Initiates dvdauthor.  <literal>dest</literal> denotes the directory where <command>dvdauthor</command> will write the files. This is overridden by the <literal>-o</literal> option. Contains up to one <literal>&lt;vmgm&gt;</literal> tag and any number of <literal>&lt;titleset&gt;</literal>'s.
</para></listitem></varlistentry>

<varlistentry><term><literal>&lt;vmgm&gt;</literal></term><term><literal>&lt;titleset&gt;</literal></term>
<listitem><para>Constructs of a VMGM level menu set or a title set.
Contains zero or more <literal>&lt;menus&gt;</literal> tags and if a
titleset, up to one <literal>&lt;titles&gt;</literal> tag.
</para></listitem></varlistentry>

<varlistentry><term><literal>&lt;menus
[lang="<replaceable>language-code</replaceable>"]&gt;</literal></term>
<listitem><para>Marks a list of menus with a common language for this VMGM menu
set or titleset, called in <command>dvdauthor</command> terminology a
"pgcgroup."  Contains up to one <literal>&lt;video&gt;</literal> tag,
up to one <literal>&lt;audio&gt;</literal> tag, up to one
<literal>&lt;subpicture&gt;</literal> tag, and any number of
<literal>&lt;pgc&gt;</literal> tags.
</para></listitem></varlistentry>

<varlistentry><term><literal>&lt;titles&gt;</literal></term>
<listitem><para>Marks the list of titles for this  titleset, called in
<command>dvdauthor</command> terminology a "pgcgroup."  Contains up to
one <literal>&lt;video&gt;</literal> tag, up to eight
<literal>&lt;audio&gt;</literal> tags, up to 32
<literal>&lt;subpicture&gt;</literal> tags, and any number of
<literal>&lt;pgc&gt;</literal> tags.
</para></listitem></varlistentry>

<varlistentry><term><literal>&lt;video [format="ntsc|pal"]
[aspect="4:3|16:9"] [resolution="<replaceable>XxY</replaceable>"]
[caption="field1|field2"] [widescreen="nopanscan|noletterbox|crop"]
/&gt;</literal></term> <listitem><para> Manually configures the video
parameters for this pgcgroup.  If any of these are not set, then they
will be inferred from the source stream.  Note that the DVD format
only specifically supports 720x480, 704x480, 352x480, and 352x240
resolutions for NTSC, and 720x576, 704x576, 352x576, and 352x288
resolutions for PAL, but DVD author will accept a wider range of
inputs and round up to the nearest size.
</para></listitem></varlistentry>

<varlistentry><term><literal>&lt;audio [format="mp2|ac3|dts|pcm"]
[channels="<replaceable>numchannels</replaceable>"]
[dolby="surround"] [quant="16bps|20bps|24bps|drc"] [samplerate="48khz|96khz"]
[lang="<replaceable>language</replaceable>"]
[content="normal|impaired|comments1|comments2"] /&gt;</literal></term>
<listitem><para>Manually configures an audio stream for this
pgcgroup.  List once for each stream.  Most parameters are inferred
automatically from the source VOBs except for PCM parameters.
However, language and content must be manually specified.  Note that it is
possible to just list the language and content attributes and let
<command>dvdauthor</command> fill in the rest.
</para></listitem></varlistentry>

<varlistentry><term><literal>&lt;subpicture
[lang="<replaceable>language</replaceable>"]
[content="normal|large|children|normal_cc|large_cc|children_cc|forced|director|large_director|children_director"] /&gt;</literal></term>
<listitem><para>Manually configures a subpicture/subtitle for this pgcgroup or PGC.
At the pgcgroup level, list once for each language. Occurrences at the PGC level
don't have <literal>lang</literal> or <literal>content</literal> attributes; they inherit those
from the corresponding <literal>&lt;subpicture&gt;</literal> tag at the pgcgroup level.
</para></listitem></varlistentry>

<varlistentry><term><literal>&lt;stream mode="normal|widescreen|letterbox|panscan"
id="<replaceable>streamid</replaceable>" /&gt;</literal></term>
<listitem><para>Specifies the ID of a stream that is the representation of this
subpicture in a particular display mode. This can be specified per-PGC, or
pgcgroup-wide.</para></listitem></varlistentry>

<varlistentry><term><literal>&lt;pgc
[entry="<replaceable>entries</replaceable>"]
[palette="<replaceable>yuvfile|rgbfile</replaceable>"]
[pause="<replaceable>seconds</replaceable>|inf"]&gt;</literal></term>
<listitem><para>A PGC is just a fancy term for either a menu or a
title.  It has a special meaning in the DVD spec so I have retained
its use here.  PGC's can have commands that get executed before they
start playing or after they finish; see <literal>&lt;pre&gt;</literal> and
<literal>&lt;post&gt;</literal> tags below.</para>

<para>If the PGC is a menu, you can specify one or more entries for
it.  This means that if you press the corresponding button on your DVD
remote, then it will go to this menu.  For a VMGM level menu, the only
choice is <literal>title</literal>, which on my remote corresponds to
the <literal>top menu</literal> button.  For a titleset level menu,
you can use root, subtitle, audio, angle, and ptt.  If you want more
than one, separate them by a space or a comma.  Note that
<literal>root</literal> entry is meant for commands that jump from a
VMGM level menu to a titleset menu.</para>

<para>If the PGC is in a titleset, then it is assumed to be a title unless
<literal>entry="notitle"</literal> is specified.</para>

<para>All button and menu masks and all subtitles within a PGC must
share the same 16 color palette.  If you use <command>spumux</command>
to generate the subtitle/subpicture packets, then the color
information will be automatically passed to
<command>dvdauthor</command>; however, if you use another subtitler or
want to have more control over the palette, you can manually specify
it with the <literal>palette</literal> attribute.  The first 16
entries of the file should be the 16 colors of the palette, listed as
6 digit hexadecimal numbers representing either the RGB breakdown (if
the filename ends in <literal>.rgb</literal> or the YUV breakdown (if
the filename does not end in <literal>.rgb</literal>.  After that, the
button group information can be listed as pairs of 8 digit hexadecimal
numbers; up to three button groups may be specified.</para>

<para>If you have a short video sequence or just want the video to
pause at the end, you can use the <literal>pause</literal> attribute
to set the number of seconds (as an integer) from 1 to 254.  If you
want the video to pause indefinitely, use
<literal>inf</literal>.</para>

</listitem></varlistentry>

<varlistentry><term><literal>&lt;pre&gt; <replaceable>commands;</replaceable> &lt;/pre&gt;</literal></term>
<term><literal>&lt;post&gt; <replaceable>commands;</replaceable> &lt;/post&gt;</literal></term>
<listitem><para> Sets the commands to execute before or after a PGC
plays.  It can be used to loop the current video (by having a
<literal>&lt;post&gt; jump ... &lt;/post&gt</literal> sequence), or to
conditionally skip certain chapters if a flag has been set.
</para></listitem></varlistentry>

<varlistentry><term><literal>&lt;fpc&gt; <replaceable>commands;</replaceable> &lt;/fpc&gt;</literal></term>
<listitem><para> Sets the commands to execute when the disk is first
put in the player (FPC = First Program Chain).  It can be used to jump
to a particular menu or initialize registers on startup.  If not
specified, an implicit one will be created that jumps to the first
menu found, or if there is no menu it will jump to the first title..
</para></listitem></varlistentry>

<varlistentry><term><literal>&lt;vob file="<replaceable>file.mpg</replaceable>" [chapters="<replaceable>chapter-list</replaceable>"] [pause="<replaceable>seconds</replaceable>|inf"] /&gt;</literal></term>
<listitem><para>
Specifies an input video file for a menu or title, with optional chapter points and pause at the end.
</para></listitem></varlistentry>

<varlistentry><term><literal>&lt;cell [start="<replaceable>timestamp</replaceable>"] [end="<replaceable>timestamp</replaceable>"] [chapter="1|on|yes" | program="1|on|yes"] [pause="<replaceable>seconds</replaceable>|inf"]&gt; <replaceable>commands;</replaceable> &lt;/cell&gt;</literal></term>
<listitem><para>
A more detailed way of specifying marker points in a title. If present, then the containing
<literal>&lt;vob&gt;</literal> must not have a <literal>chapters</literal> attribute.
A cell can have a VM command attached to it, to be executed when it plays. If the
<literal>program</literal> attribute is set, then this cell will be a point that
the user can skip to using the prev/next buttons on their DVD player remote. If the
<literal>chapter</literal> attribute is set (implies <literal>program</literal> is set
as well), then this cell is also a chapter point.
</para></listitem></varlistentry>

<varlistentry><term><literal>&lt;button [name="<replaceable>buttonname</replaceable>"]&gt; <replaceable>commands;</replaceable> &lt;/button&gt;</literal></term>
<listitem><para>
Specifies the commands to be executed when the user selects the button with the specified name.
You define button names and placements with <command>spumux</command>.
</para></listitem></varlistentry>

</variablelist>

</refsect1>

<refsect1><title>Language Description</title>
<para>
The language is quite simple and roughly looks like C.
</para>
<itemizedlist>
<listitem><para>Statements are terminated with a semicolon.</para></listitem>
<listitem><para>Statements can span multiple lines.</para></listitem>
<listitem><para>Multiple statements can appear on one line.</para></listitem>
<listitem><para>Whitespace (space, tab, newlines) are not important, except to separate keywords and identifiers.</para></listitem>
<listitem><para>C-style /* ... */ comments are allowed. Or you can use XML comments
&lt;!-- like this --&gt;</para></listitem>
</itemizedlist>

<refsect2><title>Variables</title>

<para>The DVD virtual machine processes 16 bit values.  It supports up
to 16 general purpose registers; however <command>dvdauthor</command>
reserves 3 for internal use.  Thus register 0-12 are available for
use and are referred to as <literal>g0</literal> through
<literal>g12</literal>.</para>

<para>There are also 24 system registers, which can be referred to as
<literal>s0</literal> through <literal>s23</literal>.  Not all of
these can be set.  Many of these have mnemonic synonyms.</para>

<glosslist>

<glossentry><glossterm><literal>audio</literal>
(<literal>s1</literal>, rw)</glossterm><glossdef><para>Denotes the
audio stream, ranging from 0-7.</para></glossdef></glossentry>

<glossentry><glossterm><literal>subtitle</literal>
(<literal>s2</literal>, rw)</glossterm><glossdef><para>The subtitle
track, ranging from 0-31.  If you want the subtitle to always be
displayed, then you should add 64 (i.e. choose 64-95).  Simply
selecting the track (0-31) means that only the forced subtitles will
be displayed, whereas enabling the track (64-95) means that all the
subtitles will be displayed.  This allows you to have forced subtitles
only for the parts of the movie where the actors are speaking a
foreign (to the viewer) language, but still have normal subtitles for
the hearing impaired.  The hearing impaired viewers would enable the
track (64-95) while the other viewers would just select the track
(0-31) they would be able to share the
track.</para></glossdef></glossentry>

<glossentry><glossterm><literal>angle</literal>
(<literal>s3</literal>, rw)</glossterm><glossdef><para>Selects the
angle (currently untested).</para></glossdef></glossentry>

<glossentry><glossterm><literal>button</literal>
(<literal>s8</literal>, rw)</glossterm><glossdef><para>Denotes the
currently highlighted button.  Note that the value is multiplied by
1024, so the first button is 1024, the second is 2048,
etc.</para></glossdef></glossentry>

</glosslist>

</refsect2>

<refsect2><title>Expressions</title>

<para>Expressions follow typical C syntax except that booleans are not
convertible to integers and vice versa.  Operators and comparisons
are:</para>

<para>
<simplelist type="inline" columns="6">
<member><literal>==</literal></>
<member><literal>!=</literal></>
<member><literal>&gt;=</literal></>
<member><literal>&gt;</literal></>
<member><literal>&lt;=</literal></>
<member><literal>&lt;</literal></>
<member><literal>&amp;&amp;</literal></>
<member><literal>||</literal></>
<member><literal>!</literal></>
<member><literal>eq</literal></>
<member><literal>ne</literal></>
<member><literal>ge</literal></>
<member><literal>gt</literal></>
<member><literal>le</literal></>
<member><literal>lt</literal></>
<member><literal>and</literal></>
<member><literal>or</literal></>
<member><literal>xor</literal></>
<member><literal>not</literal></>
<member><literal>+</literal></>
<member><literal>-</literal></>
<member><literal>*</literal></>
<member><literal>/</literal></>
<member><literal>%</literal></>
<member><literal>&</literal></>
<member><literal>|</literal></>
<member><literal>^</literal></>
</simplelist>
</para>

<para>Since the code is encapsulated in XML, the parser will catch any
unescaped &lt; characters (i.e. not written as "&amp;lt;"), thus alphabetic mnemonics have been
provided for all comparison operators for consistency. Or you can put the code
in a &lt;![CDATA[ ... ]]&gt; section.</para>

<para>There is also a numerical function:</para>

<variablelist>

<varlistentry><term><literal>random(<replaceable>EXPRESSION</replaceable>)</literal></term>
<listitem><para>Computes a pseudo-random number, between 1 and the
supplied number, inclusively.</para> </listitem></varlistentry>

</variablelist>

</refsect2>

<refsect2><title>Blocks</title>

<para>Blocks are either a single statement (terminated by a
semicolon), or a group of statements wrapped in curly braces.  For
example:</para>

<itemizedlist>

<listitem><synopsis>g3 = s7;</synopsis></listitem>
<listitem><synopsis>{
  audio = 1;
  subtitle = 65;
  jump vmgm menu 3;
}</synopsis></listitem>

</itemizedlist>

</refsect2>

<refsect2><title>Statements</title>

<para>The statements supported are fairly simple at the moment.</para>

<variablelist>

<varlistentry>
<term><literal><replaceable>VARIABLE</replaceable> = <replaceable>EXPRESSION</replaceable>;</literal></term>
<listitem><para>Sets a variable equal to the result of an equation.</para></listitem></varlistentry>

<varlistentry>
<term><literal>if (<replaceable>EXPRESSION</replaceable>) <replaceable>BLOCK;</replaceable></literal></term>
<term><literal>if (<replaceable>EXPRESSION</replaceable>) <replaceable>BLOCK;</replaceable> else <replaceable>BLOCK;</replaceable></literal></term>

<listitem><para>Calculates the expression; if true, then it executes
the block of code.</para></listitem></varlistentry>

<varlistentry><term><literal>jump <replaceable>TARGET</replaceable>;</literal></term>
<term><literal>call <replaceable>TARGET</replaceable> [resume <replaceable>CELL</replaceable>];</literal></term>
<term><literal>resume;</literal></term>

<listitem><para>Jumps to a particular title or menu, or calls a
particular menu, or returns to the calling title.  You can only
execute a call from a title to a menu; all other forms are illegal.
The purpose of using <literal>call</literal> instead of
<literal>jump</literal> (besides the fact that they support a mutually
exclusive list of targets) is to allow the menu to return to the point
in the title where the call originated using
<literal>resume</literal>.  You can manually specify the return cell
by using the <literal>resume</literal> keyword, however if you do not
specify one and you use the command in a post instruction block, then
it will presume cell 1.</para>
</listitem></varlistentry>

</variablelist>

</refsect2>

<refsect2><title>Targets</title>

<para>The following are possible targets (note that menus do not have
chapters):</para>
<variablelist>

<varlistentry>
<term><literal>[vmgm | titleset <replaceable>X</replaceable>] menu</literal></term>
<term><literal>[vmgm | titleset <replaceable>X</replaceable>] menu <replaceable>Y</replaceable></literal></term>
<term><literal>[vmgm | titleset <replaceable>X</replaceable>] menu entry <replaceable>Z</replaceable></literal></term>
<listitem><para>Targets either the default menu, a menu number Y, or the menu denoted as the entry for Z.  The menu is in either the VMGM or titleset domain.  If you wish to target a menu in the current domain then you can omit the domain moniker.</para></listitem></varlistentry>

<varlistentry>
<term><literal>[titleset <replaceable>X</replaceable>] title <replaceable>Y</replaceable> [chapter <replaceable>Z</replaceable>]</literal></term>
<listitem><para>Targets a title, or a chapter in a title.  Numbering
starts at 1.  All of the titles on the disc are accessible in the VMGM
domain, or you can access them by titleset
instead.</para></listitem></varlistentry>

<varlistentry>
<term><literal>pgc <replaceable>Z</replaceable></literal></term>
<listitem><para>Targets a PGC in the current VMGM or titleset.</para></listitem></varlistentry>

<varlistentry>
<term><literal>chapter <replaceable>Z</replaceable></literal></term>

<listitem><para>Targets a chapter in the current title.</para></listitem></varlistentry>

<varlistentry>
<term><literal>program <replaceable>Z</replaceable></literal></term>
<term><literal>cell <replaceable>Z</replaceable></literal></term>

<listitem><para>Targets a program or cell in the current PGC.  You can use
this to create looping menus: <literal>jump cell
1;</literal></para></listitem></varlistentry>

<varlistentry>
<term><literal>cell top</literal></term>
<term><literal>next cell</literal></term>
<term><literal>prev cell</literal></term>
<term><literal>program top</literal></term>
<term><literal>next program</literal></term>
<term><literal>prev program</literal></term>
<term><literal>pgc top</literal></term>
<term><literal>next pgc</literal></term>
<term><literal>prev pgc</literal></term>
<term><literal>up pgc</literal></term>
<term><literal>pgc tail</literal></term>
<listitem><para>
(Jump only) performs relative transfers of control within the current menu/title.
"<literal>cell/program/pgc top</literal>" goes back to the start of the current cell/program/PGC;
"<literal>next/prev cell/program/pgc</literal>" goes to the next or previous cell/program/PGC;
"<literal>up pgc</literal>" goes to the "up" PGC (not currently settable in
<command>dvdauthor</command>); and "<literal>pgc tail</literal>" goes to the
<literal>&lt;post&gt;</literal> sequence in the current PGC.
</para></listitem></varlistentry>

</variablelist>

<para>Chapters are numbered from 1 in each title, while programs are numbered from
1 in each PGC. Thus, the latter can reset independently of the former when there is more
than one PGC in a title.</para>

</refsect2>

</refsect1>

<refsect1><title>Limitations</title>
<para>The following limits are imposed by the DVD-Video spec.</para>
<para>There can be no more than 99 titlesets, no more than 99 menus in the VMG
or a titleset, and no more than 99 titles in a titleset.</para>
<para>Each title may be made up of up to 999 PGCs. Each PGC may consist of up to 255 programs.
The <literal>&lt;pre&gt;</literal> and <literal>&lt;post&gt;</literal> sections of a PGC
put together can contain no more than 128 VM instructions.</para>
<para>Since there is only one VOB file (<literal>VIDEO_TS.VOB</literal>) in the VMG,
the total amount of video in the VMG menus must fit into 1073709056 bytes (524272
sectors of 2kiB each). In each titleset, all the menu video must fit in the first VOB
(<literal>VTS_</literal>nn<literal>_0.VOB</literal>), so is limited to the same amount.</para>

</refsect1>

</refentry>