Creating Pan & Scan menus

MPM wrote on 4/12/2007, 11:24 PM
Pan & Scan display mode means the DVD player crops or cuts the sides off of a 16:9 picture and displays the result full screen on a 4:3 TV. The picture still has the same proportions as the original, unlike fill mode (used by some players) that distorts a 16:9 picture to fit a 4:3 screen. Filling the screen on both 16:9 and 4:3 displays might be preferred artistically, or perhaps a more practical matter for something like an educational project.

Pan & Scan causes problems with menus however… DVDs have an overlay track for the button highlights, and this does not get altered by the pan&scan process. A 16:9, retail movie DVD will normally have 3 sub-picture streams making up the button highlight track — 1 for 16:9, 1 for letterbox, and 1 for pan&scan — so that button highlights appear where they should.

For a 16:9 project DVDA creates two sub-picture streams — 1 for 16:9 and 1 for letterbox — so in pan&scan display mode button highlights will be in the wrong places; however it’s not as bad as it might seem… A DVD has _MAT tables that list the allowed display modes for menus, and DVDA does not include pan&scan with 16:9 menus. As long as the player obeys this restriction, there can’t be a problem with pan&scan buttons not lining up.

That said, the “Automatic Display Modes” in the _MAT tables can be edited in IfoEdit very easily, and it is indeed possible to create pan&scan menus in DVDA. Please remember though that they won’t look right in any other mode, so you want to take whatever steps (i.e. scripting etc) to make sure that they only show up when a player is set to pan&scan. It is extra work, whether you’re creating separate menus in DVDA or a pan&scan sub-picture stream in high end software like Scenarist, and of course you have to decide if it’s worth it.

If you want to provide both 16:9 and 4:3 menus without distortion, supplying a second set of menus is still perhaps the best way, since you don’t have to rely on the viewer’s player being set to pan&scan mode. But, using DVDA, providing pan&scan menus is less work.

The menu background is the easiest part: just make sure the important parts of the menu are in the center 720 pixel width. It also works to import a 4:3 image or video, selecting the letterbox display option in media properties — be warned that DVDA will re-render if you do this. The highlight mask is what’s tricky, as you’ll deliberately place highlights away from any buttons. [Please Note: the image or frame sizes provided are for NTSC only, since I don’t have PAL TVs to verify that it works as planned.]

Pan & Scan Highlight placement relies on using image editing software to distort the frame for temporary button graphics and/or masks. Since button areas and highlights will not line up with the final menu background in DVDA’s preview window, a temporary background graphic can be useful for placing your buttons and/or the button areas.

Starting with a 16:9 or 4:3 image [873 or 720 X 480], the frame has to be first cropped, then enlarged, so that when a DVD player distorts the sub-picture by performing pan&scan, everything matches. The width should be cropped to either 654 [16:9] or 540 [720 or 4:3 frame]; the easiest way to do this is by resizing the canvas. The result should then be re-sampled, enlarging the frame back to it’s original size [873 or 720].

A simple example using Photoshop to create a button highlight mask would start with a still of your menu page background. Next you’d place text for buttons, leaving them on original layers and NOT rasterizing. Save As to get a PNG file for your menu background. Crop the image, then enlarge, to get the needed distortion, Save As to get a PNG to get a temporary background for button placement. Turn off display of the background layer so only the text is visible, merge the visible layers, load the text selection, and fill the selection with black. Save As to PNG gets you your Highlight Mask.

The same basic concept can be used for overlays in Vegas for motion menus, for graphics instead of text, and hopefully anything your creativity can come up with — the only critical part is the dimensions for the crop and enlarge.

To optionally check your work before burning to DVD, you can use DVDSubEdit… Load the VOB file with your menus [DVDA uses VTS_01_0.VOB], moving the slider under the video window to show your pan&scan menu. [Please Note: you’ll see 2 of them – you want the first one]. In the Drop-Down box on the left below the video window, select Pan & Scan, then move the slider all the way to the right under “SubPic Color/Transparency”. You’ll see your highlights, and the green boxes for the button coordinates — if everything went right both line up. If you need to do a bit of tweaking in DVDA, it’s often painless since only changes are re-rendered, and if you just adjusted the button bounding boxes for example, it might take a minute or less.

The last step once you’re satisfied, is to edit the menu IFO file [for DVDA VTS_01_0.IFO] to allow a DVD player to use pan&scan. Using IfoEdit open the Ifo file, select the *_MAT line in the top window, scroll down in the lower window, double clicking on the line: “Video attributes of VTSM_VOBS”. Check the box for auto pan&scan, and save.

Comments

MPM wrote on 4/12/2007, 11:25 PM
Scripting in DVDA 4 is fairly easy, using drop down lists like other properties. If there’s a downside, it’s the DVDA abstraction layer that hides a lot of the more unpleasant aspects of DVD authoring; whatever scripting you do is more or less adapted into DVDA’s way of doing things. The result is a little harder to trace in a program like PgcEdit, though everything usually works the way it should — you have a little less say regarding where your scripts are located, and sometimes querying the player’s registers doesn’t work quite the way you might expect.

When it comes time to place your script, you can only choose one of the objects you’ve already created in DVDA, like a menu page or imported video. If you don’t mind the disadvantage of working outside of DVDA 4, using PgcEdit you can insert your scripting on your choice of the couple of dozen dummy menu pages DVDA creates for it own scripts.

If you want to direct &/or control the display of menu pages through scripting in DVDA, you should create a dummy menu page to hold it. If you use the scripting command to link to a page, and that target page is the same one with the script that called it, you’ve just sent your DVD player in a loop, though it won’t take long at all before it stalls at the welcome screen.

Some of the scripting you might do in DVDA 4 is fairly straightforward.— you assign a value to a GPRM and the viewer’s experience is based on that value, sort of like a cookie on a web site making sure you only see the English pages. It get’s more complicated when you want to check the DVD player’s preferences, for example checking the preferred language. This site has a reference of the system registers, or SPRMs: http://dvd.sourceforge.net/dvdinfo/sprm.html

This site has a decent explanation of how the registers work: http://www.kenstone.net/fcp_homepage/alex_all_menus_dir/chapter3.html

An example in DVDA querying for display mode preferences, then actual display mode, directing the viewer to a Pan&Scan menu page looks like this:

1 GPRM0 = SPRM14
2 GPRM1 = GPRM0
3-7 if(GPRM0 & 3072) then Link page: ‘Menu2', button: ‘Default’
8-12 if(GPRM1 & 256) then Link page: ‘Menu3', button: ‘Default’
13-14 Link page: ‘Menu2', button: ‘Default’

The actual scripting is pretty simple, explained better than I could at the second link above; I just wanted to include an example of what it looked like in the DVDA window. Together with the list of system registers, it hopefully should give you a start.