Creating Multi-Aspect Menus

MPM wrote on 4/9/2007, 3:20 PM
This includes a method for including real multi-aspect menus in DVDs authored by DVDA. It is not complicated, but it's long for the sake of explanation so that hopefully everyone can use it -- not just the pros. As always comments are welcome. Hope it helps...
---------=----------=---------=------------
Background:
DVDs have 2 video aspect ratios – 4:3 and 16:9 – but four methods of display: 4:3, wide, letter-boxed, or pan & scan; pan & scan fills the screen of a 4:3 TV, turning a 16:9 frame into a 4:3 picture by cutting off the sides. Mixing 4:3 and 16:9 content is allowed, but aside from tricks used by high-end software, content (including menus) with different aspect ratios should be in different Title Sets [sets of one or more similarly named VOB files].

Normally you can set the preferred display mode for your DVD player using the set-up menu, and unless it’s prohibited, you can change the video mode using the remote — set-up menus, options, and how preferred display modes work can vary. Aspect ratio, display modes and prohibitions are also included in a DVD’s instructions to or for the player (if a mode is not included it can be considered prohibited), but it’s up to the player how it follows these directions.

A DVD player stores its display mode preference in the register SPRM 14, and mpg2 video [used for both titles and menus] stores it’s aspect ratio and frame size embedded in the file. In the instructions for DVD players, aspect ratio and display modes are stored [and edited using specialized software] in the *_MAT tables.

DVDs use sub-picture tracks, a sort of overlay used for sub-titles, BOV, menu button highlights etc. These overlay tracks might not stretch into different display modes like the underlying video, and if they do stretch, might not be as accurate or look as nice; to compensate you can have multiple versions assigned to one overlay track… This way you can render [rasterize] sub-titles for 4:3, letterbox, pan & scan, or wide screen display instead of making do with just a 1 image of your text stretched to fit an altered video frame. This applies to the sub-picture tracks used with/for menu buttons as well, where it’s critical that the overlay matches the underlying image.

Since most video on a DVD will be D1 resolution [720 x 480 or 576], including anamorphic 16:9, trying to use the same menu for both full and wide screen display means that one of the 2 will appear distorted. The easiest route is to use only 1 display mode, in effect trying to prohibit the others. Pan & scan gives more flexibility with little added work, using menus designed with all critical content in the center portion, but you need more than one sub-picture stream. Providing separate menus though, each depending on display mode, is probably more attractive.

DVDA :
It’s not possible to independently set the menu aspect ratio in DVDA 4 — every menu has to conform to the project settings and DVDA 4 will re-render as needed to enforce that rule. While background media properties gives you 3 choices — Stretch, Zoom, and Letterbox — this only changes how your background is displayed inside the video frame you chose in project properties. And DVDA 4 will mux [combine into VOB files] multiple tracks, but it will only accept one stream per track, meaning that you can only use one version of your sub-pictures.

A 16:9 DVD authored with DVDA 4 by default has the menus set to Automatically Letterbox on a 4:3 TV — this can easily be edited with IfoEdit [in the _MAT tables] or PgcEdit [using stream attributes]. DVDA 4 also puts all of the menus in one Title Set, which is why you are not allowed to mix menu aspects — mixing title video with different aspect ratios is trivial as DVDA 4 puts every title in it’s own Title Set. While it is a bit of extra work, you can however add the option of true 4:3 and 16:9 menus to a DVD by editing the layout rendered by DVDA 4.

Including Multi-Aspect Menus [One Method]:
Overview:
An extra Title Set is created, a switch button is added to 2 menus, and when design work is done, a duplicate set of menus is created by renaming the project, switching project aspect ratios, and optionally replacing any background media. Editing one of the DVDs on hdd, menus are copied to the extra Title Set, and slight modifications made to the player instructions. The other DVD is then edited to match, and the added Title Set with menus is copied over those in the first DVD.

DVDA:
A new, duplicate set of menus is needed, and for this to work, you need an extra Title Set to hold them. Since DVDA 4 creates a Title Set for each title added, adding a couple of extremely short, in essence dummy clips does the trick. It works well if they’re at the very top of the project tree on the left-hand window. It also works well if your real title videos are at the bottom of the project tree at the same level, not under any menus. You need 2 dummy clips because the first one will wind up in the same Title Set as the original menus — that will be followed by the more or less empty Title Set that will hold the added set of menus, and then those Title Sets holding your main video.

