previous next

Chapter 10: Delivering a Presentation

When you finish building your RealSystem presentation, you place the clips on RealServer for streaming. This chapter explains how to link your Web page to your presentation. It also describes how a Web server can play back some RealSystem G2 presentations.

Using RTSP and HTTP in URLs

A RealSystem presentation served by RealServer G2 involves the HTTP and RTSP protocols. If you have experience creating Web pages, you know that HTTP is the standard protocol Web browsers and Web servers use to communicate. Most Web page URLs begin with http:// to make the file download use the HTTP protocol.

As explained in "Hosting a Presentation on a Server", RealServer G2 and RealPlayer G2 communicate primarily with RTSP, a new protocol designed specifically for streaming media. When you assemble a RealSystem presentation, it's important to understand clearly which URLs should begin with http:// and which should begin with rtsp://.

Use rtsp:// in URLs in which RealPlayer G2 requests clips from RealServer G2. These URLs occur in SMIL files (.smil) and Ram files (.ram or .rpm). Use http:// in these URLs only if the clips are stored on a Web server instead of RealServer. Because a Web server doesn't use RTSP, you can't have rtsp:// in a URL to a clip stored on a Web server.

Links to a Web server or RealServer within a Web page (.htm or .html) always start with http://. Like Web servers, Web browsers don't use RTSP and can't interpret streaming information sent by RealPlayer over RTSP. The Web browser can connect to RealServer through HTTP, though, because RealServer G2 can transmit data with HTTP or RTSP.

Additional Information
For more on SMIL file URLs, see "Linking to Clips on RealServer" and "Linking to Clips on a Web Server". See also "URL Reference".

Streaming Clips from RealServer G2

When you stream clips from RealServer, the RealServer administrator creates content directories and tells you the basic URLs to use. The administrator can also set up features such as password authentication and pay-per-view. When your media clips and SMIL file are ready, transfer them to RealServer and place them in the directories prepared by the administrator. Then link your Web page to your presentation as described below.

Tip
Because earlier versions of RealServer do not support SMIL and RTSP, ensure that RealServer G2 hosts your presentation. Also note that RealNetworks production tools can transfer files to RealServer automatically. See http://www.realnetworks.com/developers/ for details.

When you use RealServer, the Ramgen feature can automatically launch RealPlayer, eliminating the need to write a separate Ram file. Your Web page URL simply points to your media clip or SMIL file on RealServer and includes a ramgen parameter. The next figure illustrates the process of requesting a presentation through Ramgen. This example uses a SMIL file that coordinates multiple clips, but you can also link to a single clip directly without using SMIL.

Requesting a Presentation from RealServer using Ramgen

  1. Using the HTTP protocol, the Web browser requests the SMIL file from RealServer. The URL includes a parameter that invokes Ramgen.

  2. RealServer's response causes the Web browser to launch RealPlayer as a helper application and give it the URL to the SMIL file.

  3. RealPlayer requests the SMIL file from RealServer using the RTSP protocol.

  4. With the information in the SMIL file, RealPlayer requests and receives the streaming media clips.

Linking your Web Page to RealServer

With your clips on RealServer, link your Web page to the SMIL file with an HTML hypertext link that looks like this:


<a href="http://realserver.company.com:8080/ramgen/sample.smil">...</a>

If the presentation plays back directly in the Web page through RealPlayer's Netscape plug-in, the URL occurs within an <EMBED> or <OBJECT> tag and looks like this:


SRC="http://realserver.company.com:8080/ramgen/sample.smil?embed"

The following table explains the components of these URLs. Contact your RealServer administrator to get the actual RealServer address, HTTP port, and Ramgen directory structure.

URL Components in a Web Page Link to RealServer G2
URL Component Meaning
http:// This makes the browser contact RealServer through the HTTP protocol. (Web browsers do not use RTSP.)
realserver.company.com This address varies for each RealServer. It typically uses an identifier such as realserver instead of www. It may also use a numeric TCP/IP address such as 204.71.154.5.
:8080 This is the port RealServer uses for HTTP connections. Separate the port and address with a colon. You can leave the port number out if RealServer uses port 80 for HTTP connections. Include the port number if RealServer uses any port besides 80 for HTTP.
/ramgen/ As "Using Ramgen" explains, this parameter launches RealPlayer without the use of a separate Ram file.
sample.smil This is the SMIL file for your presentation. If you have just one clip to stream, you can link directly to that clip instead of a SMIL file.
?altplay=file.ext This Ramgen option specifies an alternate presentation created for older versions of RealPlayer. See "Listing Alternate Presentations".
?embed This Ramgen option embeds the presentation in a Web page. See Chapter 8 for full information on Web page playback.

