Click Here
INSIDER SECRETS: Digital video hacks
Insider Secrets
More Insider Secrets 
Digital video hacks
 Tip 2: Alternate endings based on the time of day
Submitted by:
Joshua Paul
Author, Digital Video Hacks
Alternate endings based on the time of day
Rate this tip
How useful was this tip for you?
 Very
 Somewhat
 Not at all
An alternate ending is merely a different ending to a movie, as opposed to the one shown in the official release. Using some of the hidden features in QuickTime, available through Totally Hip's LiveStage Pro, you can provide an alternate ending to your movie based on the time the viewer is watching it.

You might remember the Choose Your Own Adventure books where, at the end of a chapter, you were able to choose one of a handful of options. Based on your choice, you would then jump to a specific page in the book, where the story would resume. The story would unfold based on the choices you made, and you could read the book many times over, each time with a different outcome.

Reading is an easily adaptable medium for interaction, but video is not. People watch video passively; otherwise, they play video games, which are interactive. So, how can we adapt the passive medium of video to something that is interactive? One way is through time; depending on the time the video is watched, certain scenes will present themselves.

Using Totally Hip's LiveStage Pro, you'll be able to create movies that can alternate scenes based on the time of day.

Plan for passive interaction
The first step in creating a passive-interactive video is to plan ahead. Just like the Choose Your Own Adventure books, you will need to plan for the occurrences you want to present and shoot the appropriate scenes. For simplicity, you should start with only one alternate ending, which means you need to shoot a total of two endings. As you get used to this type of video, you can create as complex a movie as you like.

You will not want to add the interactivity until after you have completed editing your movie. Upon completion, you should output three digital movies:

  • The entire movie, minus the ending
  • The original ending
  • The alternate ending

You will compile these movies into one final movie for distribution.

Create your project
Start a new project in LiveStage Pro and choose Edit > Document Settings to change some of the properties of the movie. Under the Playback tab, change the Transport > Controller pop-up to Standard Movie. This will place the familiar time indicator at the bottom of the movie, along with a Play/Pause button and volume controls.

Under the Settings tab, change the width and height of the movie to 720 and to 480, respectively (720x576 for PAL).

If you would like to annotate your movie--with your name, some comments, or disclaimers, for example--you can do so under the Annotations tab.

Import your movie
Locate your completed movie on the hard drive and drag it onto the LiveStage Pro timeline. The video and audio tracks will be separated out and labeled Video 1 and Sound 1, respectively. You can change their labels by double-clicking the label on the left side of the window. This will open a window, allowing you to change the name of the track, the height and width, and a whole bunch of other details (which do not pertain to this hack).

Add the endings. In order to make the alternate ending work, you obviously need the two endings to become a part of the final movie. Locate the original ending and drag it to the timeline. Then, change the name of the video track to OriginalV and the audio track to OriginalA. Repeat the process with the second alternate ending, but change the tracks to AlternateV and AlternateA.

The naming of the tracks is important, because that is how your movie will identify which track to play.

You will most likely notice that your movies are all stacked on top of each other. If you were to play your movie right now, all of the audio tracks would mix together and only the top-layer video track would be visible. That's not what you want, so you need to move the two endings to the end of your movie.

Move the endings. To move the endings to the end of the movie, enable the Track Manipulation Tool by clicking the bottom icon on the left side of the timeline. Once you've enabled the tool, your tracks will turn a silver-gray. You can then click on the video and audio tracks and drag them individually to the end of the movie. If you move slowly near the end of the movie, the tracks should snap into place.

The figure below shows the Track Manipulation Tool as enabled and the alternate endings lined up.


Move the tracks with the Track Manipulation Tool.
Click to enlarge
If you want to make sure your movies have lined up correctly, you can zoom into the timeline (just as in most video-editing programs) using the Zoom Slider at the bottom left of the window or by using the keyboard shortcuts to zoom in ([) or zoom out (]). After placing your endings, click the Selection Tool, which is the arrow button at the top left of the timeline.

Enable passive interaction. OK, you have everything lined up. So, how do you make the movie "know" what time it is and which track to play? You can either use a Sprite Track or a Text Track. Both track types will accomplish the same goal, but I like the Text Track for this task.

To add a Text Track, select Movie > Create Track > Text. You will then have a new track at the top of your timeline. If you cannot see the green-colored track, move to the start of your timeline. You should double-click the green track, which will open the track editor.

Under Track Events, on the bottom left of the window, you will see a list of events what can occur. Click the Frame Loaded event and type the following script:

if (LocalHours > 17)
TrackNamed("OriginalA").SetEnabled(True)
TrackNamed("OriginalV").SetEnabled(True)
TrackNamed("AlternateA").SetEnabled(False)
TrackNamed("AlternateV").SetEnabled(False)
else
TrackNamed("OriginalA").SetEnabled(False)
TrackNamed("OriginalV").SetEnabled(False)
TrackNamed("AlternateA").SetEnabled(True)
TrackNamed("AlternateV").SetEnabled(True)
Endif

The first line checks to see if the local time of the computer is earlier than 5 p.m., or 17 military time (I know, I know, 1700--go with the flow). If the time is earlier than 5 p.m., then the original ending is shown. Otherwise, the second, alternate ending is shown.

If you don't want the big white box placed by the text track to show, simply click the track name (most likely "Text1") and drag it down, below your video tracks. You can also select the Properties tab and enable Keyed Text. If, on the other hand, you want to get creative and add some text, go right ahead. Just make sure you change the duration of the text if you do add some.

Compile your movie
Now that you've assembled all of the pieces together, you can compile everything into the completed movie. To export your movie, choose File > Export > QuickTime Movie and type the name of the movie. The process might take a while, depending on the length of your movie. That's it. You're done.


Submitted by:
Joshua Paul
Author, Digital Video Hacks
Joshua Paul discovered his passion for computers at the age of 11, when he began programming an Apple computer. He is a television producer who has produced prime-time specials for Fox Television, presentations for various studios, and independent movies. Using his experience in entertainment and technology, he recently invented a system for creating video presentations that adapt to user input. He is obsessed with fantasy football and spends his Sundays during the NFL season yelling at the television screen.

Digital Video Hacks This material has been adapted from Digital Video Hacks by Joshua Paul, published by O'Reilly Media. Copyright O'Reilly Media, 2004. All rights reserved. O'Reilly makes no representation as to the accuracy of the materials provided by them. To purchase this or other O'Reilly publications, click here.
MORE INSIDER SECRETS
CNET shows you three easy ways to capture and save video from the Internet.
You can double or triple the amount of space on your laptop.
Check out our tips to making video work on your iPod, Creative Zen Vision, or Archos video player.
Use these tips to fine-tune your searches, personalize the Web, and pit Yahoo against Google.
Turn your tablet into the ultimate productivity tool with some free software and these tips.
Whether you're playing as a Good god or an Evil god, we have three tips that'll help you rack up the points.