By now, if you have been keeping up with the latest Director buzz, you are aware that Director MX 2004 now supports the popular DVD-Video format. That’s great, you think, but you also wonder how it might affect the rest of your life. In this introductory article, I’ll discuss the value of DVD-Video playback inside Director and you will make a small sample application using a pre-built DVD controller.
To complete this tutorial you will need to install the following software and files:
Someone a whole lot smarter than me once said that if you understand the why in life, you could overcome any how. In that spirit, I’ll start by discussing why the inclusion of DVD movies into Director projects has so much potential, then I’ll focus on a few of the basics of how you do it.
Over the years, Director has evolved to add support for a number of emerging video standards. Rather than supporting a select few formats, Director has adopted all the top video technologies, including Quicktime, Real, and Windows Media. With the inclusion of DVD-Video in Director MX 2004, what is arguably the most widely adopted distributable video format of all time meets the most-adopted professional multimedia authoring tool of all time.
At first glance, the two don’t seem like a natural fit. After all, DVD-Video is already a highly interactive video format. Many of the features found in Director, such as creating menus, buttons, subtitles and alternate audio streams are already self-contained inside the DVD video specification. Once could even argue that Director and DVD-Video offer similar, overlapping functionality. A closer look, however, reveals some very compelling reasons to marry the two technologies.
DVD-Video is a dual-use media. Using the established rules of the DVD-Video standard, movies play consistently across a wide range of consumer electronic players, from the $29 cheapies to the high-end multifunction recorders. These disks can also be played on personal computers, and that’s where things get really interesting. While software DVD players have many of the same playback functions as their hardware counterparts, they aren’t necessarily limited by the same rules. Software DVD players can provide a programmatic level of navigation and control that set-top boxes simply cannot achieve with a remote control. You want to go to an exact time in a movie? No problem, just enter the time code and you can go directly to that scene. Perhaps you want to play just a particular scene, say from one section of the movie to another. With a set-top player, you have to navigate to that scene, and then stop the player when that scene is done. Some of you can already see where I am going with this. Now lets say you want to play just your favorite scenes in one swoop, with your bucket of popcorn. This isn’t really practical with a set-top player, but it’s easy with a PC’s software DVD player.
The trick to all this additional functionality is that most software players have an application framework that other software, such as Director MX 2004, can use to gain programmatic control over DVD playback. On Windows, there are many different software DVD players, but most support a unified playback standard called DirectShow, part of DirectX 8 and later. On Mac OS X, there is just one software DVD player, and the Panther version (the one found in 10.3) supports external control. Director MX 2004 talks to both platforms and is able to embed, control and play back DVD movies under a unified programming interface.
So, what initially appeared to be overlapping functionality has now opened the door for exciting new possibilities. On a single disk, you can have the benefit of set-top box content, along with the ability to incorporate the DVD video stream into PCs in ways hardware players can never accomplish.
Some of you are already imagining the new possibilities. Let me open the door to some more possibilities. Let’s say you distribute a DVD movie with a link to your website. Using Shockwave Player 10, you can embed DVD playback right inside the user’s browser when they go to your site. What’s so interesting about that? Tons. For example, you can trigger events to occur in conjunction with the playback of the movie. Say you were watching a movie that featured a fancy new sports car. When this happens in a theater, we usually scratch our heads and have to do a little research to find out what kind of car it was. With web-enabled DVD playback, you can fire a URL into a targeted frame right when the car appears to let everyone know that it’s the hot new car from Trio Motors--a fictional company. You can also use this feature to trigger the release of contextually based content that is synchronized with the movie. What other movies was that actor in? Where was that scene shot? Where can I find more information about this movie? This type of interactivity is possible with the new DVD capabilities inside Director MX 2004. Remember the usage scenario where you can combine a series of scenes together in a virtual playlist? That can be accomplished with a single button click, and a fairly small amount of Director code. Hollywood studios have been using specialized software to deliver this type of functionality to Windows users for years. With Director MX 2004, this type of functionality is now only affordable and mainstream, but also cross-platform.
Using DVD-Video inside Director MX 2004 is quite a bit different from using other video formats. For one thing, when you create a DVD cast member, you aren’t pointing to a single file that contains your video content, as you would with QuickTime. What you are creating is a reference to a group of files located on fixed media. There are also huge differences between how DVDs are organized, compared to say a QuickTime file. Knowing these differences is important when creating scripts to control the DVD movie, so perhaps a brief primer on the DVD video standard is in order.
DVD movies are organized into title sets, hence the term video_ts that describes the name of the folder all DVDs use to store their asset files. A video title set can contain up to 99 titles, and a title is a block of MPEG2 video, multiplexed with either MPEG audio, or Dolby AC3 audio. Titles can contain up to 99 chapter markers, which are predetermined frames of video that users can jump to. DVD movies can also contain up to 9 video angles, 32 subtitle tracks, and 8 audio tracks per title.
The organization of DVD video is important because there can be great differences between how one disk is authored compared to another. Most studio titles are called title one disks, where the entire feature is located in Title 1. Other titles, such as educational disks, may have their content spread throughout a number of different titles. Knowing how your title is a very important first step before you start embedding DVD video into Director MX 2004 projects.
One of the first things you may notice when you create DVD cast members is that they are significantly different from other digital video cast members you may have used in the past. First, a DVD cast member is a pointer to a DVD video title set, or a video_ts directory. Normally, this is on the root level of your DVD-ROM drive, but it can also be customized to any location on your hard drive.
Another major difference that separates DVD cast members from other, more traditional digital video cast members is the way that Director plays them back. Director’s DVD framework is dependent on a number of different variables. Let’s look at the Windows platform first. On Windows, both the authoring and client machines must be capable of running DirectX 8 or higher, and must have a DirectShow-compatible software DVD player. When you buy a new PC with a DVD-ROM drive, it generally includes a software DVD player that is compatible with Microsoft’s DirectShow framework. Microsoft developed DirectShow in the late 1990s as a centralized command language to talk to various software DVD players. Over the years, the number of software DVD player manufacturers has been consolidated, and the overall support for DirectShow across all DVD-capable Windows PCs has been very high. The downside to this model is that if your client has one of the few machines that does not have a DirectShow compatible player, they will have to purchase one. The distribution of software DVD players, unlike technologies such as QuickTime, Windows Media, or Real, triggers the payment of certain royalties to various companies holding DVD-related patents. For this reason, a freely distributable software DVD player is unrealistic. Fortunately, however, this case is quite small.
On the Macintosh side, the story is a bit simpler. Apple’s DVD Player is the only one on the market, and it offers its own external framework, similar to DirectShow. This framework was exposed in Mac OS 10.3, also known as Panther. The authoring and end user requirements for DVD playback in Director is the user must be running Panther, and their machine must have a DVD-ROM drive supplied by Apple. The reason for this last requirement goes back to the royalty structure for playing back DVD-Video. Apple pays the royalty based on the number of DVD-ROM drives it ships, and the Apple DVD player performs this check when the application is launched. Users with aftermarket DVD-ROM drives will experience problems with DVD playback. Fortunately, however, this number is very small, since it has been years since Apple has shipped a machine without DVD playback capabilities.
By now, you might be convinced that DVD-Video playback inside Director is a really cool concept, with many possibilities. Let’s create a small, sinple Director project that contains a DVD movie with a fully functional DVD controller. This will give you a good feel for how Director handles this format.
Before we start, pop your favorite DVD into your PC's DVD-ROM drive. You will be using it in your project. Before you start the project, there is an important concept to understand when working with DVD video. On both the Macintosh and Windows platforms, only one application may have control of the DVD-Video framework at any given moment. This has to do with anti-piracy measures instituted with all software DVD players. What this means is that if a software DVD player was launched when you inserted the disk in your drive, you must close that application to release its control over the DVD player framework. Conversely, if you instantiate control over the DVD framework from Director, you must release it before another application, such as Shockwave Player, can use it.
That being said, let’s launch Director MX 2004 and start our project.
This project will be relatively simple and by the end you will end up with something you can publish either as a Director projector, or a web-based Shockwave Player project. Start by creating a new project setting the Stage to 720 x 540 pixels. DVD video is typically 720 x 480 and our controller will be up to 80 pixels tall, but can be collapsed to a svelte 40 pixels.
Adding a basic DVD movie to your project is pretty simple. Certain DVD functions, such as fast forward, rewind, going to menus, and other navigation can be scripted into buttons and other UI elements, but why do all that work if you don’t need to? Director MX 2004 ships with a Flash component that contains a fully functional DVD controller. This component is easily customizable; you can integrate it into your project in just a few minutes. Follow these steps to create a new DVD cast member and attach the DVD controller:
Create a new DVD cast member.
Select Insert > Media Element > DVD. This opens up the DVD editor window. If you don’t have a DVD in your drive, or if you don’t have a supported software DVD player, you will get some error messages. Give the cast member the name of DVD and then close the DVD editor window. This will produce a new DVD cast member in the cast window. Drag and drop that cast member onto the stage. With the Sprite tab revealed in the Property inspector, name the sprite DVD.
Drag the DVD Controller component to the stage.
The DVD controller is located in the Library palette. Go to the Library palette and click the Library list pop-up menu and select the Components preset. In the Components view, you will see the DVD Controller component. Drag that component onto the stage, below the DVD sprite.
Set some properties on the controller component.
With the DVD controller sprite selected, click the Sprite tab in the Property inspector. Give the Sprite the name of Controller, and set the ink to transparent. Since the DVD movie is full size, at 720 x 480 pixels, you want to set the width of the DVD controller to 720 as well. Setting the width to 720 in the Sprite tab will lengthen the sprite width, but an additional step is required to get the DVD controller to run all the way along the length of the DVD movie. Click the Flash Component tab of the sprite’s Property inspector. There, you’ll find a field entitled controllerSpriteWidth. Enter 720 into this field. Now the controller should run along the width of the movie. While you are here, click the check box next to the DrawerOpen field. This will reveal some additional features of the controller.
Marry the DVD Controller with the DVD sprite.
In order for the DVD controller to control the DVD movie, they must be linked together. With the DVD controller still selected on stage, click the Flash Component tab of the Property inspector. In the controllerSpriteName field, enter the name Controller. This was the name you gave the DVD controller when you dragged it onstage. Next, go to the dvdSpriteName field, and enter the name DVD. This was the name you gave the DVD sprite when you dropped it on the stage. With these two sprites now bound together, the DVD controller should now be able to receive and respond to events coming from the DVD sprite.
You should now be able to try out the controller. Click the project play button to start the DVD playback. During playback, the DVD controller gets and sends messages to the DVD sprite. Depending on what DVD movie you have in your drive, you should be able to use many of the DVD controller’s buttons, such as changing the angles, audio and subtitles. Back in the Flash Component Property inspector, there are some additional properties you can set for the controller. For example, there are pop-up menus for forwardRate and reverseRate that can set the speed of the fast forward and reverse buttons. When the controller’s left and right buttons are clicked and released, they serve as Previous and Next chapter buttons. When they are clicked and held down, they serve as forward and rewind buttons. Set these rates to 32, and the movies will fly by! Use the forwardButtonDelay and reverseButtonDelay field to set, in milliseconds, the amount of time these buttons should be held down in order for the scan features to be enabled. The default setting is 1000 milliseconds, which should be adequate for most usage.
You can now publish the Director project to either a freestanding executable or web-based Shockwave HTML. In ether case, this project should be able to control and playback any DVD footage.
The inclusion of DVD-Video to the arsenal of file types supported by Director is very exciting indeed. In this article, I covered some background on the DVD-Video format, discussed how Director handles DVD video, and created a sample application with a DVD controller. In future articles, I’ll delve deeper into the DVD playback functionality, and create some more sophisticated interactivity, such as responding to events in DVD playback and using Flash assets to control DVD movies.