DRAFT, January 15, 2003

Clipper QuickTime Movies

In This Tutorial:

·  Real Time Streaming Protocol

·  Compressing Audio and Video Tracks

·  Alternate Data Rate Movies

·  Media Cleaner Pro

With apologies to Apple for absconding with boatloads of their tutorial text, here’s a layman’s intro to making QuickTime movies for Clipper and friends. Now, I’m a novice at this stuff, but maybe, just maybe, I can highlight important aspects of making QuickTime movies suitable for dialup access. Please feel free to critique this, and let me know of any changes, additions, subtractions and stupid errors.

Real Time Streaming Protocol

RTSP[1] may be defined as the transfer of multimedia over a network while it is playing, as opposed to downloading the data and storing it locally before playing it. With HTTP streaming, the movie data (known as a Fast Start, or Progressive Download movie) is sent to your browser as fast as the network connection can handle it. Once enough data has been received, the movie will begin to play. With RTSP streaming, movie data is only sent as needed, so the data rate of your stream has to be smaller than the network's current speed. A movie’s data rate is usually expressed in units of bits/second (b/s), kilo-bits/second (Kb/s), or kilo-bytes/second (KB/s). Later on we’ll see how to take a movie and compress it – lower it’s data rate – so the movie can stream at one or more connection speeds. Connection speeds can vary from a 28,000 to 56,000 b/s dialup line, to a LAN connection here at work running at 10 to 100 million b/s.

Before you can stream an existing QuickTime movie using QuickTime Streaming, you must "hint" it. Hinting involves analyzing the media data within a movie and creating hint tracks that tell the streaming server software how to package the data to send over the network. The hinting process will create a hint track for each media track you wish to stream. The hint tracks are stored within the same movie -- the hinted movie -- as are the original media tracks. Using QuickTime Player's Export feature, we’ll see how to compress and hint your movies, which are then stored on Clipper for streaming.

Exporting a QuickTime Movie – An Overview

QuickTime Player is an example of an application that can compress movies and create hint tracks[2]. Another good choice is Media Cleaner, which we’ll examine later. Begin by opening a movie in QuickTime Player by either dragging the movie onto the application icon or launching QuickTime Player and choosing Open Movie from the File menu. In order to hint the media, select Export from the File menu, which displays the following dialog:

A.Where it says Save exported file as enter a file name with the “.mov” extension. When naming your movies, keep things simple for DOS-land, our lowest common denominator, and limit their names to eight characters, without spaces or special characters.

B.In the Export pop-up, content creators can either select Movie to Hinted Movie or Movie to QuickTime Movie, to prepare their media for streaming. You should select Movie to Hinted Movie when the audio and video content has already been compressed to the desired data rates. Otherwise, select Movie to QuickTime Movie to compress the movie, prior to hinting. When selecting Movie to QuickTime Movie a predetermined set of presets have been defined which are accessible in the Use pop-up menu.

C.Use allows content creators to select from the Default Settings or the Most Recent Settings. Unless you are compressing a movie, the Default Settings are recommended, as QuickTime determines, for example, the appropriate payload and packet size limits for each track type QuickTime can stream. Most Recent Settings uses the last Export settings, and is convenient when you’re compressing multiple movies.

D.The Options button has different settings depending upon whether you selected Movie to Hinted Movie or Movie to QuickTime Movie. With Movie to Hinted Movie, only authors with advanced expertise should change the defaults, as this may cause poor performance and quality of the stream. It’s an entirely different matter when using Movie to QuickTime Movie, because that’s how we compress the audio and video tracks, detailed in the next section, Compressing Audio and Video Tracks. Finally, use Save to create your hinted or compressed movie.

Compressing Audio and Video Tracks

The Clipper movies look like they’re going to be rather simple, with just one audio and one video track. Both tracks must be compressed so that the sum of their data rates doesn’t exceed the desired connection speed. Here’s where it gets tricky, because we can’t tell in advance what type of connection a client may have. So, what data rate do we design for? One solution is Alternate Data Rate Movies, where we have a single reference movie, plus alternate movies of varying data rates. It’s up to the QuickTime client to determine which of the alternate movies will play best, based on client settings such as connection speed. This is cool, because web designers now code but a single URL, rather than a series of URLs for the ADR movies.