Using Ramgen

In your Web page hyperlink, the /ramgen/ parameter causes the Web browser to launch RealPlayer without the use of a separate Ram file. This parameter designates a virtual directory on RealServer. It may be followed in the URL by actual directory listings, as in this example:


<a href="http://realserver.company.com:8080/ramgen/media/sample.smil">..</a>

You should use Ramgen even when linking to a single clip, such as a RealVideo (.rm) clip, that automatically launches RealPlayer. If you cannot use Ramgen, you can write the Ram file as described in "Creating a Ram File Manually".

Listing Alternate Presentations

When you update content for RealSystem G2, you can keep existing content available for earlier versions of RealPlayer. Suppose you have a RealVideo 5.0 clip that you want to encode with a RealSystem G2 codec and lay out with SMIL. After re-encoding the source file with the new codec and writing the SMIL file, you change the link to the 5.0 Ram file to point to the SMIL file, using the Ramgen altplay option to list the older clip as an alternate:


<a href="http://.../ramgen/sample.smil?altplay=old_sample.rm">

This link instructs RealServer to point RealPlayer G2 to sample.smil. Earlier versions of RealPlayer receive the URL to the older old_sample.rm file. Note that the URL specifies the actual clip, not the old Ram file. The older clip must reside in the same directory as the new clip or SMIL file.

Tip
It is not necessary to keep older content available. If you do not use altplay, page visitors using older versions of RealPlayer are prompted to upgrade when they click the link to the SMIL file.

Combining Ramgen Options

The question mark operator ("?") separates Ramgen options from the main URL. To use multiple Ramgen options, you use a question mark before the first option, then separate the remaining options with ampersands ("&"). The order of options does not matter. For example, the following link uses altplay and embed:


<a href="http://.../ramgen/sample.smil?embed&altplay=old_sample.rm">

You can use the question mark operator to include earlier Ram file options when using altplay. If your Ram file URL for a RealVideo 5.0 presentation specified an end time, for example, include that option in the Ramgen URL after altplay. The following shows an end time set for old_sample.rm:


<a href="http://.../ramgen/sample.smil?altplay=old_sample.rm&end=7:45">

Playing Clips from a Web Server

If you do not have access to RealServer G2, you can host your presentation on a Web server. Although not as robust as RealServer streaming, Web server playback provides a reasonable method for sending simple presentations to a small number of users. It is not recommended for lengthy or complicated presentations, however, or for clips viewed simultaneously by large groups.

As described in "Launching a Presentation", a Ram file launches RealPlayer when the presentation plays back from a Web server. You therefore need to write the Ram file as described in "Creating a Ram File Manually" and place it on the Web server. The following figure illustrates the process of requesting a presentation from a Web server. All network actions use the HTTP protocol.

Requesting a Presentation from a Web Server

  1. The Web browser requests the Ram file from the Web server.

  2. The Web server downloads the Ram file to the browser.

  3. The Ram file extension (.ram or .rpm) causes the Web browser to launch RealPlayer. The .ram extension launches RealPlayer as a separate application. The .rpm extension plays the presentation within the Web page.

    Additional Information
    For more information on embedding a presentation in a Web page, see Chapter 8.

  4. RealPlayer receives the Ram file and requests the SMIL file from the Web server. Alternately, the Ram file can simply list a single clip or multiple clips played in sequence.

  5. With the information in the SMIL file, RealPlayer requests and receives the clips from the Web server.

Limitations on Web Server Playback

As noted in "Hosting a Presentation on a Server", a presentation downloaded from a Web server is more likely to stall than a presentation streamed by RealServer. To ensure that a presentation hosted by a Web server plays as smoothly as possible, observe the following points.

No SureStream Clips Encoded for Multiple Bandwidths

A Web server cannot stream just one encoding from a SureStream clip encoded for multiple bandwidths. Instead, it downloads the entire clip file, causing an unacceptably high preroll. So you must encode each clip for just one bandwidth. To support multiple bandwidths, encode separate clips for various bandwidths and use SMIL to let RealPlayer choose which clip to play.

Additional Information
See "Choosing RealAudio Codecs" for information on RealAudio and SureStream. For more on using SMIL to list clip choices, read "Setting Bandwidth Choices".

Limited Ability to Keep Parallel Clips Synchronized