Two identical menus handle the aspect ratio switch — the main menu works well. Include identical buttons to link between the two — these will switch menu aspect ratios in case you use labels or captions, and again both menus should be identical.

PgcEdit:
I’m keeping this as general as possible, based on a very simple 16:9 project: a menu and copy of that menu with 1 button for the video and 1 button linking the 2 menus [to be used for switching menu aspect ratios]; however it should be fairly easy to apply to more complex DVDs. Since this method takes a complete menu structure and copies it, only very simple editing is required, and then only to switch between the 2 menu systems.

If you aren’t used to working with PgcEdit at first it can seem overwhelming. PgcEdit shows you basically the different player instructions and scripting in your DVD, and logically the more complex your DVD, the more instructions and scripts you’ll see. This can be misleading however, because authoring software like DVDA 4 seems to include all sorts of scripting just in case you use or need it for your project — opening a DVDA created DVD in PgcEdit, an awful lot of the scripting you see does nothing useful at all, and in any case you won’t have to bother with 90% of it.
---------------
At this point you should have 2 DVDs on your hard drive, and they should be identical except for the menu aspect ratios and possibly your menu backgrounds. Open one of them in PgcEdit [you can ignore the first warning], and you’ll see a somewhat long list on the left. Parts of the list are grouped; this represents the different sets of VOB files [Title Sets], with the Video Manager [VMG] at the top [from the VIDEO_TS files]. Different Title Sets can’t talk to each other without first going through the VMG domain, so you’ll be concerned with it and the 2 Title Sets holding your 2 menu systems [using my simple example the first and second titles].

The first thing to do is to go to the Info menu and select GPRM — note the GPRM numbers that are free, as 2 of them are needed to keep track of which aspect ratio is selected [throughout my example I’ll use 6 and 7]. Also remember to save your work, plus PgcEdit has an incremental backup feature that’s useful.