For argument’s sake, I know Clipper’s target is a 56 Kb/s dialup line. Realistically, then, let’s assume an average actual connect rate of 37,000 b/s, and apply the “allow 25% for overhead” rule. That means our target data rate is 27,750 b/s – more or less a 28.8 KB/s modem! Here’s how we do it:

First, ensure that Movie to QuickTime Movie is selected in the Export dialog box. Click Options to see the Movie Settings Dialog. Choose the video size and compressor settings in the Video section and the audio compressor settings in the Sound section. Check the Prepare for Internet Streaming box and choose Hinted Streaming from the popup menu.

Click on Settings, which posts the following dialog, select Optimize Hints For Server, and then OK to return to the Movies Settings window.

The next tricky part is selecting exactly which compressor (or codec), for both audio and video, is best suited for the task – and there are scores of choices. What I found worked well was Sorenson Video and Qualcomm PureVoice Audio. Make your selection by clicking on the Settings button. For video, you’ll see this dialog box:

In this example, I’ve selected 12 frames/second and limited the data rate to 2 KB/s. With a video data rate of 20,000 b/s, that leaves around 8,000 b/s for audio. You’ll have to experiment with these settings until you are satisfied with the results – I am not a media author. One thing I do know, though, is as you increased the quality of the video, you’ll have to simultaneously decrease the frame rate. Generally, try for a frame rate of at least 10 f/s. Finally, you can limit the data rate manually, which is what I did.

Similarly, here’s what the audio compression dialog looks like:

Now, once you’ve compressed the movie, select Movie to Hinted Movie in preparation for saving it as a self-contained, hinted, compressed movie. OK out of the stacked dialogs, ensure the movie is named in a friendly DOS 8.3 format, and click Save. QED.

Alternate Data Rate Movies

MakeRefMovie Executive summary as of 2000/11/14:

·  In one folder, create as many alternate movies as required, perhaps a default 14.4, a 56 and, possibly, a LAN version. Hint these movies.

·  Further, take all these hinted alternates and save them yet again as self-contained Fast Start movies – feel free to re-use the same file names.

·  Make the reference movie using MakeRefMovie. Use Movie/Add Movie to add the default movie, and select Flatten Into Output. Use Movie/Add URL to add the RTSP streaming movies – the URL must point to the movie’s location on the server, e.g. rtsp://clipper.lehigh.edu/steve/clip1_56_S.mov.

·  A web page uses an <EMBED> tag specifying the reference movie, served via http, e.g. <p>Let's watch a <EMBED SRC=http://clipper.lehigh.edu/movies/UNeedQT4.qti QTSRC=http://clipper.lehigh.edu/movies/steve/clip1_MSTR.mov WIDTH=480 HEIGHT=280 TYPE="application/x-rtsp"> movie!

·  The SRC attribute should always be what you see - it's a small movie that the plugin unconditionally loads, but is otherwise unneeded. The QTSRC attribute is the HTTP URL of the reference movie, designated by *_MSTR.mov (master, I assume). The WIDTH and HEIGHT attributes are those of the largest movie. Add 16 to the HEIGHT to account for the QuickTime controller widget. (See Steve Lidie for details on other EMBED attributes, like BGCOLOR, so the movie blends with your page.)

ADR Details

Creating ADR movies is a straightforward process. Start by creating a master movie of the highest possible quality. That means the largest frame size, the highest frame rate, and the least compression on audio and video tracks. You’ll be making the alternate movies from this master.

Determine the number of alternate data rate movies you want to create, and the rate for each one. A typical spread for web delivery is one each for 56Kb/s maximum (but usually much lower), DSL/cable (up to about 128 Kb/s), and T1/T3 (up to 1 Mb/s). Here are some guidelines:

