How to Create a DVD with a Menu

Check out the attached shell script attachment:dvd-automenu.bash.ksh for an experimental way to do this automatically using netpbm and ffmpeg, it creates a menu with no manual interactions directly from the video files and text description files extracted from the database:

attachment:dvd-automenu-s.jpg

Creating a Menu

I find this to be the most difficult part of creating a DVD with a menu. Basically, you have to capture or create a background image with the appropriate resolution. Then, mplex that together with an audio file (typically empty sound, though you can use sound) and then create overlay images that show

the menu text

the buttons when highlighted

and the buttons once selected.

You then use spumux to combine the background video with the overlay menus.

The background image must be saved as JPG and the overlay images must be PNG with only three colors used (four colors are allowed, but the transparent background counts as one of those colors). For this how-to, the background file is called menu.jpg, the menu text is called menu1.png and the highlighted and selected buttons are the same and called menu2.png.

Create a Background

To get a background image, I use avidemux2 and find the frame that I want to use as a background image. I then save the frame as menu.jpg by going File -> Save -> Save JPG Image. Or you can create your own background image in the GIMP. Use the following settings:

For PAL Video

Merge the background you just created with audio

You will have to have some sort of audio to mplex with the M2V file you just created, so either capture some audio using avidemux2 or another program, or to create empty audio to mplex, use this command

This command requires that you have toolame installed, of which I had difficulty finding any packages other than source. It's a hack, but I would just try and find a period of silence at least one second long in a PVR-250 recording and save that using avidemux2.

Merge the M2V video with the MP2 audio

# mplex -f 8 -o menu.mpg menu.m2v menu.mp2

Create the menu buttons in PNG files

The next step is to create the PNG files. This is another step that I find difficult to explain and the steps here are not the cleanest way, but they work for me. If anyone can describe a better way of doing this, please do.

Open the background menu.jpg file in the GIMP. Add a transparent layer over the background and mark where you will want the different buttons to be located. This layer will later be deleted, so it doesn't have to be clean. When creating this layer, use all the colors you want to use with your buttons. Remember, no more than three colors.

Delete the Background layer.

Change the image to an indexed color mode. Do this by right-clicking on the image and selecting Image -> Mode -> Indexed. Enter "4" in the number of colors.

Create two new layers.

In the top layer, you will enter the text for your buttons. Select the color you want for your text either in the color palette or by using the Color Picker Tool. To use the Color Picker, you must make sure you have that bottom layer selected. Enter the text for all the buttons on the top layer according to whatever layout you decided on.

Now you will create the actual buttons by drawing boxes around the text and filling that area with the Color Fill Tool. Be sure and select the color you want (contrasting to the text) and to create your boxes in the second from the top layer.

Delete that bottom layer that I told you we would eventually delete.

Save the current image as menu2.png. Do that by right-clicking and selecting File -> Save as, and make the name menu.png. Click "Export" and make sure that "Save Background Color" and "Save Resolution" are selected.

Select the bottom layer and change the Opacity to 0%. Now save the image as menu1.png.

Create the final menu video

To create the DVD menu, an XML file is used. An example menu.xml file is shown below. The autoorder line is used to decide what takes precedent for ordering. If your buttons are ordered primarily by rows, then select "rows". If your ordering is by column, then choose "columns".

The number of these lines that you see should be the same number of buttons you created. If there are, then good job!

Authoring the DVD

To create the DVD structure, an XML file is used. The below file is an example dvd.xml file. This example file allows for the 4 buttons in the menu created earlier and has three video segments making up each of the 4 video titles. Each of the separate video segments will be treated as separate chapters of one consistent video title.