Menu for VCD/SVCD/DVD

In order to add a menu just add the option -menu. It is possible to use more menu specific options, but the defaults should be good enough.

DVD

There can be up to four different menu pages on a DVD
 A multi-title DVD contains an additional menu: the Title Menu. From this menu you can navigate through the DVD titles. It is also possible to have a DVD with an extra menu containing picture galleries and/or slideshow. How to make a multi-title DVD and how to add the extra menu is described below.

VCD/SVCD

A CD menu looks very similar to a DVD menu. The bigger difference is that on a CD the Audio Menu and Subtitle Menu are not interactive: they only show you what kind of audio and subtitle tracks are present on the CD, but you cannot select the track from the menu.

Options

You can specify a background image for the menu with:
-menubg image.jpg
If  you do not use the option -menubg, a default background is automatically created.
It is possible to specify a thumbnail in the Root Menu with:
-menuvtsbg pic.jpg
There a four possible kind of thumnails. See -menuadvopts X later.

Is it possible to fine trigger the menu creation with several options. Some of them can be selected with:
-menuopts I:II:III:IV:V:VI:VII
I - write the title on the background Main Menu: 1 [write (default)], 0 [do not write], add 2 to write the title on the titlebar
II - thumbnails per row in the chapter submenu: 0, 1, 2 (default), 3, 4, 5 (0 is a special case, it means do not create the chapter submenu although the disk contains chapters)
III - the thumbnails can be: 0 [static images (default)], 1 [animations (DVD menu only)]
IV - number of text lines under the thumbnails: 1, 2 (default), 3, 4
V - the player will: 0 [show the menu (default)], 1 [play the first title]
VI - with the option -titleset create a play all button: 0 [no (default)], 1 [yes], 2 [yes repeat]
VII - menu aspect ratio: 0 [4/3], 1 [16/9noletterbox (default)], 2 [16/9nopanscan]

Other advanced options, more technical and probably not needed by the average user, can be selected with:
-menuadvopts I:II:III:IV:V:VI:VII:VIII:IX:X:XI:XII
I - select the format used for the creation of the thumbnails: jpg [faster but lower quality], png (default), pnm, tga
    For the creations of the thumbnails it is possible to take the first frame at the beginning of each chapter, but this can result in a dark image due to the fade in. Another option is to scan few seconds at the beginning of the chapter and use as thumbnail the picture that has the bigger file size. During the scanning process, it is possible to render all the frames (slower) or only the Intra Keyframes. With the option -menuthumboffset you can start the scan at a certain offset instead of the beginning of each chapter.
II - thumbnail selection: 0 [bigger file (default)], 1 [first frame], 2 [last frame]
III - thumbnail rendering: 0 [Intra Keyframes (default)], 1 [all frames]
IV - thumbnail scan time (seconds): 1, 2, 3, 4, 5 (default), 6, 7, 8, 10, 12, 14, 16, 20, 30
V - font size of the text under the thumbnails: 1 (smaller, default), 2, 3, 4, 5 (bigger)
VI - background style of the text under the thumbnails: 0, 1 (default)
    When the thumbnails are not static images (-menuopts ::1), it is possible to select how many parts to extract from the chapter and how long each part is.
VII - thumbnail's animation parts (DVD menu only): 1, 2, 3, 4 (default), 5, 6, 7, 8, 9
VIII - length (seconds) of each part (DVD menu only): 5, 10, 15 (default), 20, 25, 30, 35, 40, 45, 50, 55, 60
    The TV normally cuts the external edges of the video. It is advisable not to put any text or buttons closed to the borders.
IX - use TV overscan area for menu: 0 (default), 1
X - Root Menu thumbnail: 0 [empty image (default)], 1 [menubg charcoal], 2 [first chapter thumbnail], 3 [menuvtsbg pic]
XI - add navigation buttons in the Title Menu (DVD menu only): 1 [with more than 4 titles (default)], 0 [always]
XII - with the option -title create the DVD filesystem too (DVD menu only): 1 (default), 0

If you want to specify only some suboptions, you do not need to specify all the others, just put enough colons to assign the specific suboptions. Suppose that you want to specify only the third suboption. The following examples are all equivalent:
-menuopts ::1
-menuopts ::1::
-menuopts 1::1
-menuopts :2:1:

The options -menuchaptertext, -menuaudiotext, -menusubtext accept a variable number of arguments (text strings). If the argument's text contains a space you need to enclose the argument in double quotes. If you want to omit an argument, you must supply the null string (""). The argument -- indicates that the previous one was the last argument for that option. Example:
-menuchaptertext "Start of the video" "" "" End -- source.avi
In the previous example, the text Start of the video will be placed under the first thumbnail. The second and third thumbnail will not have any text, the fourth thumbnail will show the text End. If there are more thumbnails no text will be added to them.
If you have many chapters, you may need to type a lot of text as arguments of -menuchaptertext making the command line ugly. In order to avoid it, the options -menuchaptertext, -menuaudiotext, -menusubtext can be followed by -readfile <filename>. In this case each line of the file <filename> will be used as argument of the option.

The format of the argument of the option -menuthumboffset is: offset1,offset2,... If an offset is repeated several times you can specify it only the first time. Examples:
-menuthumboffset 10,20,,,15,, is the same as -menuthumboffset 10,20,20,20,15,15,15,0,0...
-menuthumboffset ,,1:00,,15 is the same as -menuthumboffset 0,0,1:00,1:00,15,0,0...
The option -menuthumboffset only works with static (not animated) chapter submenu and with DVD menu (not VCD/SVCD).

Suggestions

During the creation of a menu, it is better to check the final result before you burn the disk. Here is my recommended way to proceed (the example refers to a DVD, but it applies to VCD/SVCD as well).
Create your DVD without menu:
encode2mpeg -o mydvd -dvd <options> -imageonly
Check (for example with xine) that the mpegs are fine (chapters, audio channels, subtitles etc.). If everything is ok, add the menu:
encode2mpeg -o mydvd -dvd <options> -imageonly -resume clear img -menu
Is is important to add the option -resume clear img. If you do not add the option -resume, encode2mpeg will restart the process from the beginning recreating again the mpeg stream. If you only add the option -resume without arguments, nothing will be done because the mpeg stream and the DVD filesystem have been already created.
Check now the default menu in the dvd image. If it is ok, you can burn the DVD, otherwise runs the previous command with different menu options:
encode2mpeg -o mydvd -dvd <options> -imageonly -resume clear img -menu -menuopts ::1 -menubg mypic.jpg
You can iterate the previous step until you are satisfied with the menu. When everything is fine, you can burn the DVD:
encode2mpeg -o mydvd -dvd <options>            -resume           -menu -menuopts ::1 -menubg mypic.jpg

Bugs

I have noticed that during the creation of the animated thumbnails, ImageMagick sometime fails during the rendering of some frames. The errors are random: different runs will show errors during the rendering of different frames and from different points in the program. I have not figured out why ImageMagick fails, but if you see these messages in the log file:
**ERROR: failure during menu creation (FUNCTION: menu_draw_text LINE: nnnn)
**ERROR: failure during menu creation (FUNCTION: menu_draw_rect LINE: mmmm)
**ERROR: failure during menu creation (FUNCTION: menu_make_vts_chapter LINE: oooo)
or similar ones, then it is an ImageMagick problem. I have implemented a workaround that should be able to take care of these errors. To enable the workaround add the option -menufix. If an error occurs and -menufix is able to recover it, you will see in the log file:
++ WARN: [menufix] menu_runfunc_pic: success at line nnnn after m try
++ WARN: [menufix] menu_runfunc_pic: function <name> line nnnn: saved backup pic after m try
If -menufix is not able to recover it, the message will be:
**ERROR: [menufix] menu_runfunc_pic: too many failures for function <name> line nnnn
**ERROR: [menufix] menu_runfunc_pic: source pic for function <name> line nnnn already corrupted
Keep in mind that if you use -menufix you could still see (although it never happen to me) the error message:
**ERROR: failure during menu creation (FUNCTION: xxxx LINE: nnnn)
because -menufix can only fix errors that happen during the creation of the chapter submenu. If you use -menufix and see the previous error, consider submit a bugreport.

Multi-title DVD

In order to put more than one title on a DVD you must follow these guidelines:
encode2mpeg -o title1 -dvd <options for title 1> -imageonly -menu -title
encode2mpeg -o title2 -dvd <options for title 2> -imageonly -menu -title

Picture gallery and/or Slideshow

The feature explained here allows you to have another menu, the extra menu, from which you can access and watch in sequence e set of pictures one by one (gallery) or as a continous video (slideshow). The extra menu is created when you use one or more -menuextra option. Also an "extra" button will be available in the root menu that allow you to access the extra menu. The option:
-menuextra "sequence 1" [@:I] image1 image2 image3 ....
will create an entry in the extra menu with title sequence 1 that, once selected, will show in order all the pictures supplied as argument to the -menuextra option. The images can be in any format and any resolution. If no suboption or the suboption @:1 is given, the images will be scaled to DVD resolution and black borders will eventually be added in order to preserve their aspect ratio. If the suboption @:0 is given, the images will be scaled to fit the screen. Instead of image1 image2 ... you can use -readfile <file> with <file> containing in each line the name of the images arguments of -menuextra. The option:
-menuextra "sequence 2" [@:I:II:III] mf://file*.png
will create an entry in the extra menu with title sequence 2 that, once selected, will show a video made with all the pictures supplied with the mf:// argument. The images of the mf:// argument must be of the same supported format, JPG PNG TGA SGI, and must have the same resolution. The suboptions can be:
I - 1[ keep aspect ratio (default)] 0 [fit the screen]
II - n [number of seconds each image is showen in the video (default 4 seconds)]
III - video codec MPlayer must use to decode the images. Use ijpg if you have troubles with big or portrait jpeg pictures.
The option:
-menuextra "sequence 3" video.mpg
will create an entry in the extra menu with title sequence 3 that, once selected, will show the video supplied as argument. Such video must already be in a valid dvd format.

Top