Well, it had to happen sooner or later - the project discussed in this article doesn't really qualify as "simple" spec. re-authoring. Not because it's overly complex, but because there are a lot of things going on thanks to DVDAfterEdit programmer Larry Applegate. Some time ago, Larry put this "Liquid Lifestyles" DVD together and was kind (?) enough to pass it along to me for further DVDAfterEdit optimization. Thanks Larry!
» Click here to download example files for this project.
This DVD project contains a First Play with 15 frames/1 GOP black video (VTS 2), a main program containing four chapters with two audio and subtitle streams, a main menu, and three sub-menus (chapter, audio, and subtitle selection). All of the menus feature intro and outro transitions with audio. The primary area of interest from the DVDAfterEdit point of view is that all of the menus and their respective transitions reside in the same VMG VOB. This design allows for not jumps, but links between all of the menus - therefore reducing (if not eliminating) DVD player menu search time. Navigation performance is fast thanks to the absence of DVDSP 3's abstraction-layer programming. If you've ever wondered why many "Hollywood" DVD's have quick navigation and low DVD player search times when using transitions, read on!
From the spec. authoring point of view, this project also introduces an important DVD feature not covered in my previous articles: the main program featured on this disc contains two audio and two subtitle streams. These streams can be setup either via their respective menus or via the remote audio and subtitle keys while the show is playing. The disc is authored in such a way that if the user changes streams... well, mid-stream (sorry!) during the show, the button highlights upon return to either of the stream setup menus will automatically reflect this change. In addition, the stream settings "stick" until the user changes them again. Whether the show is exited via the remote title or menu keys or is allowed to play until its end, the DVD player will check the status of the audio and subtitle streams and update two GPRM's and button highlights accordingly.
As usual, only a minimum of programming was completed in DVDSP 3. In fact, it's impossible to author this disc as it currently functions and performs with DVDSP 3. Menus setup this way can only be assembled in a DVDSP 3 track, and buttons residing in a track cannot be specifically targeted - let alone buttons residing at various markers throughout the track's timeline! Also remember that DVDSP 3 does not give the author access to the Video Manger Domain. Unlike previous articles, however, only the final DVDAfterEdit build is available in the member download area due to the relatively large file size. Although the assets are encoded at extremely low bitrates, there are a total of fourteen pieces of video (with matching audio) required for the menus and transitions.
If you haven't checked out Ian's recent Advanced Techniques - Manipulating Menus article, please do so. He goes into great detail regarding menu VOB's, the setup of which is briefly outlined in the next section. This article also assumes you have reviewed previous Spec. Re-Authoring articles. If you need more information about DVDAfterEdit functionality or some of the programming techniques and etiquette presented here, please refer to those articles.
[Please note that as of this writing, Tracer does not simulate this project correctly]
Below is a picture of the menus and transitions built in a DVDSP 3 track:
[inline:43_menus_transitions.jpg=center,menus and transitions built in a DVDSP 3 track]
These menus and transitions were assembled in FCP, and then output as individual video and audio files. The video files were then converted to MPEG-2 and the audio files were individually encoded with A.Pack - nothing out of the ordinary. All of these assets were then imported into DVDSP 3, and finally assembled on a track's timeline. Here's how the menus are organized on the timeline:
These menu bits are designed in such a way that each menu is comprised of 2 Cells. The first Cell is the transition into the menu, and the second Cell is the menu itself. Outro transitions that leave a submenu to go back to the main menu are handled the same way - they are "attached" as Cell 1 to the menu being navigated towards, not Cell 3 of the menu they are leaving. The key is to prevent the pause between the transition and the menu; to do that for this disc the main menu has to appear four times on the DVDSP track timeline, since there are four transitions leading to it.
Having four Main Menus may seem a little strange, but if done correctly this will never be apparent to the user (unless you want it to be). The only possible pitfall is not so much the extra programming (which is quick and easy), but the greater disc space required. If your DVD is tight for space but you want to use transitions, one option is to avoid using outro transitions back to the main menu. Transitions from sub-menus back to the main menu are not very common and may require main menu duplication depending on the design. Another alternative would be to avoid using audible audio during the transitions (or just the outro transitions) because audio dropping out is more jarring than a slight video pause in most cases.
Notice how the audio is broken into separate segments. Although a single stream could be used instead, the use of segments can help to better and more easily define the audio in regards to the PGC/Chapter boundaries. Although to have "complete" PGC's all menus should contain an audio stream, there is another practical purpose. Surround-Sound systems generally auto-detect the audio stream. This auto-detection will be faster and smoother if the presence of an audio stream remains the same from menu to menu. Sometimes DVD's that have audio on some menus (but not all menus) will have their audio clipped at the beginning of a menu because the system is trying to figure out if a stream is present. If all of the PGC's/menus contain audio (whether it is audible or not), this is less of a problem. Please remember that all audio streams in menus need to be of the same file & channel format.
When assembling all of the files on a DVDSP track timeline, be careful to make sure there aren't any video gaps, and that the individual audio files are aligned correctly. Since audio files do not adhere to a frame count, they may not match the video exactly - they are often offset by less than a frame. Just make sure to match the marker/chapter and audio segment start times. If an audio segment exceeds the start of the next marker, trim its length if this prevents the proper alignment of the next adjacent audio file. At this stage, don't worry about small audio stream gaps you may see on the timeline until you check the final build. If you can hear them, then worry!
No programming of this soon-to-be menu VOB is required (or even worthwhile) at this stage since it won't be used. Remember to draw/setup the buttons for each overlay and be sure to double-check that each overlay is set to "force display."
[inline:43_force_display.jpg=center,set each overlay to force display]
Once the track containing all of the menus has been multiplexed with DVDSP 3, it's ready to be imported into the VMG with DVDAfterEdit's "Replace Menu VOB" command. To do this, open the desired VIDEO_TS folder in DVDAfterEdit and click on "VMG Menus" in the left pane. Then in the "File" menu select "Replace Menu VOB." Once the VOB containing the menus has been selected, DVDAfterEdit will import the VOB into the VMG. Note that since these menus were created in a DVDSP track, the file is labeled as VTS_XX_1.VOB, not VTS_XX_0.VOB. For more detail regarding this procedure, please refer to Simple DVD Spec. Re-Authoring... Part 2 and/or Advanced Techniques - Manipulating Menus.
In this example, revealing the VMG PGC's shows a single PGC with fourteen programs - one for each menu "chapter" listed above. These various menu chapters need to be organized into separate PGC's, each with their own command areas. This DVD requires three Dummy PGC's (1, 9, & 10) and seven Program PGC's (2 - 8). Since these PGC's are connected via Link Commands (i.e. all in the same domain), their respective PGC numbers probably do not make much difference because the physical location of each Cell remains the same in the VOB. The most important thing is the use of adjacent Cells for transitions into menus. Below is how the PGC's were created for this project:
Now we need to adjust the program PGC's so they contain the desired menus. For this, we use DVDAfterEdit's powerful Program Chain Program Map Interface:
[inline:43_program_chain_program_map_interface.jpg=center,Program Chain Program Map Interface]
The left side displays the Cell(s) present in the selected PGC; the right side displays all of the available Cell(s) in the VOB. Adjusting which Cell goes where is as simple as drag & drop. In this case, each PGC is only supposed to contain two Cells; so twelve Cells need to be removed from each PGC. Simply select each undesired Cell from the left pane and drag it to the "Available Cells" pane. Here's how the Cells are organized on this disc:
PGC 2: Cell ID 1 (DVD Intro to Main Menu transition) & Cell ID 2 (Main Menu)
PGC 3: Cell ID 3 (Main Menu to Chapter Selection Menu transition) & Cell ID 4 (Chapter Selection Menu)
PGC 4: Cell ID 5 (Main Menu to Audio Selection Menu transition) & Cell ID 6 (Audio Selection Menu)
PGC 5: Cell ID 7 (Main Menu to Subtitle Selection Menu transition) & Cell ID 8 (Subtitle Selection Menu)
PGC 6: Cell ID 9 (Chapter Selection Menu to Main Menu transition) & Cell ID 10 (Main Menu)
PGC 7: Cell ID 11 (Audio Selection Menu to Main Menu transition) & Cell ID 12 (Main Menu)
PGC 8: Cell ID 13 (Subtitle Selection Menu to Main Menu transition) & Cell ID 14 (Main Menu)
It may seem a little inefficient to remove twelve Cells for each PGC instead of just creating a new PGC and dragging the two required Cells into it. But the key thing to remember is that these Cells will not work correctly if they don't contain audio and subpicture stream information. This original PGC must be duplicated at least once (then the newly created Program PGC further duplicated, etc.) - creating new dummy PGC's will not work. New Program PGC's must be created from Program PGC's, not Dummy PGC's because dummy PGC's do not contain any audio or subpicture stream information. The image below compares Program and Dummy PGC parameters:
[inline:43_comparing_program_dummy_PGC_parameters.jpg=center,comparing Program and Dummy PGC parameters]
There are quite a few important parameters missing from the Dummy PGC. Although Cell ID's can be dragged & dropped in Dummy PGC's, if stream information parameters are not present, the DVD will not function correctly in all players!
The image below shows all of the commands per PGC used for this DVD. Since the image is so large, I recommend printing it on US legal (14") paper using OS X's Preview application (which will do a serviceable job of automatically scaling the image).
[inline:43_all_PGC_commands.jpg=center,all PGC commands]
Why so large? Well, there are a lot of menu PGC's with several buttons each, in addition to a few important dummy PGC's. But most of the "action" takes place in VTS 1, which is the main "show."
GPRM 0: This register is used to keep track of whether a menu transition needs to be played. At each menu, navigation checks to see if this value has been updated. If it has not, the value is updated and the menu transition is played. If it has been updated, navigation skips the menu transition. These are the value assignments:
0 = DVD start
1 = indicates DVD Intro has played/Main Menu status
2 = indicates Chapter Selection Menu transition has played/Chapter Selection Menu status
3 = indicates Audio Selection Menu transition has played/Audio Selection Menu status
4 = indicates Subtitle Selection Menu has played/Subtitle Selection Menu status
The values of 2, 3, and 4 are used in such a way that only a value of 2 could be used instead. The three individual values are used only for organizational purposes.
GPRM 1: SPRM 8/button highlight values are "dumped" here when needed.
GPRM 2: This register is used to store the audio stream values of 0 and 1 for the English and French streams, respectively.
GPRM 3: This register is used to store the values for the subpicture streams. Here are the values used:
0 = DVD start
64 = SPRM 2 value for subpicture stream 0 (English) "on" status
65 = SPRM 2 value for subpicture stream 1 (French) "on" status
62 = SPRM 2 value for all subpicture streams "off" status
The reasons for this will be made clearer later. The DVDSP 3 manual is a good reference for more SPRM and SPRM value information.
Here are explanations for all of the commands, PGC by PGC:
Nothing special here - just insuring that the three GPRM's used for this disc are setup before navigation is directed to VTS 2.
Just following good DVD start up procedure by filling the DVD player's resume buffer with some info. Navigation then jumps to VMG PGC 1.
VTSM 2: Dummy PGC
This is the root menu associated with VTS 2. If for some bizarre reason navigation arrives here it is redirected to VMG PGC 1.
When the title remote key is activated, this is where navigation is directed as this VMG PGC is set as the "entry PGC." Here are the Pre-Commands:
The first two Pre-Commands set GPRM 2 and GPRM 3 with the values reported in SPRM 1 and SPRM 2, respectively. This is done to determine how the audio and subpicture stream were last set in VTS 1. Whether the streams were set from a sub-menu or the user changed streams while playing the show, the DVD player will act accordingly.
Pre-Commands:
These Pre-Commands are designed to determine if the DVD Intro was played (Cell 1). If it wasn't played, then GPRM 0 is set to a value of 1 because it is about to be played. If it has played, then GPRM 0 is reset to a value of 1 (as it may be a value of 1 or 2 at this point) and navigation links to Cell 2, therefore skipping Cell 1 (which is the DVD Intro).
Cell-Commands:
This Cell-Command is present for all menu PGC's (they all loop) and will not be mentioned for future PGC's.
Button-Commands:
Pre-Commands:
This is the same programming strategy used in the project featured in Simple DVD Spec. Re-Authoring... Part 2 article, with the addition of commands that determine if the menu transition needs to be played. There are only three ways to arrive at this menu; the most obvious of which is from the Main Menu. It can also be reached from either end of show or via the activation of the remote menu key while the show was being played (as long as it was navigated to from the Chapter Selection Menu). While we want to see the transition from the Main Menu, we don't want to see it if after exiting the show.
Button Commands:
Unlike previous projects, all buttons that seemingly connect to a specific chapter actually use the same command: Jump TT 1. This is because the Chapter Selection Menu now resides in the VMG (remember, it's part of the VMG VOB!), and is not permitted to directly target PTT's by the DVD Specification. You may be wondering, "So if the chapter buttons all use the same command, how can specific chapters be targeted?" Well, what value is unique to each button? If you are not sure, feel free to take another look at VTS 1 in the diagram above - this will be explained more clearly a little later.
Last but not least, button 5 sets button 2 to highlight, then instructs navigation to link to PGC 6 - which contains the Main Menu preceded by the outro transition.
Pre-Commands:
These Pre-Commands are used to determine if the transition needs to be played, and if it does, which button should be highlighted upon arrival at the Audio Selection Menu.
Button Commands:
Pre-Commands:
Just like in PGC 4, these Pre-Commands are used to determine if the transition needs to be played, and if it does, which button should be highlighted upon arrival at the Subtitle Selection Menu.
Button Commands:
These three Main Menus are almost identical, except they use different Cell ID's. These PGC's have a single Pre-Command that sets GPRM 0 to a value of 1. The other Pre-Commands used in PGC 2 Main Menu are not used here because PGC's 6, 7, and 8 are only used when navigation returns from a sub-menu. So if the show is playing and reaches end of show or the title or menu remote keys are activated, navigation will not be directed to any of these PGC's - therefore the additional Pre-Commands are not needed. The Button Commands are the same as those found in PGC 2.
This PGC is accessed if buttons 1 or 2 are activated from the Audio Selection Menu. The Pre-Commands first determine which button brought navigation to this PGC, then set the appropriate GPRM 2 value. Once GPRM 2 is set, button 3 is set to highlight and navigation returns to the Audio Selection Menu. Notice that no "Set Stream" Commands are used here - that's because they can't be used. Set Stream Commands that target a VTS can only be used in the VTS and VTSM domains, not the VMG domain. Since these menus are in the VMG, GPRM 2 values are set and will be referenced only when needed by VTS 1 in order to determine which audio stream to play. This strategy also makes it easy to add additional streams or add additional multistream VTS's in a modular way. It also makes the setting of button highlights that reflect the current stream status easy as well. In addition, notice how the Button Commands leave PGC 4, perform some operations at this Dummy PGC, and return to PGC 4. This is done for compatibility, as there are DVD players that crash if button navigation does not ultimately leave the PGC. In this case, since a dummy VMG PGC is used, navigation does what it has to do quickly and safely - no domain or VTS jumps of any kind.
This PGC works in exactly the same way as PGC 9, except its used to set subtitle values. Notice how Pre-Command line 8 sets GPRM 3 to a value of 62. Technically, this would indicate that all subpictures are set to "off" status, but a GPRM is being set, not a SPRM. As you will soon see, however, GPRM 3 set to a value of 62 is of little importance other than the fact that it is not a value of 64 or 65. The value of 62 was only chosen so it would be consistent with its ultimate function to change all subtitle streams to "off" status.
This PGC is the root menu of VTS 1 and is only used to direct navigation if the menu remote key is activated during the show. Just like VMG PGC 1, which is also a Dummy PGC, the first two Pre-Commands set GPRM 2 and GPRM 3 with the values reported in SPRM 1 and SPRM 2, respectively. This is done to determine how the audio and subpicture streams were last set in VTS 1. The remaining Pre-Commands are used to determine where to direct navigation. If navigation originated from the Main Menu, button 1 is set to highlight and is sent to PGC 2. Likewise, if navigation originated from the Chapter Selection Menu, it is directed back to PGC 3.
Here's where all of the DVD Spec. magic happens: audio and subpicture streams get set and navigation determines which chapter to play. I've separated the Pre-Commands into three sections:
In section 1, the DVD player sets the audio stream according to the value of GPRM 2, and then skips to section 2. Since audio streams are always "on," the SPRM 1 and GPRM 2 values directly correspond. A SPRM 1 value of 0 is equal to audio stream 0, which is the first stream. Subpicture streams are a little different...
While the setting of subpicture streams in section 2 is very similar to the setting of audio streams in section 1, there is a crucial difference. Subpicture streams have both an "on" and an "off" status. A SPRM 2 value of 0 means that subpicture stream 0 is off, while a SPRM 2 value of 64 means that stream 0 is on. A SPRM 2 value of 1 means that subpicture stream 1 is off, while a value of 65 means it's set on. When activating the "None" button on the Subtitle Selection Menu, navigation is sent to PGC 10, where a value of 62 is set in GPRM 3. When navigation enters section 2 of the VTS 1 Pre-Commands, the GPRM 3 value of 62 actually turns subpicture streams 0 and 1 off because it is not a value of 64 or 65. This value was selected only for convenience; it does not have any other function in this instance.
The Pre-Commands in section 3 check to see if navigation originated from either the Main Menu or the Chapter Selection Menu. If navigation came from the Main Menu, then the DVD player is instructed to immediately link to PG 1, which starts the show. If navigation originated from the Chapter Selection Menu, the DVD player checks to see which button was activated in order to determine which chapter to play.
Another added benefit of this programming strategy is that the show will always start from the beginning when the "Play Movie" button on the Main Menu is activated. Most DVD's I've encountered (including some of mine!) seem to have only the show's respective VTS the target of the "Play Movie" button, so if any part of the target VTS was played then exited before end of show, the play button acts as a resume. Though the play button is not programmed as a resume button, the DVD player references its resume buffer before proceeding to play the show. In the case of this Liquid Lifestyles disc, since specific instructions as to which PG should be played are provided for the player, whatever is stored in the resume buffer in regards to the target VTS is irrelevant. This does not mean, however, that if resume functionality is desired it could not be implemented... but that's another article...
Hopefully I've been successful in explaining how this DVD is programmed and why. Although there's a good amount going on here, there really is no single complex element - just a bunch of little bits brought together. When planning to re-author with DVDAfterEdit, I first figure out the PGC layout. I default to putting menus in the VMG, but that may not be the best solution for every disc. Maybe a combination of VMG and VTSM menus will provide the fastest navigation and most simple programming. Then, I look at what types of functionality are required and break everything down into individual "modules." So for example, taking care of the button highlights is one module or function, and dealing with chapter menu navigation is another. I work with each section of the DVD in DVDAfterEdit until the programming is assembled, and then look to see if there is a better way to integrate these modules in order to improve the whole.
The less time spent clicking things in abstraction-layer applications can translate into more time for authoring at the DVD Specification level - which directly translates into more efficient and less complicated programming - which directly relates to better, more responsive and compatible DVD's - which directly relates to happy customers and end users - which directly relates back to the DVD author!