This article describes a technique using DVDAfterEdit which will enable you to make DVD Studio Pro ( or any other authoring application ) "talk" to DVDAfterEdit, after the disc has been built. It was written several years ago, before DVD Studio Pro offered the possibility to skip past motion-menu transitions. I developed the technique for my own use to do exactly that, and wrote this article illustrating the technique. It must have been a popular request, because six months later Apple added the feature to DVDSP !
So, the article is a little out of date, but the method is still a very powerful technique with all kinds of possible uses, allowing you to pass variables from inside the authoring application, down to spec-level commands in 'Edit, and back again. There is lots of information here for people who are new to the ideas of "spec commands", the "abstraction layer" and to DVDAfterEdit in general, so I hope you will still find what follows useful and interesting.
As DVD Authoring applications become more and more sophisticated, offering more and more clever features in ever more easy-to-use ways, the line between "Pro" and "Non-Pro" authoring applications is becoming more and more blurred. Traditionally, the "Pro" apps allow nearly unlimited control of the DVD at it's lowest level, meaning the author can do almost anything the format allows. However this usually also means the author needs a detailed understanding of the specification itself, and this is often far from user-friendly.
At the other end of the scale, "abstraction layer" (AL) systems like DVD Maestro and DVDSP hide most of this detail from the user, and have a correspondingly shallower learning curve. However their capabilities are often somewhat limited as a result, since if the writers of the AL authoring app didn't specifically decide to make it easy for you, it may be very difficult, if not impossible, to do it at all!
DVDAfterEdit's great strength is in offering spec-level control to everyone, including users of these AL programs. Even, at one extreme, allowing us to "nuke" all the abstraction-layer commands, and build up the functionality of the DVD from scratch at the spec-command level.
If you're like me, though, this isn't always what you want. Here I'm going to introduce a new technique which bridges the gap between the two extremes of either spec-level detail or easier-to-use-but-more-restrictive AL techniques. So we can take advantage of the ease-of-use and speed of implementation of the AL authoring apps, and add the high-power DVD spec commands where necessary.
The basic idea is very simple. It makes use of the fact that the "variables" we use when creating "scripts" in an AL authoring application like DVDSP are actually GPRMs - "general parameters" - ie. memory locations where we can store numbers of our choice - for example, to remember the user's answers in a quiz, say.
In DVDAfterEdit they are referred to as "registers", numbered r0 to r15. Apple have used r0 to r7 for DVDSP's abstraction-layer, but the others are available for us to use in any way we like. Incidentally, for some reason, DVDSP2 allows us to use registers r8 to r15, but calls them GPRM 0 to 7. So, GPRM 0 is r8, GPRM 1 is r9, and so on. Other applications like Scenarist correctly call r0 GPRM 0, r1 GPRM 1 and so on.
The DVD-spec commands visible in DVDAfterEdit are of course just as capable of testing and setting these variables as the scripts in DVDSP. Knowing this, all we do is set a GPRM in DVDSP to a special "code" values of our choice - "1", say, for simplicity - build the project, test that GPRM in DVDAfterEdit, and depending on the result of the test, carry out another command. The variable is set in DVDSP's script, and then "passed" over to the spec-level commands in DVDAfterEdit. Which, in theory, could change that same GPRM, or any other, and pass it back to the abstraction-layer scripting again! But more of that later. Let's look at a specific example of this idea in use, which is probably the best way to understand it. I'll assume you're using DVDSP2, but the same principles can be applied to any AL-based authoring application.
One of the key elements of a high-end "Pro" DVD is the quality of design of the menus and interface, and one feature that never fails to impress is a slick introduction to the disc perhaps the main menu "builds up" from different pieces in a clever animated sequence, or the menu buttons "fly in" from different areas of the screen.
This kind of effect is achieved by having a short section of video just for the menu introduction, which is known as a "Menu Transition". Having these in key areas of the disc can make all the difference between a "so-so" presentation and a really pleasing design. However, implementing these kinds of features needs a little more time and effort than straightforward motion menus.
Lets say you've designed a main menu with simple overlays, and an introduction sequence, for example if your buttons "fly in" from somewhere off the screen as part of your menu transition, there are several factors which are important:
Luckily, DVDSP2 allows us to solve Problem 1 using one of it's new features - menu Loop Points. Provided none of the buttons in a menu use any of DVDSP2's fancy new features (drop zones, shapes, text, assets), you can easily set a loop point in the General tab of the menu's Property Inspector. This has 2 functions - first, when the menu has played to the end, it will loop back to the loop point, not the beginning; and second, the buttons and their overlays only become visible once the loop point is reached, which is exactly what we want. When the menu intro has finished and the buttons have settled into their final positions, the overlays appear and the buttons become active, and when the menu reaches the end, it loops back to this point, rather than play the intro again (Incidentally, when you're designing a menu to work in this way, you'll want to make sure the last frame of the video matches the first frame of the loop point; so that when the loop happens, all the user sees is a brief pause. In the same way, it's best to have the audio fade down by the time the loop point is reached, otherwise when the menu loops it will "jump in" and spoil the slick effect).
So far so good - this is all something that DVDSP 1.5x couldn't do without using tracks as menus (See below). However, Problem 2 still stands. We don't necessarily want the menu's intro to play every time the menu is accessed, especially if it's the main intro to the whole disc. There are several ways this could be solved within DVDSP, but none of them are ideal. They are:
These may seem like small problems, but it's the sum total of many small but significant points like this that make a truly excellent DVD design.
Firstly, it's worth looking at how DVDSP2 sets up looping menus. We'll use this information to skip the transitions using DVDAfterEdit.
When a menu is built, it becomes a PGC (Program Chain), just like almost everything else on a DVD. More specifically, it becomes a Video Title Set Menu PGC, or VTSM PGC.
Set up a test project in DVDSP2 with a looping menu, and build it somewhere, so we can take a look at this.
[inline:101_set_gprm7_dvde2.jpg=center,DVD Studio Pro project as seen in DVDAfterEdit]
If you open up the project's VIDEO_TS folder using DVDAfterEdit, and unfold the arrow for the VTSMs, you'll see the DVD's VTSM Title Sets. All 4:3 aspect menus are in VTSM #1 (in DVDSP projects for a 4:3 DVD). Unfold it's arrow and the one for "English" and you'll see all the 4:3 menus for your DVD, plus some "dummy" PGCs which are put there by the abstraction layer programming. You can use DVDAfterEdit's Preview feature to figure out which menu is the one you're interested in - it'll be one of the ones with an arrow next to it. If you unfold it's arrow, you'll notice it has 2 "cells", PG 1 and PG 2.
A cell is essentially a subdivision of a video stream. There are different types of cells - chapter markers are special kinds of cells used for navigation. If you unfold the arrows for any VTS (track) in your project, you'll see the Chapters (Parts of Titles, or PTTs) are all cells. Any marker set in DVDSP2 where you un-tick the chapter box in the property inspector will show up as a cell but not as a chapter. So cells don't have to be chapters; they have other useful properties - they can have Cell Commands attached to them, for example.
Anyway, a looping menu from DVDSP2 will have 2 cells, one at the start, and one at the exact point where you set up the loop point back in DVDSP. This is the one we're going to jump directly to later, in order to skip the menu's intro. If you unfold the arrows down to the nav-pack level, you can even see that the nav-packs in PG 1 don't have button commands, whereas those in PG 2 do (assuming you've made some!), because as we saw earlier, the buttons aren't active until the loop point (PG 2) is reached.
The other thing to notice at this stage is the menu's Pre-Commands. If you select the VTSM PGC of any menu in the left-hand pane of DVDAfterEdit, in the right pane you'll see a section marked Pre-Commands and Post-Commands. These are the DVD-spec level commands which are executed before (Pre) and after (Post) each PGC is played. This is where we're going to put the command to skip past the cell containing the menu's introduction.
So, now we can look at the nitty-gritty of the method.
As we saw in the introduction, the idea is that if we want menu intros to be skipped after accessing a certain part of the disc, we set a particular GRPM of our choice to a certain "code" value using a script in DVDSP 2. Then, after building the project, we use DVDAfterEdit to test the value of this GPRM in the menu's Pre-Commands.
If the GPRM we choose has it's special value, the script will cause navigation to jump straight to the second cell of the menu, skipping the one with the intro sequence in it. If the GRPM doesn't have the value you've chosen, the intro will play as usual. I've chosen to set GRPM 7 = 1 as my special code for "yes, I want the intro to be skipped", but you could use any GPRM and value you like, provided you remember what it is.
So, in our example, we have a main menu with quite a long intro sequence to the whole disc, with the buttons eventually flying in to their final positions, at which point (the second cell, where you set the loop point in DVDSP2) the overlays appear. If the user chooses to play the "Main Feature" from this menu, but then uses the menu remote key to get back to the main menu again, we don't want them to have to sit through the whole intro again.
Stage one is to set up a script which will set our "code" variable - GPRM 7 = 1, or whatever you've chosen. I suggest you have just one script, and set it up as the Pre-Script for any menu or tracks where you want the menu intro to be skipped after they've played.
[inline:101_dvdsp_prescript.jpg=center,Set GPRM command]
So in DVDSP2, create a new script, name it "Menu Intro Skip" or something similar, and add just one command: 1 mov GPRM 7, 1 - which just sets GPRM to 1.
[inline:101_dvdsp_project.jpg=center,DVD-Studio Pro Prescript]
Now if you select any track, you'll see in the General tab of the Property Inspector that you can choose a Pre-Script in the Playback Options section. And all you have to do is choose your new script in the drop-down box.
Now, whenever the track in question is played, the Pre-Script we've chosen will be executed before it starts, and GPRM 7 will be set to "1". Then when we test GPRM 7 in the menu's Pre-Commands in DVDAfterEdit, the commands we add will ensure that because GPRM 7 equals "1", the menu intro will be skipped. If the user chooses to play a track where you haven't got your "Menu Intro Skip" script setup as it's Pre-Script, GPRM 7 won't be set to "1", and no commands are added in DVDAfterEdit, and the intro won't get skipped.
And that's it - in DVDSP 2 at least. Currently, the project isn't going to work as we want, because we haven't set up the code in DVDAfterEdit, but the ground-work is done.
The next stage is to build your project. And then test the value of SPRM 7 after the build is complete, ie. after it would normally be finished, which is why this technique is like getting messages from "beyond the build file"! So, open your newly built project in DVDAfterEdit, and as we saw earlier, unfold the VTSM arrows (VTSM 1 for 4:3 menus in a 4:3 project, VTSM 2 for 16:9 menus if your project has both) to find the main menu. Don't worry about the abstraction layer's dummy PGCs, just click on the ones with arrows next to them & use the Preview window to find the right one. It's also useful to bear in mind that the menus will be arranged in DVDAfterEdit's Left Pane in the same order as they are in the Contents>Outline window in DVDSP 2.
As we saw before, you'll see two cells in the menu, the first containing the intro, the second containing the looping part. If you select the second cell, the Preview window will display the exact I-frame where you chose your loop-point to be.
All we have to do now is make sure you've selected the VTSM PGC for your menu, so you can see the Pre and Post-Commands (these won't show up if you've selected individual cells or nav-packs):
- and add, at the END of the menu's Pre-commands: if r15 == 1 then Link PG 2
To do this, first select the last Pre-command for the VTSM PGC, in this case #15, and press Apple-K. A new command,16: NOP will appear. Then type if r15 == 1 then Link PG 2 in the command assembler :
Set DVD command
[inline:101_set_gprm_command.jpg=center,Set GPRM 7 in TFDVDEdit-2]
And press Enter.
Remember that for some peculiar reason, what DVDSP2 chooses to call GPRM 7 is actually register number 15, or r15. So we set GPRM 7 in DVDSP2, but now we test r15. If it equals "1", then the command links to PG 2, the second cell in the menu, which only contains the looping part, and the user won't see the intro which is contained in cell 1, assuming you out your loop point in the right place - bingo. Our special code variable has been "passed" to DVDAfterEdit's spec commands from beyond the build file, allowing us to add a function Apple didn't include in DVDSP2. And all with only 2 lines of code!
(We add the command to the END of the Pre-Commands, to make sure that all the others are executed. They have been added by DVDSP's abstraction-layer programming, and if we skip to the next cell before they're been executed, things may not behave as they should.)
Now we can add exactly the same command to the Pre-Commands of any other menus whose intros we also don't want to be played (if r15 = 1) in exactly the same way. If there's a menu where you always want the intro to play, obviously just don't add the command. Finally, in the Post-Commands of this menu PGC, add a new NOP command to the beginning (Select where it says Post-commands, and press Apple-K) and edit it to say Set r15 = 0, Register.
This just keeps things tidy, clearing GPRM 7 so that if the user navigates to another menu, it's intro won't be skipped. (Unless we want it to, in which case we would use set our "Menu Intro Skip" script as a Pre-Script again.)
So, just to re-cap, the Pre-Command for the looping menu checks whether r15 (GPRM 7) is set to 1. If it is, the command links to the second Cell of the menu, skipping the intro. If it isn't the menu plays normally. Either way, r15 (GPRM 7) gets reset to "0" afterwards.
Now, when designing the project in DVDSP 2, all we need to do is choose our "Menu Intro Skip" script as the Pre-Script of any track or menu whenever we want subsequent menu intros to be skipped, and keep an eye out for other places where this value needs to be manually reset. For example, if the end of the track is reached without the user pressing the remote menu key, and navigation then jumps to an "Extras" Menu, which itself has an intro which is set up to be skipped in some cases, but in this case we want the intro to be played; then we should add a script to the end of the track in DVDSP 2, to reset GPRM 7 to "0".
All of which will take some planning for very large projects! But hopefully you will have clever ideas about how to improve the method. One possibility is to have different "code" values for different menus, so if GPRM 7 = 1, the Main Menu (but no other) skips it's intro, if it's set to 2, the Main Menu Intro plays normally but the Bonus Features Menu skips it's intro... you get the idea.
We've seen how DVDAfterEdit can share registers r8-r15 with DVDSP2, where they're known as GPRMs 0 to 7, allowing us to "pass" commands across from the abstraction layer to PGC Pre and Post-Commands. If a GPRM is set to a certain value in DVDSP2, then we can execute a DVD-spec command in DVDAfterEdit, enabling functionality which otherwise wouldn't be available to us.
In our example, that was skipping directly to a later cell in a looping motion menu, but there's no limit in theory to what these commands might be - how about inserting a new piece of footage into the middle of a menu sequence, by jumping directly from the middle of one menu to another, say?
Or, while typing this article for the site, it's occured to me that it may well be possible to solve the intro-skip problem in another way - make all our menus tracks, as in Method C back towards the beginning of this article, with scripts storing button selections in GPRMs, and then using Pre and Post-Commands in DVDAfterEdit to ensure the right buttons are selected, even with buttons-on-video in tracks... I'll get back to you if it looks useful.
The only limit is our ability to come up with new ideas. I'm looking forward to everyone else's ideas on how to expand this!
Good luck,
Ian