dvdauthor is a command line-based DVD authoring program. There are many DVD authoring programs with a graphical interface, but if you, like me, prefer the simplicity and predictability of the command line -- or need to author lots of DVDs and would benefit from being able to use automated scripts -- dvdauthor is the right tool for you.
dvdauthor is not a complete DVD authoring solution. It performs one specific operation: take a set of audio and video track files and build with them a directory tree compliant with the DVD specification (from now on we'll call this "the DVD tree"). This is only one step in the procedure of going from the camera to the finished DVD. The other steps must be performed by other programs.
The procedure could be summarized as follows:
Step 3 is what dvdauthor does and is the main subject of this HOWTO. But before entering that, I'll also say a few words on the other steps. Since dvdauthor is a command line tool, I'm describing command line tools for those too, but there are also graphical equivalents if you prefer to use them.
I haven't much to say on this -- if you're filming a live action scene, any modern video recording equipment will save the recorded footage to digital audio and video files ready for the next step (the audio may be included into the video files or saved as separate files). If you're making an animation, there are many different methods and tools that you could use, but that is beyond the scope of this HOWTO (and well beyond my expertise). In any case, you'll still have to convert your animation into audio and video files.
The most popular command line video editor is ffmpeg. That's a powerful program that should be good for most purposes.
I don't mean (and don't know enough) to write also a tutorial on ffmpeg. I'm just writing down the commands that I used to set up the video tracks that I needed to build my DVDs. Those may or may not be enough for your needs as well.
In typical usage of ffmpeg, you'll specify one or more input files, one output file, and any number of command line options by which you tell ffmpeg what kind of processing to do. Every input file must be preceded by a -i switch. The encoding of each input and output file will generally be inferred from the file's extension. For example:
ffmpeg -i input.mp4 output.mpg
This will read an MPEG-4 video file and convert it to MPEG-2.
To cut a section of a video, run this:
ffmpeg -ss 0:02:00 -i video.mp4 -t 0:03:00 -c copy track.mp4
The -ss 0:02:00 argument tells ffmpeg to skip 2 minutes of video, while the -t 0:03:00 tells it to cut a 3-minutes long section. That is, the track that you're cutting starts at 2 minutes and ends at 5 minutes since the beginning of the input video. The -c copy tells ffmpeg to not recode the video (which it does by default) but simply copy from the original.
To recode a video into the format required by DVD, run this:
ffmpeg -i video.mp4 -target pal-dvd -aspect 16:9 video.mpg
If you live in a country where NTSC is the TV standard, replace pal-dvd with ntsc-dvd. That's most of America and a few Asian and Oceanian countries; the rest of the world uses PAL.
The -aspect argument sets the aspect ratio, that is, the ratio between width and height of the video frame. DVD videos can have either 4:3 or 16:9 aspect ratio. If that doesn't match the dimensions of the screen on which the DVD is played, either black strips will be displayed or the video will be cropped. Most recent screens have 16:9 aspect ratio, so I suggest to use that.
To force a lower bitrate than the default, so that you can fit a longer video in the size of a DVD (at the price of some degradation in the image quality), add the -b option:
ffmpeg -i video.mp4 -target pal-dvd -aspect 16:9 -b 4M video.mpg
4M means 4 Mb/s (Megabits per second). You may also specify that as 4000k or 4000000 (it goes by multiples of 1000, not 1024). According to my tests the default bitrate is 6 Mb/s. That's the nominal bitrate; the actual rate can be somewhat different.
You can of course combine different options, for example this will cut a section and recode into DVD format at the same time:
ffmpeg -ss 0:02:00 -i video.mp4 -target pal-dvd -aspect 16:9 -t 0:03:00 video.mpg
If you're running your video through multiple editing steps, I recommend to keep the original resolution during all the intermediate steps and only do the -target pal-dvd in the final step. This will minimize data loss.
To build a video from a sequence of images (each image will be a frame), run this:
ffmpeg -i image%03d.png -target pal-dvd -aspect 16:9 video.mpg
The argument -i image%03d.png tells ffmpeg to look for a sequence of images called image001.png, image002.png, image003.png, and so on. The %03d substring means that the numeric part of the filename is a 3-digit number padded with zeros. If the files were called image01.png, image02.png, image03.png, etc., the substring would be %02d. (If you are familiar with the C language, you'll recognize the printf-style syntax.)
Having used -target pal-dvd, the generated video has 25 frames per second (with -target ntsc-dvd they would be 29.97). You should take that into account when creating the sequence.
If you want the video to have an associated audio, you can add an input audio file on the command line:
ffmpeg -i image%03d.png -i audio.mp3 -target pal-dvd -aspect 16:9 video.mpg
If you don't, the video will be silent.
You ought to know that DVDs have non-square pixels: the video resolution of PAL (720x576 pixels) and NTSC (720x480) match neither the 4:3 nor the 16:9 aspect ratio (they are, respectively, 5:4 and 3:2). So the images that you see when watching the DVD will be stretched or shrinked with respect to what you see when looking at the original image files on the computer screen. In order to handle that correctly and avoid unwanted distortions, I suggest to create the images with the final aspect ratio with which the DVD will be played (as written above, I recommend 16:9). ffmpeg will rescale them automatically.
To build a static video from a single image, run this:
ffmpeg -loop 1 -i image.png -target pal-dvd -aspect 16:9 -t 0:10 video.mpg
The -t 0:10 tells ffmpeg to create a 10-seconds video. With a fixed image as input, it is necessary to specify the duration, otherwise ffmpeg couldn't know when to stop. As above, you may add an input audio file. A typical application for a static video would be the DVD menu (although you may want to display an animated scene there as well).
To overlay an image over a video, run this:
ffmpeg -i video.mpg -i image.png -filter_complex "[0:v][1:v] overlay" -target pal-dvd video+image.mpg
The image must have a transparent background or else it will hide all the video. ffmpeg accepts all the most common image encoding formats, but as you need transparency, you must use a format that supports it. Most notably, that excludes JPEG.
To overlay the image only for the first 5 seconds, run this:
ffmpeg -i video.mpg -i image.png -filter_complex "[0:v][1:v] overlay=0:0:enable='between(t,0,5)'" -target pal-dvd video+image.mpg
You may use that for displaying a title at the start of a track. Of course if you want to display it for more or less than 5 seconds you can change the number. The 0:0 tells ffmpeg where to position the image (if you specify numbers different from 0, the image will be offset). It is apparently required for ffmpeg to read correctly the enable part.
An ISO image file is the preferred format for data to be written on a CD or DVD disc. It's an archive that may contain any number of files and directories. In the case of a Video DVD, the contents must be a valid DVD tree, such as those created by dvdauthor.
The command line tool for building ISO images is genisoimage. There is still around some older documentation that mentions mkisofs; that was the predecessor of genisoimage. The latter is what you'll find in any recent GNU/Linux distribution.
The command line to build a DVD Video ISO image is this:
genisoimage -v -dvd-video -V "example01" -o example01.iso example01
The -v argument means "verbose". It tells genisoimage to display progress information while creating the ISO image. If you don't want that, you can omit it. The -dvd-video argument tells genisoimage to make sure that the generated ISO image is compliant with the DVD Video specification, otherwise your DVD player might not be able to read it. The -V "example01" sets the volume label of the image. This is a string where you can put a label that identifies the image contents. It can be up to 32 characters long. The quotes are required if it contains spaces or special characters, otherwise they may be omitted. The -o switch lets you specify the name of the image file. The last argument is the name of the directory whose contents will be copied into the image.
The command line tool for burning CDs and DVDs is wodim (Write Optical DIsk Media). It is also the successor of an older program. I think it was called cdrecord, but it's been a few years so I am not sure I remember correctly.
The command line for writing a disc is this:
wodim -v dev=/dev/sr0 image.iso
The -v switch means "verbose". It tells wodim to display progress information while burning the disc. If you don't want that, you can omit it. The dev=/dev/sr0 argument tells wodim the device name of the DVD burner. /dev/sr0 is how it's called on my computer. On yours it may be different. If you don't know what it is and want to find out, insert a (non-blank) DVD into the drive and mount it, then run df and look for it in the output: the Filesystem column is where you'll find the device name. The last argument is the name of the ISO image to be written on the disc.
If you want to burn the image on a rewritable disc (which is a good way to test your DVDs without throwing away a disc every time you get anything wrong), if it already contains data you must blank it first. To do that, run this:
wodim -v dev=/dev/sr0 blank=fast
I must say that on my computer, this works for CDs, but for DVDs it writes an error message and refuses to blank the disc. I couldn't find what the problem is. It may or may not work for you.
dvdauthor should be available in any of the most common GNU/Linux distributions, thus it can be installed using the standard tools (aptitude on Debian and Ubuntu, yum on Fedora, etc.). In fact, it may even be already installed on your computer. It was on mine. I run Debian GNU/Linux with the Gnome desktop, and dvdauthor was pulled in as a dependency of brasero (Gnome CD/DVD burner).
When I tried running dvdauthor, at first I couldn't make it work. It kept writing this message and then failing at some stage, leaving an incomplete DVD tree:
INFO: no default video format, must explicitly specify NTSC or PAL
(As I've already written above, NTSC is the TV standard in most of America and a few Asian and Oceanian countries; the rest of the world uses PAL.)
I finally got rid of that by creating a configuration file that tells dvdauthor what my default video format is. This is how I did it:
echo PAL > $HOME/.config/video_format
Later, I discovered that another way is to set the VIDEO_FORMAT environment variable. If you're running bash as your command line shell, you can add this line to your $HOME/.bashrc file (otherwise, use the equivalent syntax and configuration file for your shell of choice):
export VIDEO_FORMAT=PAL
Do what you prefer.
And now let's see how to actually use dvdauthor:
You can tell it what to do either via command line arguments, or via a control file in XML format. The latter way is more flexible and configurable, or at least I didn't discover how to do the same things with the former. Anyway, I'll present a few examples of both.
I'll start with a minimal example, then gradually add more features.
All the files needed to try these examples on your computer can be downloaded from the Files section of this document.
The simplest DVD that you can build contains just one video track and no menu. When you insert the disc into the DVD reader, it starts playing the track and stops when it's finished.
You can build it simply by typing these on the command line:
dvdauthor -o example01 -t track01.mpg dvdauthor -o example01 -T
The first line creates the DVD tree and writes the track there. The second creates the DVD's table of contents files.
A DVD tree is a directory that contains two directories called AUDIO_TS and VIDEO_TS. If you're making a video DVD, AUDIO_TS will be empty and VIDEO_TS will contain all the relevant files (tracks etc.). If you're making an audio DVD, it'll be the opposite. (This HOWTO shows how to make video DVDs; I didn't investigate whether dvdauthor can build audio DVDs too.)
The -o example01 tells dvdauthor to write the DVD tree to a directory called example01; of course you can change the name to anything you like. The directory will be created if it doesn't exist. In fact, it is not recommended to run dvdauthor on an existing directory. If it exists as a leftover of a previous attempt, you should delete it using this command:
dvddirdel -o example01
dvddirdel is a utility distributed together with dvdauthor. The directory could also be deleted via the usual rm -rf command, however the dvdauthor documentation recommends using dvddirdel. In order to prevent accidentally deleting the wrong directory, dvddirdel checks for a valid DVD tree structure, and refuses to do anything if it doesn't find it. It also refuses to do anything if you forget the -o switch before the directory name (I got hit by this a few times).
track01.mpg is, of course, the name of the video track file. Again, you can change it to anything you like. The sample file provided with this HOWTO (see the Files section) shows a simple clock ticking for 15 seconds, with a short sound (a "beep") at every move of the hand.
After running the above commands, ls -R example01 should give you this:
example01: AUDIO_TS VIDEO_TS example01/AUDIO_TS: example01/VIDEO_TS: VIDEO_TS.BUP VIDEO_TS.IFO VTS_01_0.BUP VTS_01_0.IFO VTS_01_1.VOB
VTS_01_1.VOB contains the video track. If that is larger than 1 GB, it will be split into multiple files of (slightly less than) 1 GB each. The additional files will be called VTS_01_2.VOB, VTS_01_3.VOB, and so on. Usually there is also a file called VIDEO_TS.VOB containing the video track for the DVD menu. In this example there is no menu, so this file is missing. The other files contain other informations required by the DVD player; the *.BUP files are backup copies of the *.IFO files.
If everything worked as expected, now you can run genisoimage to build the DVD image (see above), burn it to a disc (ditto), and try it on your DVD reader. You may also download and try the prebuilt image example01.iso from the Files section. The files in your DVD tree should be byte-for-byte identical to those contained there.
You can obtain the same result by running dvdauthor with this control file:
<dvdauthor dest="example01"> <vmgm /> <titleset> <titles> <pgc> <vob file="track01.mpg" /> </pgc> </titles> </titleset> </dvdauthor>
The syntax to run dvdauthor with a control file is this:
dvdauthor -x example01.xml
The target directory is specified by the dest attribute in the control file. Alternatively, you can omit the attribute and specify the target directory on the command line via the -o switch. If you specify both, the command line argument takes precedence. Other command line switches (-t, -T etc.) can't be used together with -x.
I assume that you have at least basic knowledge of XML -- what's a tag, what's an attribute, an so on. After all, we're well into the 21st century and XML should now be the format of choice for almost any kind of textual data.
The <vmgm> tag contains the definition of the main menu of the DVD. In this example there is no menu, so the tag is empty; however it must be there. The <titleset> tag contains the definition of the DVD's titleset. A titleset is where a set of tracks and its associated material is stored. In the following we'll see more examples of things that can be put into a titleset. A DVD may also have more than one titleset; we'll see an example of that too.
Normally, DVDs are split into multiple "chapters", that is, track sections. That allows you to skip portions of the video and jump to specific points. In this example, there's still no menu, so you can't actually select a chapter when you insert the disc into the reader, but you can move forward and backward between chapters using the remote control.
dvdauthor will create a DVD with multiple chapters if you specify multiple track files on the command line. Every track file will be a chapter. Simply write the file names one after another on the command line:
dvdauthor -o example02 -t track01.mpg track02.mpg track03.mpg track04.mpg dvdauthor -o example02 -T
In this example there are four chapters, but there can be any number up to 99. You can again download sample track files from the Files section (that holds also for all the following examples, but this is the last time I'm repeating it). The first file is the same used in the previous example. Together those tracks show a simple clock ticking for a full minute; each of them is a 15-seconds section. Some DVD players might pause for a fraction of a second between tracks.
The control file that gives the same result is very similar to that in the previous example. Just add a <vob> tag for each track:
<dvdauthor dest="example02"> <vmgm /> <titleset> <titles> <pgc> <vob file="track01.mpg" /> <vob file="track02.mpg" /> <vob file="track03.mpg" /> <vob file="track04.mpg" /> </pgc> </titles> </titleset> </dvdauthor>
A more flexible way to split a DVD into multiple chapters is to tell dvdauthor explicitly at which time you want each chapter to begin. This can be done with the -c command line switch:
dvdauthor -o example03 -t -c 0,0:10 track01.mpg -c 0:05 track02.mpg -c 0,0:10 track03.mpg -c 0:05 track04.mpg dvdauthor -o example03 -T
Each -c switch is applied to the track file immediately following it. The time is counted from the beginning of the track -- not the beginning of the DVD. If any chapters are set explicitly, dvdauthor will not automatically start a new chapter with every track.
So this DVD has six chapters: the first starts at the beginning of the first track -- this one must always be there and dvdauthor will set it even if you don't specify it. The second chapter starts after 10 seconds. The third starts 5 seconds into the second track, that is, 20 seconds after the beginning of the DVD (this is assuming that you're using again my sample tracks, which are 15-seconds long). And a bit of math will show you that the fourth, fifth and sixth tracks start at 30, 40 and 50 seconds. In other words, this video is split into 10-seconds sections.
In fact, when you play this DVD, you might notice that the chapters don't begin exactly every 10 seconds. That's because of how videos are encoded: for technical reasons it isn't possible to start playing at any time, but only at selected frames called P frames (P stands for "principal"). The beginning of each chapter will be set as close as possible to the specified point.
To do the same with a control file, you can add the chapters attribute to <vob> tags:
<dvdauthor dest="example03"> <vmgm /> <titleset> <titles> <pgc> <vob file="track01.mpg" chapters="0,0:10" /> <vob file="track02.mpg" chapters="0:05" /> <vob file="track03.mpg" chapters="0,0:10" /> <vob file="track04.mpg" chapters="0:05" /> </pgc> </titles> </titleset> </dvdauthor>
Now we'll see how to create DVDs with menus.
From now on, I'll use exclusively control files because I couldn't find how to create menus with command line arguments. The switch for doing that should be -m but I haven't been able to find the correct syntax. If you find it, I'd like to know.
This is the simplest example (except for the dest attribute, which may be omitted as explained in Example 1) of a control file that defines a menu:
<dvdauthor dest="example04"> <vmgm> <menus> <pgc> <vob file="menu1.mpg" /> </pgc> </menus> </vmgm> <titleset> <titles> <pgc> <vob file="track01.mpg" /> </pgc> </titles> </titleset> </dvdauthor>
It is, in fact, too simple. If you create a DVD from this, you'll find that after playing the menu, it just stops. There is no way to get to play the track!
To get past the menu, you must tell dvdauthor what to do when it's finished. This is how you can do that:
<dvdauthor dest="example05"> <vmgm> <menus> <pgc> <vob file="menu1.mpg" /> <post>jump title 1;</post> </pgc> </menus> </vmgm> <titleset> <titles> <pgc> <vob file="track01.mpg" /> <post>call vmgm menu;</post> </pgc> </titles> </titleset> </dvdauthor>
The <post> tag specifies an action to be performed after the tracks in the menu or title have been played. jump title 1; tells dvdauthor that after playing the menu, it must go to the first title of the DVD (a DVD might contain multiple titles; we'll see that later). That is, when the menu is finished the track will start.
The second <post> tag specifies what to do after the track has been played too. call vmgm menu; tells dvdauthor to go back to play the menu. So this DVD will loop between the menu and the track until you stop it.
What's the difference between jump and call? I'm not sure. It seems that jump can't be used at the end of a title, so call must be used there. In all other places jump seems to work.
The menu defined within a <vmgm> tag is the main menu of the DVD. But DVDs can have more than just one menu. Indeed, each titleset may have its own menu too.
To define a titleset menu, just put the <menus> tag into the <titleset> tag:
<dvdauthor dest="example06"> <vmgm /> <titleset> <menus> <pgc> <vob file="menu1.mpg" /> <post>jump title 1;</post> </pgc> </menus> <titles> <pgc> <vob file="track01.mpg" /> <post>call menu;</post> </pgc> </titles> </titleset> </dvdauthor>
In this example there is no main menu (empty <vmgm> tag). Thus the DVD will start playing directly from the titleset menu, and will loop between menu and track like the previous example. Note that the second <post> tag is slightly different here: call menu; (this titleset's menu) instead of call vmgm menu; (the main menu).
What's the difference between main menu and titleset menu? For one, the "menu" button of my DVD player's remote control goes to the titleset menu. If there is only a main menu, pressing the button makes the player display an "invalid entry" message. There seems to be no way to go back to the main menu except via a <post> tag (which means that you must get to the end of the title first). I don't know whether that is true of all players.
Another difference is that some actions can be called in one kind of menu and not in the other. For example, it seems that you can only jump to a specified chapter from the titleset menu -- from the main menu you can only start a title from the beginning. And when an action can be performed from both menus, the syntax may be different.
I didn't find anywhere a complete documentation of what can or cannot be done. If you try doing something that isn't allowed, dvdauthor will exit and print an error message. In the following I'll show some examples that worked for me.
The menus we've seen in the previous examples are in fact no more than short tracks that play before other tracks, but don't let you select any actions. To build a "real" menu, one that actually lets you navigate the DVD, you must define buttons. For that purpose, with dvdauthor comes a tool called spumux.
Like dvdauthor, spumux works with an XML control file, but the command line syntax is different. You must not prepend -o to the file name, and must feed the input and output file through I/O redirection:
spumux control.xml < video.mpg > video-with-buttons.mpg
Each button takes a rectangular area on the screen. When playing the DVD on your computer, you can activate the button by clicking there with the mouse; while on a DVD player, you can move between buttons and press them with the remote control.
To add buttons to a video, you need three images. One shows the default appearance of the buttons, another shows the appearance of the buttons when they're being highlighted, and the third shows their appearance when they're pressed. Of course only one button can be highlighted or pressed at a time, but in those images you must draw them all highlighted or all pressed. When the video will be played and any button will be selected, the corresponding portion of the image will be displayed. The dimensions of the images should match the DVD resolution, that is, 720x576 for PAL or 720x480 for NTSC.
spumux has a feature to autodetect buttons in the image. This is a control file that uses it:
<subpictures> <stream> <spu force="yes" image="menu2i.png" highlight="menu2h.png" select="menu2s.png" autooutline="infer" outlinewidth="6" autoorder="rows"> </spu> </stream> </subpictures>
force="yes" must always be specified because, technically, the buttons are implemented as subtitles. DVD players let you choose whether to display subtitles or not. The force attribute overrides that and tells the player to always display the buttons, otherwise the menu would not function correctly.
The three attributes image, highlight and select specify the names of the three images that define the buttons appearance, as described above (image defines the default appearance).
The other attributes tell spumux to autodetect the buttons. It does so by inspecting the three images and looking for matching rectangular areas surrounded by a transparent outline at least 6 pixels wide (that's specified by the outlinewidth attribute). An outline of suitable width is necessary if the button image is a string of text, otherwise spumux may identify every letter as a distinct button. Finally, the autoorder attribute specifies how to sort the buttons: by rows of by columns. You'll need to know the button ordering when you associate an action to each of them -- we'll see that in the next examples.
The autodetect feature is quite handy but, being a control freak, I prefer to specify the buttons positions explicitly. This is how to do that:
<subpictures> <stream> <spu force="yes" image="menu2i.png" highlight="menu2h.png" select="menu2s.png"> <button x0="0" y0="440" x1="720" y1="504" /> </spu> </stream> </subpictures>
A single button is defined here. The x0, y0, x1 and y1 attributes set the coordinates of the button box. I find it convenient to specify a larger rectangle than the actual button image: this facilitates pointing the mouse at it when playing the DVD on your computer. In particular, this button takes the entire width of the DVD screen (720 pixels). Of course it's up to you to follow that or not.
To define more buttons, use multiple <button> tags:
<subpictures> <stream> <spu force="yes" image="menu3i.png" highlight="menu3h.png" select="menu3s.png"> <button x0="0" y0="258" x1="720" y1="312" /> <button x0="0" y0="312" x1="720" y1="376" /> <button x0="0" y0="376" x1="720" y1="440" /> <button x0="0" y0="440" x1="720" y1="504" /> </spu> </stream> </subpictures>
The latter two control files were used to create the files menu2.mpg and menu3.mpg that are used in the following examples. You can run the corresponding DVDs to see how the result looks like.
There is a severe limitation on the number of colors of the button images: you can use only up to four (transparent background included). I am not sure whether this is dictated by the DVD specification or is a deficiency of spumux.
Anyway, that requires that if your buttons include written text, it must not be rendered with font antialiasing. That is a technique by which pixels on the edges of each letter are blended with the background color in order to make the letter look smoother. Most text fonts are designed to be used with antialiasing. But if you use that, the blended pixels will have different colors (potentially each pixel might have a different blend) and thus you are almost sure to run out of the 4-colors limit. (To be exact, if the background is transparent, what's different is actually the pixel's alpha value, while the RGB values are equal. But that still counts as different colors.)
When you create the button images, you can tell the program you're using (e.g., the GIMP) to use non-antialiased text, but when I tried that, I wasn't satisfied by the result: especially if the menu screen contains other text, the difference is very noticeable and aesthetically unpleasant. (There is also an issue with subtitle scaling with my DVD player that makes it even worse.) So, for my own DVDs and in the examples of this HOWTO, I chose to insert all text into the background image and to use as "button image" a colored box that frames the text. You may prefer a different solution.
Having added one or more buttons to the menu video file with spumux, you can specify the action associated to each button by inserting a <button> tag into the <menus> tag:
<dvdauthor dest="example07"> <vmgm /> <titleset> <menus> <pgc> <vob file="menu2.mpg" /> <button>jump title 1; <post>jump titleset 1 menu; </pgc> </menus> <titles> <pgc> <vob file="track01.mpg" /> <post>call menu; </pgc> </titles> </titleset> </dvdauthor>
In this example a single button is defined (thus it will always be shown as highlighted), and the track will be played when you press it. Note how, different from the previous examples, the <post> action is to jump back to the menu; that is, the menu will be played in a loop until you press the button.
To define multiple buttons, add multiple <button> tags. They are associated to the buttons matching the order in which they were defined by spumux:
<dvdauthor dest="example08"> <vmgm /> <titleset> <menus> <pgc> <vob file="menu3.mpg" /> <button>jump title 1 chapter 1; <button>jump title 1 chapter 2; <button>jump title 1 chapter 3; <button>jump title 1 chapter 4; <post>jump titleset 1 menu; </pgc> </menus> <titles> <pgc> <vob file="track01.mpg" /> <vob file="track02.mpg" /> <vob file="track03.mpg" /> <vob file="track04.mpg" /> <post>jump title 1; </pgc> </titles> </titleset> </dvdauthor>
Note how the second <post> tag does not go back to the menu, like the previous examples did, but restarts the title. That is, the clock will keep ticking until you stop it.
When you play this DVD on your reader, you'll see that when the menu video ends, it is restarted, but the currently active button is reset. For this reason, the menu video should have a sufficient length to give the user enough time to select an entry with ease. For a simple menu like this, I think 30 seconds should be adequate, so this is what I did. Your mileage may vary.
In this example we define two menus, a main menu and a titleset menu. The former lets you either go to the titleset menu or start playing the tracks; the latter lets you choose among individual chapters. This setup matches what many real DVDs provide.
<dvdauthor dest="example09"> <vmgm> <menus> <pgc> <vob file="menu4.mpg" /> <button>jump titleset 1 menu; <button>jump title 1; <post>jump menu 1; </pgc> </menus> </vmgm> <titleset> <menus> <pgc> <vob file="menu3.mpg" /> <button>jump title 1 chapter 1; <button>jump title 1 chapter 2; <button>jump title 1 chapter 3; <button>jump title 1 chapter 4; <post>jump titleset 1 menu; </pgc> </menus> <titles> <pgc> <vob file="track01.mpg" /> <vob file="track02.mpg" /> <vob file="track03.mpg" /> <vob file="track04.mpg" /> <post>call vmgm menu; </pgc> </titles> </titleset> </dvdauthor>
And this is a DVD with two titlesets. The first titleset shows the usual clock; the second shows the clock running backwards.
<dvdauthor dest="example10"> <vmgm> <menus> <pgc entry="title"> <vob file="menu5.mpg" /> <button>jump title 1; <button>jump title 2; <post>jump menu 1; </pgc> </menus> </vmgm> <titleset> <titles> <pgc> <vob file="track01.mpg" /> <vob file="track02.mpg" /> <vob file="track03.mpg" /> <vob file="track04.mpg" /> <post>call vmgm menu; </pgc> </titles> </titleset> <titleset> <titles> <pgc> <vob file="track05.mpg" /> <vob file="track06.mpg" /> <vob file="track07.mpg" /> <vob file="track08.mpg" /> <post>call vmgm menu; </pgc> </titles> </titleset> </dvdauthor>
It's worth noting that, in this case, ls -R example10 will give you this:
example10: AUDIO_TS VIDEO_TS example10/AUDIO_TS: example10/VIDEO_TS: VIDEO_TS.BUP VIDEO_TS.VOB VTS_01_0.IFO VTS_02_0.BUP VTS_02_1.VOB VIDEO_TS.IFO VTS_01_0.BUP VTS_01_1.VOB VTS_02_0.IFO
The VTS_01_* files belong to the first titleset; the VTS_02_* files belong to the second.
That's all -- I think I've told you everything I've learned. From these examples you should be able to build more complex setups. I hope you will find this HOWTO useful.
These are all the files needed to try the examples:
In case you're interested to know how I created the tracks, here are the relevant files:
Note: the menu video files created here (except menu1.mpg) must be ran through spumux in order to obtain the actual menu files (with buttons) used in the examples.
Last modification: 25 Apr 2018
Copyright (C) 2018 Gerardo Ballabio
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".