DVD Authoring on Linux

Cut and Toast

Marco Kraus

Authoring video DVDs with Linux was a problem for a long time, but a few useful tools are closing the gap. And Q-DVD-Author gives you a handy front-end for controlling the process.

Finished at last: after weeks of tinkering with your video-editing software, that long-winded video of your last summer holiday has finally become a presentable and enjoyable home movie. But now what? Today's upwardly mobile urban generation will not accept anything less than a DVD, not to mention the menu, chapter selections, and the other goodies found in commercial video DVDs.

Obviously, your normal burning tool isn't going to help you, since it expects special movie and filesystem formats and a complex menu structure rather than a simple home movie. In other words, you need a DVD authoring tool. Box 1 has in-depth information on DVD video formats for those of you interested in more detail.

If you are creating a Video DVD for your own viewing pleasure, you don't have to worry about these details. Popular editing programs such as Kino or MainActor have DVD export features that support these standards. If you have a movie that does not need cutting but does not have the DVD format you require, you might like to use a tool such as Mencoder[1], Ffmpeg[2], or Transcode[3].

Filesystem Structure

Besides the filesystem (typically UDF Bridge), the video DVD standard also specifies the file and path names. Movies are stored in so-called VOB (Video Object) files. The VOB files contain a (multiplexed) mixture of content, such as video, audio, and possibly subtitles. Added to these are a few IFO files that contain control information such as chapter selection, and BUP files, backups of the IFO content. Backups are important because DVDs are a lot more prone to error than normal CDs due to the higher storage density.

The VIDEO_TS.VOB and VIDEO_TS.IFO files tell the DVD player where to start playing. The unofficial "DVD Specification Guide" [4] has more details on the file structure and makeup.

DVDauthor

On Linux, the dvdauthor command line tool allows users to create a complete DVD image with the structure detailed previously from a simple DVD MPEG2 file. DVDauthor[5] is almost always the starting point when you need to create DVD content on Linux. Some other authoring tools are actually mature front-ends for DVDauthor. DVDauthor has a collection of mastering tools, such as ifogen, which generates the IFO files.

Unfortunately, using DVDauthor is not exactly trivial. It needs an XML control file to generate the content. The example in Listing 1 is a simple control file for a movie with just two chapters, no menu, background, direct access, or other features.

A more complex control file with a feature-rich menu and a smattering of typical features can easily weigh in at several kilobytes - who can blame users for not wanting to compose this kind of file manually. If you feel up to the challenge, you can check out the DVDauthor website to read the documentation and the Control File Tutorial [5].

Removing the Headaches with a GUI

The two best-known free front ends are DVDStyler[6] and Q-DVD-Author[7]. Both are relatively young projects and still at the early beta stage. But despite their rough edges, both are usable and give you an enormous advantage in the usability stakes. Unfortunately, both programs are lacking transformation routines for the video stream at present, and this means you need a DVD-compatible MPEG2 file. This said, most cutting programs can export an appropriately formatted file, which would give you a workaround.

DVDStyler is more intuitive and easier to handle than Q-DVD-Author. Unfortunately, DVDStyler does not support scores or chapters at present. If you are looking for a quick and simple point of entry, DVDStyler is the place to start. If you need to master a more complex menu, you are better off with Q-DVD-Author.

Box 1: DVD Video Formats

Time Warner, Toshiba, Sony, and Philips agreed on a common video DVD standard in 1995 to prevent the same kind of format wars that occurred when video recorders were introduced. The standard mandates a fixed structure, but it does allow a few combinations of sound and video formats.

DVD-compatible material normally means a MPEG2 video stream. The important things are the frame rate, the resolution, and (if you have an audio track) the sound format. In Europe, PAL (the typical European TV standard) defines the resolution and frame rate. In Japan and the USA, there are two standards: the older NTSC and the more modern HDTV (see Box 2). The soundtrack formats are PCM, MPEG2 audio, DTS, and Dolby Digital/AC3. Amateur video fans will typically stick to simple stereo MPEG2 audio.

An MPEG2 stream is defined by four profiles that reflect the quality and frame rate. The MainLevel profile is used for PAL DVDs. The profile defines a maximum resolution of 720x576 pixels at a frame rate of 25 full frames per second. In contrast to this, an NTSC DVD uses a resolution of 720x480 pixels at a frame rate of 29.97 Hz.

Q-DVD-Author, which is based on the QT library, has just gone to 0.0.8alpha. As the low version number suggests, some features have not yet been implemented. But still, the functions that have been completed have proven extremely stable.

Figure 1: Automatic image scaling in Q-DVD-Author.

Preparation

First enter the project name and a working directory for the finished DVD in Tools | Setup. The Path tab has the path details for the DVDauthor tools. Q-DVD-Author only remembers this setup for the current project - it does not support global settings. The Scan system feature does not work in the current version, although the program's author informed us that development work is focusing on this area at present.

The default settings point to the binary files in /usr/local/bin, although most distributions store these files in /usr/bin. The whereis dvdauthor command tells you where the files really are located.

