Compressing and Hinting Media for Streaming

Introduction

The streaming server requires that files are compressed and hinted. Uncompressed video is too bandwidth intensive to stream: Standard definition video would consume over 160 megabits per second for a single stream. As a result, all streaming video for the web is compressed and decompressed with a codec. QuickTime/Darwin streaming server support a variety of different video codecs, and three file formats for streaming video:

File Format:
Video Codecs Supported Include:
.mov
Cinepak, H.261, H.263, MPEG-4 Video, Sorenson Video, Sorenson Video 3, Video
.mp4
MPEG-4 Video
.3gp
MPEG-4 Video

Note: The codecs above are all built into QuickTime 6 or later. The QuickTime architecture is extensible, and other codecs are available. For example, the ZyGoDigital Pro codec and Streambox ACT-L2 codec both provide exceptional quality for streaming at low bit-rates.

While not as demanding as video, audio still benefits from compression for streaming. QuickTime/Darwin streaming server support a variety of different video codecs, and three file formats for streaming video:

File Format:
Audio Codecs Supported Include:
.mov
IMA 4:1, MPEG-4 Audio (AAC Low Complexity), QDesign Music 2, Qualcomm PureVoice, uLaw 2:1
.mp4
MPEG-4 Video (AAC Low Complexity)
.3gp
AMR-NB (Speech), AAC Low Complexity

All of the file formats must be hinted for streaming. The hint track is a special track of control data in a streaming movie. It is used by the streaming server to optimize delivery of the media and is never sent over the network during streaming.

Streaming Workflow

The basic workflow for compressing and hinting media is:

Notes:

Compression with QuickTime Pro

These step-by-step instructions for compressing in MPEG-4 format with Apple QuickTime Pro demonstrate "Compression for Delivery" in the workflow outlined above (see Tools below for more information on QuickTime Pro and other compression tools). This tutorial assumes that you have a high quality "archival" source file to begin with, that we are exporting for newer systems that can play back MPEG-4, and that clients will be connecting at 512 kbits/second or higher.

  1. Open your high quality source movie with QuickTime Pro.
  2. Select "Export" from the "File" menu in QuickTime Pro.

  3. From the Export window selecte "Movie to MPEG-4" as shown:

  4. Then click on the "Options" button. This will bring up the MPEG-4 Export Options Window - with a tabbed interface for setting all export options.

  5. The top part of the window lets you set values. The bottom part of the window provides a summary of the current settings including the data rate required, and whether the movie is compliant with ISMA specifications. The selections in this Window are retained from the last time an Export was done. The General Tab shown above allows you to set the format for the Video and Audio tracks, and Size of the video. Click on the other tabs to drill down on specific options. In the rest of this example, we will be configuring a stream to be delivered over a 512 kbits/second Internet connection for streaming. We'll lower the frame rate to 15 frames per second and the data rate for video to 350 kbits/second with the Video tab:

  6. We'll configure the audio for Stereo, 44.1 kHz, 128 kbits/second:

  7. Because we want to stream this video, we have to enable hinting in the Streaming tab. The "Streaming (basic)" setting is best for most setups. Optimized for server creates bigger files and should only be used for heavily loaded servers:

  8. The Compatibility Tab lets you specify the target data-rate and whether ISMA compatibility is desired. We'll set the connection speed for 512 kbits/second. Note that we'll receive a Warning at the bottom of the Window. The text in the lower half of the window provides more information on the Window (the bit rate of our movie is too high, it needs to be 460 kbits or less):

  9. To correct this problem we need to lower the bit rate of the audio and/or video. We decide that video quality is more important, so we'll lower the bit-rate on the audio to 96 kbits/second (the highest we can go without getting the warning):

  10. We can click on the "OK" button and our settings will be in effect when we Save the movie. The most recent settings will remain intact until we go back to Options and change settings - the most recent settings are retained.

Following the procedure above, we can create compressed versions of the file for streaming to a variety of connection types. These movies would then be placed on the streaming server as described in Posting Files to Your Streaming Server.

Using MakeRefMovie

It is often desirable to post a single movie on your web site that will playback a different media file based on the client's connection speed, processor speed, QuickTime version, platform, the user's language preference, etc. Apple provides MakeRefMovie, a free tool for creating reference movies that accomplish this task. A reference movie contains no media: It references media in other files or even on other servers. Based on the settings you provide, clients will load a specific piece of media from a specific server. Versions of the application are also available for Windows systems. Reference Movies can also be created from the command-line with the free tool XMLtoRefMovie (the command-line method is useful in building automated workflows).

The step-by-step procedure below was performed on Mac OS X with MakeRefMovie X. This simple example assumes that we are targeting three different connection speeds.

  1. After launching MakeRefMovie, you will be prompted for the name of your Reference Movie file. This is the file that you will post to your web server. It contains no media - it references movies in other files or URLs.

  2. A window will appear with no references. Since we are loading our movies from a streaming server, all of the references in the movie will be URLs. MakeRefMovie also allows you to reference files, which would be used if all of the files were being delivered via the same web server. The next step is to select "Add URL..." from the Movie Menu:

  3. In the URL Reference dialog, we'll type in the rtsp URL to a movie from the streaming server. A good practice is to test the URL from QuickTime Player first, and copy and paste the URL from QuickTime Player's "Open URL..." dialog.

  4. After clicking the OK button, the reference for this movie will appear in the main window of the application. Since this movie was encoded for 100 kbits/second, we are going to assign it to a 112 kbit/second connection speed:

  5. We'll repeat steps 3 and 4 for two additional references: One for 384 kbit/second DSL/Cable clients and one for 56 kbits/second modem clients. When we're done, the main window of the application will look something like:

  6. When all the references needed have been entered, Save the movie from the File menu:

  7. The resulting file can be placed on a web server, file server, e-mailed, etc. When a client opens the movie, QuickTime will playback the appropriate media based on the parameters configured in the Reference Movie.

Tools for Compression

Tool Name Description URL Link
QuickTime Pro The "Pro" version of QuickTime (Macintosh and Windows) is available from Apple for $29.95. It also is available with the excellent book, QuickTime for the Web (highly recommended). QuickTime Pro can compress media in any of the formats listed above. On Macintosh systems, compression workflow can be automated with Applescript.
MakeRefMovie
MakeRefMovie X
MakeRefMovie is a free, cross-platform utility from Apple to create reference movies. Reference movies provide a handy way to redirect clients to the appropriate stream based on their Internet connection and processor speed.
Apple Compressor Apple's Compressor comes bundles with DVD Studio Pro and Final Cut Pro (Mac OS X only). It is a professional level compression tool that supports batch compression, image processing, and live preview.
Totally Hip HipFlics HipFlics is an inexpensive graphical tool for video streaming compression (Macintosh and Windows). It provides batch compression and unique features such as the ability to change the data-rate over the course of a movie.
Sorenson Squeeze for QuickTime
Sorenson Squeeze for MPEG-4
Squeeze is suite of tools for video compression (Macintosh and Windows). It provides batch compression, direct input from DV sources or compression of individual media files.
Popwire Compression Master, Compression Engine and Cluster Framework Popwire's compression tools provide powerful capabilities for professional, high volume encoding (Mac OS X, Linux and Solaris). Compression Master is a graphical tool for creating compression settings and batch compression (MPEG-4, MPEG-2 and Real codecs). Compression Engine is a server-based tool that provides automatic compression and routing of compressed media. The Cluster Framework provides distributed compression across systems to speed up the workflow process.
Discreet Cleaner 6
Discreet Cleaner XL
Discreet's Cleaner products provide professional compression and workflow. They support a wide range of media formats including QuickTime, Windows Media and Real. Cleaner will automatically generate reference movies and web page templates. Discreet's Event Stream technology provides sophisticated abilities to add special features such as URL flips to streaming media.
Canopus Procoder Canopus Procoder is a professional level tool for media compression and workflow (Windows Only). It suppports a wide range of formats, but does not support MPEG-4.
Dicas mpegable X4 Dicas mpegable X4 (Windows only) provides MPEG-4 and 3G encoding.
mpeg4ip mpeg4ip is an Open Source set of tools for MPEG-4 compression and playback (primarily Linux with Windows, Solaris, FreeBSD, BSD/OS and Mac OS X binaries).
Streambox Codecs The Streambox ACT-L2 and ACT-L3 codecs provide QuickTime with alternatives to the built-in QuickTime codecs. They are engineered to deliver higher quality at lower bit-rates than MPEG-4 or MPEG-2.
ZyGoDigital Codecs The ZyGoVideoPro codecs are optimized to deliver high quality at lower bit-rates. Video compressed with ZyGo Digital's codecs compares favorably against video compressed with other codecs at lower bit-rates.