A Web server does not consider clip timelines when downloading data and does not receive feedback from RealPlayer. Web server playback therefore makes it harder for RealPlayer to keep clips synchronized. A presentation that plays clips in parallel may begin to stall and rebuffer data when the RealPlayer connection has little bandwidth to spare.

For this reason, it may be difficult to deliver Flash with RealSystem G2, which consists of synchronized animation and audio. You can, however, combine a large clip such as RealVideo with smaller clips, such as image clips or a RealText clip. Because RealText consumes little bandwidth, a Web server can download it to RealPlayer quickly without interfering with other clips.

RealPix Presentations Buffer Longer

When delivered by RealServer, images in a RealPix presentation stream at different times depending on their place in the RealPix timeline. This lets you structure a RealPix presentation to keep it flowing smoothly. When delivered by a Web server, however, all RealPix images begin to download as soon as presentation playback begins. This causes a higher preroll.

Additional Information
RealPix Authoring Guide explains bandwidth usage when RealServer G2 streams RealPix. This guide is available at http://service.real.com/help/library/index.html.

SMIL File Optional

When delivering a single clip or a few clips played in sequence, you do not need a SMIL file. You can simply list the clips in order when writing your Ram file as described in "Creating a Ram File Manually". You can, however, have your Ram file specify a SMIL file that lists the clip locations, creates a layout, times the presentation, and so on.

SMIL Internal Timing Commands not Usable

Although you can use SMIL to lay out and time your presentation, you should not use the clip-begin and clip-end attributes. A Web server cannot begin to download a clip at a certain point in its timeline. If you specify clip-begin="5min", for example, RealPlayer must wait until it has received the first five minutes of clip data before it can begin to play the clip back. This creates an unacceptably long wait.

Additional Information
"Setting Internal Clip Begin and End Times" describes these SMIL commands.

No RealPlayer Seeking

Because a Web server cannot jump to a new position in a clip timeline, the RealPlayer position slider cannot fast-forward the clip. If the user moves the slider forward, playback pauses as the clip continues to download at its normal rate. RealPlayer resumes playback once the clip data reaches the requested timeline position.

No RTSP URLs

Because Web servers do not support the RTSP protocol, all URLs in presentations hosted by a Web server should begin with http://. This includes all URLs in a SMIL file or Ram file.

No Live Broadcast

Live broadcast is not possible because Web servers can download only clips stored on disk.

Configuring Web Server MIME Types

To download a RealSystem presentation from a Web server, the server must be configured with the following MIME types. If you are using an ISP, ask the ISP's Web server administrator to configure the MIME types listed in the following table.

Web Server MIME Types for RealSystem Files
File Type Extension MIME Type
Ram .ram audio/x-pn-realaudio
Embedded Ram .rpm audio/x-pn-realaudio-plugin
SMIL .smil and .smi application/smil
RealAudio .ra audio/x-pn-realaudio
RealVideo .rm application/x-pn-realmedia
RealPix .rp image/vnd.rn-realpix
RealText .rt text/vnd.rn-realtext

Creating a Ram File Manually

Whenever possible, launch RealPlayer automatically with RealServer's Ramgen feature as described in "Using Ramgen". In some cases, though, you may need to write a Ram file:

To create a Ram file:

  1. Open any editor or word processor that can save files as plain text. On the top line, enter the full URL of the SMIL file or the media clip. As shown below, URLs vary with the playback context.

  2. For a presentation played back from RealServer, you can support earlier versions of RealPlayer (such as RealPlayer 4.0 or 5.0) just as Ramgen does with the altplay option. To do this, add the marker --stop-- after the RTSP URL. Then specify the URL for the older clip just as it appeared in your previous Ram file. Here's an example:
    
    rtsp://realserver.company.com:554/sample.smil
    --stop--
    pnm://realserver.company.com:7070/old_sample.rm

    The second URL specifies the older RealSystem protocol with pnm:// and designates RealServer's PNA port. When RealPlayer connects, it chooses the URL based on its favored protocol. For this reason, you cannot list two URLS that both use the same protocol, whether rtsp://, pnm://, or http://.

  3. Save the Ram file as plain text with a .ram extension (played in RealPlayer) or a .rpm extension (played in the Web browser).

  4. Move your Ram file to RealServer or your Web server. Keep in mind that even if all your media clips are on RealServer, you can place the Ram file on your Web server. When the browser receives the Ram file from the Web server, it turns the file over to RealPlayer, which uses the full URLs in the Ram file to request the clips off RealServer. Hence the Ram file and the media clips do not need to reside on the same machine.

  5. For .ram files, link your Web page to the Ram file with an HTML hyperlink such as this:
    
    <a href="http://www.company.com/media/sample.ram">click for video</a>
    

    For .rpm files, incorporate the link URL in the <EMBED> or <OBJECT> tag as described in "Setting Basic Parameters". If the Ram file is on RealServer, the URL must not use the ramgen parameter.

Adding Comments to a Ram File

You can add a comment to a Ram file by using a pound sign ("#") as the first character on a line. The following example shows two lines commented out of a Ram file:


# Two videos and a SMIL presentation
# streamed from RealServer G2.
rtsp://realserver.company.com/media/video1.rm
rtsp://realserver.company.com/media/video2.rm
rtsp://realserver.company.com/media/sample2.smil

Bundling RealPlayer Presets

The Presets menu for RealPlayer G2 lets you save URLs, much like a Web browser lets you set bookmarks or favorites. If you want to share Presets with your users, you can post on your Web page a Presets Pack that users can download and import into their RealPlayers.

To create, export, and publish a Presets Pack:

  1. With RealPlayer, create a Presets Pack folder using Presets>Organize Presets. Click New Folder and supply a name that describes the Presets the folder will hold. This name appears in RealPlayer's Presets menu when a user imports the Presets Pack.

  2. Play each URL in RealPlayer and use Presets>Add to Presets to add it to your Presets Pack folder. Be sure to give each Preset an informative name. Repeat this until you have added all the Presets you want to export.

    Tip
    Use Presets>Organize Presets to move existing Presets into your Presets Pack folder. You can move them back after you have exported the Presets Pack.

  3. Choose Presets>Organize and select your Presets Pack folder.

  4. Click Export and use the navigation dialog box to name and save your Presets Pack. The extension .prx is added to the file automatically.

  5. To make your Presets Pack available for import, simply add a link to your Web page so that users can download the file. Here's an example:
    
    <a href="http://www.company.com/presets.prx">My Favorite Presets</a>											
    

Depending on the browser used, the download may import the Presets Pack into RealPlayer automatically. Otherwise users can import it with one of these methods:

Testing your Presentation

The following are guidelines for making sure your presentation works well and reaches its target audience:

  1. Test your presentation in "real world" conditions. If you target 28.8 Kbps connections, for example, request the presentation over a 28.8 Kbps modem.

  2. Check that the presentation has a preroll (initial buffering) under 15 seconds. After preroll, the presentation should not rebuffer under normal network conditions.

    Additional Information
    "What is Preroll?".

  3. Verify that video and audio quality is acceptable.

  4. For a multiclip presentation, verify that clips stay synchronized. Ensure that no stalling occurs because too many clips play at the same time or a single clip requires too much bandwidth. Test that clips introduced during a presentation in progress do not stall playback by requiring too much buffering when they start.

    Tip
    If clips introduced during a presentation in progress require too much buffering, see "Smoothing Transitions between Clips".

  5. Make sure that your presentation works well for an "average" CPU for your audience. For general Web delivery, test playback on both Pentium and Power Macintosh 90 MHz machines. Do not rely on MMX technology to enhance playback. Not all Web users have MMX machines.

    Tip
    If your presentation is CPU-intensive because, for example, it uses complex Flash animation or high- bandwidth video, note this in your Web page.

  6. When streaming RealAudio, ensure that sound quality is acceptable. You may need to experiment with RealAudio codecs to find the best balance between clip bandwidth use and sound quality.

  7. When embedding a presentation in a Web page, verify that the playback window has the correct location and controls.

Advertising on RealGuide

Every day, thousands of people visit RealGuide, RealNetworks' online guide for streaming media sites and live events (http://realguide.real.com/). If you regularly host RealAudio or RealVideo content of interest to the public, or you have a live event you want to advertise, you can submit your listing to RealNetworks. Simply complete an online form to list your site:

or live event:

In the form, you give the site or event name, URL, short description, and contact person. A staff member then verifies your site or event before including it on RealGuide. (RealNetworks reserves the right to refuse or edit submissions.) For live events, please submit your request at least one business day in advance. If you have questions or need to change a listing, please e-mail timecast@timecast.com.


Copyright © 1998 RealNetworks
For information on RealNetworks' technical support, click here.
Comments on this document? Click here.
This file last updated on 12/18/98 at 14:36:38.
previous next