QuickTime Streaming Video Tutorial

By Dr. Edgar Huang and Clifford Marsiglio

Indiana University-Purdue University Indianapolis
School of Informatics

In this tutorial, the terms "movie" and "video" are equivalent.

QuickTime Streaming videos can be encoded with the Compressor program that comes along with Apple Final Cut Pro 5, or with Adobe Premiere Pro 2.0 and some other software programs, but the main encoder is QuickTime Pro. QuickTime is the only media player that is bundled with its encoder when a Pro version is purchased. QuickTime Pro is available both for Mac and PC.

ENCODING

1. Importing

The original video to be added can be in many popular formats, such as AVI, MOV (non-streaming version) or MP4. In order to achieve the best encoding result, always try to encode the original video output in AVI or MOV format with a large file size. Launch QuickTime Pro either on a Mac or on a PC. Open the video you want to encode.

2. Exporting

QuickTime Pro does not allow batch processing, nor does it keep an encoding log. It does not even tell you how much time you have spent on encoding a video. So, if you need to know such information, you need to manually get ready to count before you start and jot down such information.

To do multi-data-rate QuickTime streaming, you need to export three streaming versions of the same video one after another. After the encoding is done, you need to use MakeRefMovie to create a meta file to refer to these three videos. If you don't have MakeRefMovie yet, download it for free from the Apple Web site. MakeRefMovie is available both for Mac and PC.

Go File > Export. Name the first streaming file name_768.mov (replace name with a name you desire) for the 768kbps version and choose a folder where you want the output videos to be. Choose Movie to QuickTime Movie for Export on the bottom. Click Options. Click Settings under Video. Choose H.264 for Compression Type. This codec produces outstanding image quality with a smaller file size. Keep the Current frame rate. Choose Automatic for Key Frames. QuickTime Pro takes excessively long time to encode videos. In order to optimize the video for streaming, you have to choose Best quality (Multi-pass), then choose Restrict to and key in 672. Finally, choose Streaming for Optimized for. Click OK.

Click Size. Choose Custom for Dimensions. Key in 496 and 330 (we wish QuickTime had a Keep aspect ratio button to check). Check both Preserve aspect ratio using Letterbox (if there are empty spaces around the video, the encoder will fill them with black) and Deinterlace Source Video (this is necessary for showing videos on a computer).

Click Settings under Sound. Choose AAC for Format, Stereo (L R) for Channels, Recommended for Rate, Best for Quality and 48kbps for Target Bit rate. Click OK.

Last, but not least, choose Hinted Streaming for Prepare for Internet Streaming. Click Settings by it, and check Optimize Hints For Server. Usually, you don't need to click Track Hinter Settings to change anything in there unless your network provider requires that certain packet size limitation be implemented. Streamed data must be sent in smaller-size packets. Click OK.

To create the 384kbps streaming version, go File > Export. Name it name_384.mov (replace name with a name you desire) and choose the same folder where name_768.mov is. Choose Movie to QuickTime Movie for Export on the bottom. Click Options. Click Settings under Video. Choose the following options:

  • Compression Type: H.264
  • Frame Rate: 15fps
  • Key Frames: Automatic
  • Encoding: Best quality (Multi-pass)
  • Restrict to: 344
  • Optimized for: Streaming

Click OK.

Click Size. Choose Custom for Dimensions. Key in 384 and 288. Check both Preserve aspect ratio using Letterbox and Deinterlace Source Video.

Click Settings under Sound and choose the following options:

  • Format: AAC
  • Channels: Stereo (L R)
  • Rate: Recommended
  • Quality: Best
  • Target Bit rate: 40kbps

Click OK.

Last, choose Hinted Streaming for Prepare for Internet Streaming. Click Settings by it, and check Optimize Hints For Server. Click OK.

To create the 128kbps streaming version, go through the same steps described above except for:

  • File name: name_128.mov
  • Frame Rate: 10fps
  • Restrict to: 112kbps
  • Dimensions: 272 by 204 pixels
  • Audio Target Bit Rate: 16kbps.

After the encoding is done, quit QuickTime Pro.

 

MAKING A REFERENCE MOVIE

The so-called QuickTime reference movie is actually a very short meta file that assigns a QuickTime movie with an appropriate data rate for the user's Internet connection speed.

Launch MakeRefMovie either on a Mac or on a PC. Save the session with a name you desire ideally under the same folder that holds the three streaming video files. Instead of adding movie files, you need to add the streaming server links so that the files can be directly called from the server. Supposedly, you should FTP the three streaming video files to the streaming server first before you create this reference file. If you do it afterwards, don't forget how you have assigned the links in this reference movie file.

Go Movie menu > Add URL. Erase everything in there and add your first video link. In our case, it was

rtsp://qtss.indiana.edu/ip/nmstream/qt/smoke_768.mov

What does this link mean?

  • rtsp means calling a video from a streaming server instead of calling from an HTTP server.
  • qtss refers to a server that serves QuickTime streaming.
  • indiana.edu/ip is the host that hosts the streaming server. The qtss.indiana.edu/ip part is configured by the server personnel.
  • nmstream is our personal account name.
  • qt/smoke_768.mov is one of the streaming files inside the qt folder.