Connect Speed / Date Rate / Playback Size (pixels)
28.8/33.6 modem / 20 Kb/s / 80 x 60
56K/ISDN / 40 Kb/s / 120 x 90
112K Dual ISDN / 90 Kb/s / 160 x 120
T1 / 1 Mb/s / 320 x 240
LAN / 100+ Kb/s / 320 x 240

Create the alternate data rate movies from the master using the appropriate image dimensions and codecs. You can do this in QuickTime Player using the Export option in the File menu (discussed previously), or use Media Cleaner Pro[3], which generates all the alternate movies in a batch according to the data rates you specify.

If some of your alternates are streaming movies, make Fast Start movies that point to them, and use the Fast Start movie as the alternate for the stream. To create a Fast Start movie that points to a streaming movie, open the streaming movie in QuickTime Player by choosing Open URL from the File menu and typing in the URL. Then choose Save As from the File menu, name it, and save it as a self-contained movie.

Also create a default movie that anyone in your audience can see, no matter what connection or computer they are using. It could be a few frames from your movie with a low-bandwidth audio track, or a single image with a scrolling text track and no audio, or just a single image. In any case, keep it very small, because the browser will download it even if an alternate movie is used. If you make a movie, use an old codec like Cinepak for backward compatibility. If you use an image, it must be in QuickTime Image Format (QTIF), other image formats are not supported,

Name each movie in a logical way, including the .mov filename suffix. For example, you may want to name your alternate movies altmov01.mov, altmov02.mov, and altmov03.mov. Save as self-contained movies. Store them all in the same folder or directory.

Making a Reference Movie

To complete the ADR setup you need to make a reference movie. You can make a reference movie for Alternate Data Rate movies based on connection speed (or other criteria, for that matter) using an application such as Terran’s Media Cleaner, or the free utility program MakeRefMovie, available from Apple for Mac OS and Win32. The latest version of MakeRefMovie can also create reference movies that choose among alternate movies based on CPU speed, language, or QuickTime version. Once you’ve made the alternate movies, follow these steps in MakeRefMovie.

Open MakeRefMovie.

Save your new document in the same folder or directory where the alternate movies are located. Make sure the reference movie filename contains the .mov extension. This reference movie will call upon the alternates.

Drag each of the alternate movies onto the window of MakeRefMovie. An alternate movie will appear for each file you drag-and-drop. Or you can open each file separately by choosing Add Movie File from the Movie menu. NOTE: for streaming movies only drag (or use Add Movie) for the default movie – use Add URL to add the streaming movies.

Set the minimum connection speed for each alternate movie in the Speed: pop-up menu.

Set the load order of the movies in the Priority pop-up. For example, you may want the reference movie to call the highest quality movie first, then the medium quality movie, and last the lowest-quality or default movie. If there is more than one movie designed for the same connection speed, set a priority for which movie will load first.

Specify the default movie by checking Flatten into output. The default movie should be compressed with a codec supported by older versions of QuickTime for backward compatibility. This checkbox can only be applied to one movie.

Save the reference movie and place it and all the alternate movies in the same directory. Upload the directory or folder to the Clipper server.

If you are putting the movies on a web page, embed the reference movie into the HTML using the <EMBED> tag. The reference movie will load the appropriate alternate based on the viewer’s connection speed.

Embedding QuickTime for Web Delivery

The <EMBED> tag allows media file types other than those directly supported by the browser to be handled with an external application or plugin. In this case, the external application is QuickTime Player and the plugin is the QuickTime Plugin. The list of <EMBED> attributes is long; here we document the <EMBED> attributes specific to QuickTime.

The <EMBED> tag is similar to the <IMG> tag; they both have a SRC, WIDTH and HEIGHT parameter. These parameters are required and tell the browser the media to be displayed and the width and height of the media specified in the SRC attribute. For example:

<embed src="sample.mov" width="320" height="256">

The SRC attribute is the media file to display either by an absolute or relative URL. The HEIGHT attribute specifies the vertical size in pixels of the SRC attribute. The WIDTH attribute specifies its horizontal size. In order for the controller to appear properly, add 16 pixels to the height of a movie. For example, set HEIGHT="256" for a movie 240 pixels high: