previous next

Setting Bandwidth Choices through SMIL

Pronounced "smile," SMIL stands for Synchronized Multimedia Integration Language. It is an international standard for delivering multimedia presentations, providing many features for laying out and timing clips. Using SMIL when delivering RealAudio or RealVideo clips from a Web server is optional, but it can provide many useful features such as the bandwidth selection feature described here.

Additional Information
For a full explanation of SMIL and its many features, see the SMIL chapter in RealSystem G2 Production Guide.

When you encode a set of single-rate clips for different bandwidths, you can use SMIL to specify the bandwidths. Your Web page then needs just one link to the SMIL file rather than a separate link to each clip. When a visitor to your Web page clicks the SMIL link, that user's RealPlayer reads the bandwidth choices and chooses the clip to play based on its bandwidth preference. This preference is set during RealPlayer installation and is also available on the Connection tab under the Options>Preferences command.

RealPlayer Bandwidth Preference

Choosing Target Bit Rates

When you encode a RealAudio or RealVideo clip, you choose a clip bandwidth in the RealProducer wizard dialog. Encode as many clips from the same source file as necessary to support the bandwidths you want to target. You might encode a clip for 28 Kbps modems, another for 56 Kbps modems, and a third for dual-ISDN connections, for example. Save each clip with a different file name. Once you have encoded all the clips you want, you are ready to create your SMIL file.

Target Audience Dialog in RealProducer Recording Wizard

Writing the SMIL File

Write your SMIL file with any word processor or text editor that can save files as plain text. Base your file on the following example, which shows a complete SMIL file that enables RealPlayer to choose between six clips encoded for different bandwidths:


<smil>
<body>
<switch>
<ref src="myclipcm.rm" system-bitrate="220000"/>
<ref src="myclipcl.rm" system-bitrate="150000"/>
<ref src="myclipdi.rm" system-bitrate="80000"/>
<ref src="myclipsi.rm" system-bitrate="45000"/>
<ref src="myclip56.rm" system-bitrate="32000"/>
<ref src="myclip28.rm" system-bitrate="20000"/>
</switch>
</body>
</smil>

The following table explains this example. It shows that myclipcm.rm is for fast cable modems. The "SMIL File Bit Rate Specification" column lists the figures to use as the system-bitrate values. For a 28.8 Kbps clip, for example, use 20000 to indicate that 20,000 bits per second is the minimum bandwidth needed to play the clip. This is below the full connection speed (28.8 Kbps, which equals 29491 bps) because a clip does not consume the entire connection bandwidth. Some bandwidth is reserved for network overhead, data loss, and so on.

Example Clips and Bandwidth Targets
Clip File Name Connection Type Clip Bandwidth SMIL File Bit Rate Specification
myclipcm.rm xDSL/cable modem 220 Kbps 220000
myclipcl.rm Corporate LAN 150 Kbps 150000
myclipdi.rm Dual ISDN 80 Kbps 80000
myclipsi.rm Single ISDN 45 Kbps 45000
myclip56.rm 56.0 Kbps modem 32 Kbps 32000
myclip28.rm 28.8 Kbps modem 20 Kbps 20000

Of course, your SMIL file can support a different number of bandwidths and use different file names. For example, the following SMIL file supports 28 Kbps and 56 Kbps modem connections:


<smil>
<body>
<switch>
<ref src="audio56.rm" system-bitrate="32000"/>
<ref src="audio28.rm" system-bitrate="20000"/>
</switch>
</body>
</smil>

In this example, users with 28.8 Kbps modems receive the clip audio28.rm. Users with 56 Kbps modems or faster connections receive the clip audio56.rm.

SMIL File Extension

Save your SMIL file with the file extension .smil (recommended) or .smi. The file can have any name, such as myclips.smil. Make sure that when you save the SMIL file as plain text, your text editor does not add the extension .txt. If this happens, rename the file from the operating system.

Pointers on Creating a SMIL File

Keep the following important points in mind when creating a SMIL file.

Always List System Bandwidth Options from Highest to Lowest

RealPlayer evaluates SMIL bandwidth options in the order listed, selecting the first viable option even if subsequent options suit it better. Therefore, always list clips from highest bandwidth to lowest, as shown in the examples above. If a 28.8 Kbps option is first, for example, a RealPlayer with a fast dual-ISDN connection will choose that option because it is the first viable option listed.

Also ensure that the last option satisfies the lowest bandwidth connection you want to support. If you do not list an option suitable for 28.8 Kbps modems, for example, RealPlayers connected through those modems will not play any of the clips.

Give Full URLs if Clips and SMIL File are in Different Directories

The src attributes in the SMIL file examples above list only the clip file names, as shown here:


<ref src="audio56.rm" system-bitrate="32000"/>

These examples assume that the clips and the SMIL file are in the same Web server directory. If your clips are not in the same directory as the SMIL file, give the full URL to the clips within the SMIL file. Here's an example:


<ref src="http://www.company.com/media/audio56.rm" system-bitrate="32000"/>

Follow SMIL Syntax Rules

SMIL has a more rigid syntax than HTML. Using authoring practices common to HTML can create an unusable SMIL file. Observe these syntax pointers when writing a SMIL file:


Copyright © 1998 RealNetworks
For information on RealNetworks' technical support, click here.
This file last updated on 12/13/99 at 12:16:57.
previous next