Add the other two links:

  • rtsp://qtss.indiana.edu/ip/nmstream/qt/smoke_384.mov and
  • rtsp://qtss.indiana.edu/ip/nmstream/qt/smoke_128.mov.

Since you have added movies from a remote server, you can't see the video images in this reference movie. In the order of adding the movies, assign the following values to each choice:

For the 768kbps movie

  • Speed: 768 Kbps DSL/Cable
  • Priority: First Choice (You want to assign this version as the default if the user's Internet connection speed is fast enough.)
  • Language: English (In America, that's the case.)
  • CPU Speed: 4 (768kbps is not the fastest Internet connection speed, which is taken by 5.)
  • Set Network Status: Network Connected
  • Choke: Choke To Movie Data Rate
  • Version: QuickTime 6.0 (for broader user accessibility)

For the 384kbps movie, assign the same values except

  • Speed: 384 Kbps DSL/Cable
  • Priority: Second Choice
  • CPU Speed: 3

For the 128kbps movie, assign the same values except

  • Speed: 112 Kbps DSL/Cable
  • Priority: Last Choice
  • CPU Speed: 2

Save the file. Quit MakeRefMovie. You can use TextEdit on a Mac or Notepad on a PC to view this file. It should look something like the picture below.

MakeRefMovie screen shot

FTP this file to your streaming server and ideally place it under the same folder that holds the streaming video files.

SCREENCAST

To view the screencast for this tutorial, you must have the Adobe Flash Player plug-in. This screencast will walk you through the tutorial above.

WEB AUTHORING

Web Authoring for Quicktime is as straightforward as embedding the following content into your web page:

 <OBJECT classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="500" height="400" 
    codebase="http://www.apple.com/qtactivex/qtplugin.cab">
 <param name="src" value="videos/qt/smoke.mov" />
 <param name="autoplay" value="true" />
 <param name="controller" value="true" />
 <param name="loop" value="false" />
 <EMBED src="./videos/qt/smoke.mov" width="500" height="400" autoplay="true" 
    controller="true" loop="false" pluginspage="http://www.apple.com/quicktime/download/">
 </EMBED>
 </OBJECT>

The object line contains the ClassID used by the Quicktime Player, the codebase that instructs the browser where to find the plug-in if it was not installed, and the dimensions of the video.

The next line, the Source Parameter tells your browser where to find the video. Next, Autoplay is set to start the video automatically and we are asking that the controller is shows. Finally, the video does not loop when it gets to the end.

Within the Object code, the Embed code is nested. Its uses most of the same parameters put together in a slightly different for, along with a "Pluginspage" parameter that takes the user to a slightly more universal download section if the plug-in does not exist. Instead of pointing solely at an ActiveX control that works on a single platform family, one should be able to find the download for different OS's and browsing platforms.

The Embed is closed and so is the Object, completing this tutorial. Drop this code into the body of your HTML file and you should be able to play Quicktime encoded video.

 

Note: In order to play this correctly on newer browsers seamlessly due to the Eolas ruling, please see our javascript embedding tutorial.

The QTL — Quicktime Link

Beyond this, Quicktime is anything but inflexible. A good feature to be aware of is the Quicktime Link file as it will allow you the best of both stand-alone video applications and embedded media. It works through a hyperlink that pulls up the Quicktime Player which can then quit as soon as the video is done. A number of other features are present that make this a valuable addition to your arsenal if you are deploying a Quicktime solution.

Getting Starting with QTL

First you will need to check to see if your server can support QTL files. As this is a relatively obscure file format, some older hosts may not have it set. Ask your Web Administrator if you are not sure, but the MIME typing for .qtl needs to be set to "application /x-quicktimeplayer". It is not hard to do so, but the procedures differ for every web configuration out there. On some Apache based web hosts, one can set this themselves utilizing .htaccess files. On hosts that supply a programming language, you may use the language to force this. When in doubt, Google is your friend.

Why the big deal? Because if it is not set, your viewers will receive a text file download when they attempt to view the video.

After you are assured that you can safely deliver your quicktime link, create a text file; name it 'something.qtl'. It will look roughly some thing like this:

<?xml version="1.0"?>
<?quicktime type="application/x-quicktime-media-link"?>
<embed src="http://www.yourschool.edu/" width="640" height="480" 
  type="video/quicktime" 
  autoplay="true" 
  controller="false" 
  fullscreen="normal" 
  quitwhendone="true" 
  loop="false"
</embed>

The first two lines are mandatory -- the XML description and the Quicktime header. Next, much like the standard coding, you have several parameters in the embedded section.

The SRC parameter must be a full link to your movie. It must either start with an HTTP or HTTPS to be valid. The dimensions of the file are also selected. The Autoplay starts the movie immediately if set to true. The Controller is shown with the next parameter, though if you select "full" for full screen, you can ignore it. Quitwhendone will close the player and return the viewer to the web page when the movie is done. And finally, Loop is False...unless you are running an unmanned kiosk, there really is not a need for this feature: it is false by default.

Save the file on your web server and create a standard link to it in your web page and you are done.