Although Q-DVD-Author was quite stable in our lab, it makes sense to save your work at regular intervals. Besides the simple save function, you can export a DVDauthor compatible project file in XML format and continue to work on the file with command-line tools. There is no import function for DVDauthor project files.

The next step is to add the actual movie files to the project. Select Add Movie and then choose the required movie in the dialog. Multiple selections will group clips to create a single movie.

Designing the Main Menu

It is a good idea to create the DVD menus in the order in which they will play later. The main menu, which will be the first thing the player displays, is always the VMGM menu selected when you launch the program.

There are four buttons below the main window, although only Add Background and Add Sound are actually implemented at present. Add Background opens a file browser, where you can select a background image file. The program automatically configures the selected image as the background in the menu you are working on. Don't worry about the size of the image. If the image is too big or too small, Q-DVD-Author pops up the Resize dialog (Figure 1), where it converts the size to reflect the PAL or NTSC format. The conversion is non-destructive. In other words, it does not affect the original file on your disk, so you can use images from your photo album without any risk.

To round off the main menu, you might like to add a score by clicking on Add Sound. Besides the typical MPEG2 audio format and PCM/WAV, the program also supports MP3 and Ogg.

It makes sense to create and dress all the other menus before you start with navigation and page links. For example, you would need to design a chapter selection submenu before you can link to it from the main menu. The DVDAuthor | Add Menu menu item adds an empty menu to the project. DVDMenu | Rename Menu allows you to assign an intuitive name, such as "Select Chapter." The remaining steps are the same as for the main menu.

Listing 1: A Simple DVDauthor Control File

01 <dvdauthor>
02  <vmgm />
03  <titleset>
04   <titles>
05    <pgc>
06     <vob file="video1.mpg" />
07     <vob file="video2.mpg" />
08    </pgc>
09   </titles>
10  </titleset>
11 </dvdauthor>

Figure 2: Context menu with navigational elements.

Navigational Aids

Navigational aids link the individual menus and the video streams. The aids will be represented as buttons that users can click later to move to the next menu or movie. The current version can use either text or images for this. The Collection and Movie items are not implemented at present. And the Frame item is not fully supported.

Right clicking in the main window drops down a context menu with navigational elements (Figure 2). As an alternative, you can use the DVDmenu entry in the title bar.

When you select a text element or an image, a cross-hair cursor appears, allowing you to drag a frame to define the size of the element. If you selected a text element, a dialog for the font, size, color, and justification appears; see Figure 3.

If you select an image as a navigational element, the familiar image browser dialog appears. You can scale, cut, and rotate text and image components by selecting Matrix in the drop-down (right mouse button).

For text elements, Edit in the drop-down again opens the font dialog, so this leaves you with the matrix menu for changes that affect the geometry. This approach gives you poor results for graphics, so you might prefer to use the drop-down below Edit, which opens the image dialog for image elements (Figure 4).

Table 1: Q-DVD-Author Features
Supported featuresMissing features
+ Support for full DVD structure creation - lacks support for movie buttons
+ Support for submenus and navigation- movies not supported as background
+ Automatic image scaling - subtitles not supported
+ Free scaling of objects - no integrated drawing functions
+ GUI for DVD slideshow- lacks movie format conversion tool
+ Manual command modification support- no online help
+ Integrated burning function 

Creating Navigational Aids

We want the picture of Tux to point to the Select Chapter submenu that we created earlier. To do this, we need to select the text and then select Define as button in the drop-down.

During the course of our testing, we discovered that the current version of the software causes a few issues when attempting to modify button elements. It makes sense to get the size and position of the navigational aid exactly right before you use the feature. This can save you a lot of headaches cleaning up the XML file later.

The Button dialog then appears, showing you a General text box where you can enter an intuitive name (Figure 5). The field just below this one is called Action and allows you to assign a function to the button, typically the jump command. The pulldown menu next to the field lists all the menus and films you have defined for the project so far. To link the text element to the video stream, simply select the stream. The menu with the time display refers to the current chapter, but we will get back to that later.

You have a few size and navigation options in the Advanced menu, however, you will not typically need them. There is no need to change the defaults to navigate the menu using the arrow keys on your DVD player. The Normal, Highlighted, and Selected tabs allow you to individually modify the button text for each of these selection states.

When you close the dialog, the context menu for the button displays slightly different functions. Selecting Edit no longer takes you to the font selection dialog but to the button dialog instead. You can undo a link by selecting Unbutton. The same dialog allows you to link the image with the Select Chapter menu, where you will be selecting a submenu as the target to jump to.

Select Chapter in Submenu

We still need a Select Chapter submenu that will allow us to jump directly to specific points of the movie. But before we can create that, we need to add chapter markers to the movie. To do so, we first select the required video below All on the left-hand side of the window, then right-click to drop down the context menu, and select Edit.

Figure 3: Font dialog in Q-DVD-Author.

Box 3: Structural Problems