The second step is to locate the dummy Title Set [in my case #2]… If you look at the last line for each Title Set group on the left, it’ll give the title number, and the length of that title video in parenthesis; my dummy clips are 0:01 duration, and you can also preview the video by right clicking on it and selecting Preview PGC. This gives two possibilities (I used 2 dummy clips) but only one (the one I don’t want) will include menus — you can spot menus because the number of buttons is listed on the right [in my case 2b].

Selecting a line in the dummy Title Set [my #2], any commands are shown at the upper right part of the window — if there are any commands, right click on that line and select “Delete all commands in PGC”, repeating this for the rest of the lines in this Title Set. Now right click one of the lines in the dummy Title Set, and select Import Menu, clicking OK on any warnings. An open file dialog will pop up, and you want to select the IFO file containing all of your menus; it should be VTS_01_0.IFO [if you look at the group with Title 1 in PgcEdit, it should be the only one originally with any buttons]. After clicking OK a couple of times you should wind up with 2 menu sets in your DVD.

Right click on one of the lines for the Title Set you just modified, selecting Domain Streams Attributes; change the aspect ratio, which will be useful tracing and checking program flow in the DVD.

Now it’s time to edit the commands, so please make sure and note any changes you make so that you can duplicate them exactly on your second DVD. A GPRM is a variable register – it takes a value we give it and holds or remembers it. One GPRM is going to be a constant, while the other will change depending on the aspect chosen. In my example I’m setting GPRM(6) to 0 for the original 16:9 menus, changing it to 1 for the 4:3 menu system. GPRM(7) is set to 1 and stays that way, since it’s only purpose is to be a constant that GPRM(6) can be compared to.

The very top line on the left of the PgcEdit window is First-Play PGC, and that’s where the program flow starts. I’m going to insert 2 pre commands to set those 2 GPRMs, and the easiest way I’ve found to do it is by copying existing commands and then editing them. Clicking on the VMGM line #4 I see the pre command: “Set gprm(4) =(mov) 0", so I select that command, right click and select copy. I then click the First-Play PGC line again, then select the only pre command, right clicking and selecting Paste Before. I do this twice so that I have 2 new pre commands. Right clicking on each, selecting Edit Cmd, I can change the values to: “Set gprm(6) =(mov) 0" and “Set gprm(7) =(mov) 1".


Since commands are often routed through the VMG domain [remember that Title Sets can’t talk to each other], I need to intercept anything headed for the menus and make sure it goes to the right menu set. Checking each line in the VMGM group, I see this pre command on line #2: “(JumpSS) Jump to VTSM 1, Chapter menu (TTN 1)”. VTSM 1 is the first Title Set, the one holding the original 16:9 menus, so I right click on that command, selecting duplicate. I then right click the top copy, select Edit Cmd, and change it into: “if ( gprm(6) == gprm(7) ) then { (JumpSS) Jump to VTSM 2, Chapter menu (TTN 1) }”. Since GPRM(6) only equals 1 when 4:3 menus are selected, this pre command sends the program flow to the correct menus, either the second Title Set with my 4:3 menus, or the first Title Set with my 16:9 menus.

Copying that new, edited command, I can then go through the rest of the VMGM lines, pasting this new command before every pre-existing “(JumpSS) Jump to VTSM 1, Chapter menu (TTN 1)”. Because all I’m doing is intercepting jumps to the original menus, I really don’t care about or have to interpret any of the other commands DVDA included in the VMG domain.

All that’s left now in PgcEdit is adding a couple of commands to set GPRM(6) to either 0 or 1, so that the DVD player will know which menus to use. And that means it might be time to enter PgcEdit’s Trace mode — your choice really, as you can go by the line numbers I used, taking the chance that DVD’s the same, or you can trace through it yourself. I’ll give both directions…

The easy way to do it is to go to lines 12 and 15 in the first Title Set [VTSM 1], and copy, paste, and edit pre commands so that you wind up with:“Set gprm(6) =(mov) 1" before the existing JumpSS command. Then go to lines 12 and 15 in the second Title Set [VTSM 2] and insert this pre command before the Jump : “Set gprm(6) =(mov) 0" .

The harder (but perhaps more correct) way is to go into Trace mode in PgcEdit. The icon that looks like a disc eject button starts or jumps back to the beginning of the DVD. Clicking the Step, NextPB, or Run buttons will lead to your original first or main menu being displayed. You should have included a button to go to a copy of this menu page — click it now, and click Select & Break. This is where you want to set GPRM(6) = 1, so at the top insert the pre command: “Set gprm(6) =(mov) 1". Note the line number, and go to the corresponding line in the Title Set holding your added menus — this time insert: “Set gprm(6) =(mov) 0".

Restart the trace, select the same button on your original menu — this time you should wind up with the copy of your original menu, and if you look on the left, you should be in the Title Set with your added menus. Click the button that links to the original menu page, then click Select & Break. On the right, at the top of the pre commands insert: “Set gprm(6) =(mov) 0". Checking the line number on the left, go to this same number line in the Title Set with your original menus — at the top insert the pre command: “Set gprm(6) =(mov) 1".

You should be done in PgcEdit with this DVD, and almost done with the project. It won’t hurt to run through trace mode again, but better proof would be using your software DVD player on the results, making sure everything works properly. Assuming everything works, and assuming you’ve made notes of everything you changed in PgcEdit, now it’s time to do it again on your second DVD, the one with the real alternative 4:3 (or 16:9) menus.

After editing the second DVD in PgcEdit the Title Set with your new menus [in my case the VTS_02_* files] is simply copied over the existing set for the DVD you just finished editing.
All you really need to do then in PgcEdit is copy your menus into the cleaned out, dummy Title Set, just like before, and then insert the pre commands setting GPRM(6) = 0 on the same 2 lines. However this does not give you the ability to test anything on your edited second DVD — it’s your choice if you want to duplicate all the changes you made to the first DVD, so that you can go through a round of testing to make sure that there are no errors.

Finish:
As already mentioned, the final step is to copy the Title Set containing the alternative menus from the second, edited DVD to the first. If you’re ambitious it shouldn’t be difficult for you to add scripting in either DVDA or PgcEdit to query SPRM(14) to determine the player’s preferred display mode, and based on that, set GPRM(6) (or whatever GPRM you used) early on. Please bear in mind that changing the display mode with the remote however does not change this GPRM, and even if you try to do it automatically, until program flow passes through that point where you query the system register, the GPRM tracking it will not change. It might make best sense to simply turn this remote function off for menus entirely.

The logic behind my method is that if everything is identical besides the menu aspect ratio and possibly the background media, large parts of the DVD (in this case complete Title Sets), should be interchangeable. One weakness, perhaps the largest one, is that the background media may well not be identical. All media files outside the replacement Title Set should ideally be included in the first or main, edited DVD, so that their location can be properly referenced, and it doesn’t hurt to use PgcEdit or FixVTS on the finished result for the same reason. It might or might not make or break the DVD, but it should lead to greater player compatibility.

Comments

No comments yet - be the first to write a comment...