DVDs can handle audio & video information in the following formats:
DVD MPEG-2 streams can have up to 8 different audio streams, 32 different sub-picture tracks (for subtitles or buttons-over-video, currently not supported by dvdauthor), and up to nine video streams, or 'angles' (currently, dvdauthor does not support angles).
Total bitrate of a DVD MPEG-2 stream must not exceed 9.8Mbps for maximum compatibility.
Most commercial DVDs these days include a DTS soundtrack plus a DD/AC-3 track in case the player doesn't have a DTS decoder.
Why? DVD MPEG-2 streams need some extra navigational information
mplex - multiplexes audio and video into MPEG streams
e.g.
mplex -f 8 -o film_nosubs.mpg film.m2v english.ac3 french.ac3 german.ac3
In this case:
mplex -f 8 -o film_nosubs.mpg film.m2v film.ac3
mplex works with several other different MPEG formats, including VideoCD.
Use ffmpeg to convert between audio formats (AC3 is the most compatible and efficent format, although it is patent-encumbered).
Subtitles in DVDs are implemented via a sub-picture track
Sub-picture tracks are also used for menus, as shown in the Menu section. In fact, sub-picture tracks can also be used to create features like the "White Rabbit" option in The Matrix, but this is not supported by dvdauthor at the time of writing.
subs.xml (using TrueType fonts):
<subpictures> <stream> <textsub filename= "filename" [ fontsize="size" ] [ font="fontname.ttf" ] [ horizontal-alignment="left | right | center | default" ] [ vertical-alignment="top | middle | bottom" ] [ left-margin="" ] [ right-margin="" ] [ top-margin="" ] [ bottom-margin="" ] [ subtitle-fps="frames-per-second" ] [ movie-fps="frames-per-second" ] [ movie-width="" ] [ movie-height="" ] /> </stream> </subpictures>
dvdauthor can handle most of the common subtitle formats (*.srt, *.ssa, *.sub, etc).
Fonts must be in the directory ~/.spumux for spumux to find them.
subs.xml (using PNG images):
<subpictures> <stream> <spu start="start-time" [ end="end-time" ] [ image="picture.png" ] [ transparent="color-code" ] [ force="yes" ] [ xoffset="x-coord" yoffset="y-coord" ] > </spu> </stream> </subpictures>
Example:
<subpictures> <stream> <spu start="00:00:00.00" end="00:00:15.00" image="sub1.png"> </spu> </stream> </subpictures>
Adding subtitles
spumux subs.xml < film_nosubs.mpg > film.mpg
For multiple streams of subtitles, use the -s x switch to insert a subtitle stream (where x runs between 0 and 31 in a title)
It is possible, of course, to create DVDs without any menus in them at all.
Current alpha versions of dvdauthor support 16:9 and anamorphic menus
Create an image with 3 layers:
menu.xml:
<subpictures> <stream> <spu start="00:00:00" end="00:00:00" force="yes" highlight="highlight.png" select="select.png" autooutline="infer" autoorder="rows" /> </stream> </subpictures>
For more complex DVDs, button placement can be specified individually; see dvdauthor documentation for details.
Use jpeg2yuv, mpeg2enc, and mplex to create an MPEG-2 stream from the image:
jpeg2yuv -n 1 -f 25 -I p -j menu.jpg | mpeg2enc -f 8 -o menu_temp.m2v mplex -f 8 -o menu_temp.mpg menu.m2v menu.ac3
Then, add the button masks using spumux:
spumux menu.xml < menu_temp.mpg > menu.mpg
Menus must have an audio track. It can be silence, but it needs to be there.
jpegyuv options: -I (interlace - here using progressive) -f (frame rate) -n 1 (only process one frame - will create a 25-frame sequence (using the -f value)).
<dvdauthor> <vmgm> <menus> <pgc> <vob file="menu.mpg" pause="inf"/> <button>subtitle=0;jump title 1;</button> <button>subtitle=64; jump title 1;</button> </pgc> </menus> </vmgm>
<titleset> <titles> <pgc> <vob file = "film.mpg" chapters="00:00:00, 00:00:15" /> <post>call vmgm menu 1;</post> </pgc> </titles> </titleset> </dvdauthor>
<vmgm> tag
<menus> tag
See dvdauthor documentation for further options, such as language codes, aspect ratios, etc.
<pgc> tag
When used in menus. the tag can also have an entry attribute, corresponding to certain special types of button on the DVD controller (such as 'title, 'angle', etc.). When the button is pressed, the player jumps to the menu with the appropriate entry.
<vob> tag
<button> tag
The subtitle=64 command shown in the dvd.xml file forces the subtitles to be displayed. If subtitle=0 was used, only titles with a force="yes" attribute will be display. To force all subtitles, add 64 when selecting the required stream (e.g. 0+64).
<titleset> and <titles> tags
See dvdauthor documentation for further options, such as language codes, aspect ratios, etc.
<pre> and <post> tags
Creating the DVD:
dvdauthor -o [DIRECTORY] -x dvd.xml
Testing the DVD:
xine dvd:/path_to_output_dir/VIDEO_TS/
Making The ISO Image:
mkisofs -o image_name -dvd-video path_to_output_dir
Then burn using dvdrtools, or any other method
DVD players expect to certain certain files on a DVD in particular places. The -dvd-video option makes sure mkisofs places files in the correct order.
Current alpha builds also have a random() function, very useful for interactive apps.
Operators supported: ==, !=, >=, >, <=, <, &&, ||, !, eq, ne, ge, gt, le, lt, and, or, xor, not, +, -, *, /, %, &, |, ^
Not covered in this lecture, but the <cell> tag is often used in conjunction with registers for seamless branching.