In our test, Q-DVD-Author often had difficulty implementing changes to the structure. For example, the final DVD creation script crashed a few times. It turned out that the multiple additions and deletions had corrupted the XML file. Make sure you plan well ahead to avoid this kind of chopping and changing with the current version.

The SourceEntry item has a list of movies for the current project; each of these movies can handle chapter marking independently. The Auto Chapters function automatically assigns chapter marks in gaps. However, it is more common to divide the movie into logical chapters, and this is something you can only do by hand. The preview function in the chapter dialog was not working in the version we tested. This, and the fact that the movie player below Movie Selection did not have a timing facility, made it difficult to find the right position for chapter marks.

Box 4: Better Burning

The burning dialog in Q-DVD-Author is a minimalistic implementation; it does the job, but it may not be to your liking, and it can't hope to provide the feature-richness that a full-fledged burning program will give you. As the files that K3B needs to create a Video DVD now exist, you can also burn the DVD in K3B instead. Simply open a new VideoDVD project, select the project in K3B, drag the directory you generated with Q-DVD-Author into the data window, and burn the DVD.

After assigning chapter marks, you can use normal navigation buttons to jump to them, as described previously. It is common practice to use thumbnails from the chapters, but text will do at a pinch. As the movie now has chapter marks, you can select the chapters in a pull-down menu for each movie.

Finally, each submenu will need to give users an escape route back to the title menu. And this means adding an element that points to the VMGM menu to each chapter button.

Figure 4: Extended image manipulation.

Figure 5: Defining the functionality for navigational elements.

DVD Slideshow

This would actually complete the DVD, but Q-DVD-Author has another goody: DVD-Slideshow. You may already have noted the large Add slideshow button below Add movie on the left-hand side of the program window. Clicking this button reveals a front end for the dvd-slideshow program. Like DVDauthor, dvd-slideshow is actually a command-line only tool that creates a photo album from an MPEG2 data stream, allowing you to burn the album onto a DVD and view it on your TV set.

Selecting DVD-Slideshow gives you an empty text field (Figure 6). You can then click on Select images to add any number of images as the raw material for your slideshow. The Continue button takes you to a filter dialog that allows you to specify the transitions and select some background music. Incidentally, it only makes sense to select a background image if you know that the images will not fill the screen. Set the General delay in seconds to specify the period of time that each image will be displayed. The Include filter option allows you to specify whether or not to generate transitions, as specified by Continue. Generating filters is a time-consuming affair.

Clicking on OK opens the generate window, where you are prompted for special project settings for your DVD slideshow, such as the working directory and a name for the movie. Clicking on the Generate slideshow button then creates a movie in the specified directory. Q-DVD-Author automatically inserts the movie into the current DVD project and displays the movie in the media selection dialog.

DVD Burning

After preparing the data and menu, it is now time to generate the DVD data structure. The Command-Queue dialog in DVDAuthor | Create DVD is the place to do this. The dialog shows you the commands, which will be run in the right order, and gives you an opportunity to make last minute changes to the parameters (Figure 7). If you are not familiar with the individual tools, it is better to keep the defaults.

You might like to uncheck the Don't execute Burn DVD checkbox (this is unchecked by default). This means that the program will generate the DVD data structure in the working directory but not burn the DVD. Q-DVD-Author uses a text box to output its current activity when you launch into the generation process.

After completion (and this can take a while depending on the project size), you can run xine to check out the data structure on your disk:

xine dvd://working/directoryU
/VIDEO_TS

It makes sense to verify the results before you waste a valuable DVD. You can burn the DVD directly in Q-DVD-Author, by enabling the Burn DVD option in the Command-Queue dialog. The burn procedure uses well-known tools such as growisofs. Even after you have used xine to check your results, you might prefer to burn a DVD-RW first. Even authoring experts typically need two attempts to get a DVD to run properly on a TV set. As a beginner, you can expect occasional problems.

Figure 6: Integrated DVD-Slideshow front end.

Figure 7: Manual editing of generate commands.

During the mastering process, you should note that the viewing area on a TV set is smaller than your PC screen. Keep navigational elements and texts away from the edge of the screen. You should also check that colors are true and that your stand-alone DVD player can handle the medium.

Future

When all is said and done, Q-DVD-Author is the most mature video authoring tool on Linux, despite its quirks, such as the partially missing navigation and some missing functions. It is extremely stable - considering the early stage of its development. One thing you really notice in Q-DVD-Author is all the buttons for functions that still have to be implemented. It looks like Q-DVD-Author is aiming to become a professional DVD mastering tool in future, and early indications are that it will likely achieve this aim.

INFO

[1] Mencoder: http://www.mplayerhq.hu

[2] ffmpeg: http://ffmpeg.sourceforge.net

[3] Transcode: http://www.zebra.fh-weingarten.de/~transcode

[4] DVD specification guide: http://www.dvd-replica.com/DVD/index.php

[5] DVDauthor: http://dvdauthor.sourceforge.net

[6] DVDStyler: http://dvdstyler.sourceforge.net

[7] Q-DVD-Author: http://qdvdauthor.sourceforge.net