Book HomeDesigning Web AudioSearch this book

Chapter 6. Encoding, Serving, and Streaming Sound with RealAudio

Contents:

The RealMedia System
Streaming RealAudio from a web server
Professional webcasting
Advanced RealAudio applications
Live broadcasting with RealAudio
Case study: N2K streams live Mötley Crüe concert
Summary

RealAudio is the premier platform for streaming audio and video on the Web. While MP3 and QuickTime may have higher quality audio and video compression, neither provides RealAudio's advanced server functionality, reliability, and administrative tools -- features that are needed to carry out large-scale professional broadcasting. RealAudio not only provides a streaming media delivery format and media player, but its server technology optimizes audio playback over multiple modem connection speeds.

The RealMedia System works behind the scenes to deliver the best quality audio stream to both high- and low-bandwidth users. Interactive short-form audio formats such as Flash, Shockwave, and Beatnik are tailored for sound effects and loops and do not offer features for managing and controlling streams over various connection rates. Flash and Beatnik are also more likely to cause audio drop-outs and error messages when streaming long-form audio files.

Professional developers opt for RealAudio for a number of reasons, including:

In this chapter, we introduce you to the basic components of the RealMedia System and then show you how to encode and stream RealAudio content. We also explore advanced real-world case studies to show you how the technology is used in professional applications.

6.1. The RealMedia System

The RealMedia System is comprised of three core components: RealEncoder, RealServer, and RealPlayer. In addition, RealNetworks provides a suite of RealMedia tools and utilities. This chapter focuses primarily on RealMedia 5.0 components and features. A large portion of your listening audience may not have the G2 plug-in yet. Thus, for many developers, RealAudio 5.0 is still the preferred format. Figure 6-1 illustrates the process of RealMedia creation and delivery including the interaction between server-side and client-side components.

Figure 6-1

Figure 6-1. An overview of the RealSystem 5.0

RealAudio listening guides

To hear RealAudio broadcasts on the Web, check out the thousands of listings on http://www.Broadcast.com or RealNetwork's RealGuide at http://www.real.com/realguide/index.html. The Broadcast.com and RealGuide web sites offer some of the largest directories of RealAudio programming on the Net. Both sites feature business, news, sports, music, politics, and entertainment content. To list your site or event on RealGuide, click on the Add Your Site/Event link at the bottom of the RealGuide home page. Fill out the event questionnaire and enter the URL for your RealAudio content, and a RealGuide reviewer will verify your URL and list your programming in the appropriate category.

In brief, when a listener clicks on a web page that contains a RealAudio link, the web server does not stream the audio file but instead prompts the web browser to start up the RealPlayer application. RealPlayer then requests the audio file from RealServer. RealServer in turn streams media content generated from RealEncoder and RealPublisher. Finally, RealServer keeps track of media usage via the Java performance monitor, log file records, and authentication software. Figure 6-1 also helps to distinguish the process of RealMedia delivery with a dedicated RealServer as opposed to streaming audio from a standard web server.

The RealAudio generation gap

 

This chapter documents basic RealAudio operations, as found in RealAudio 5.0, the last version of RealNetworks original streaming media platform. RealAudio 5.0 is still widely used for ensuring backwards compatibility with older RealPlayers. Most of the information in this chapter is still relevant to later versions. RealMedia version 6.0 and later represent RealNetworks second generation streaming media platform (G2) with enhanced encoding and playback performance and powerful new multimedia capabilities including support for SMIL. These multimedia features are covered in the next chapter.

 

RealMedia 7.0 features better server performance and integration of server-side advertisement management features that let RealNetworks customers stream and track their rich media advertising. RealMedia 8.0 represents a major quality breakthrough including the following:

 
  • Significantly enhanced video quality (VHS quality at 300 to 500 kilobyte throughput)

  • Server support for streaming QuickTime files from a RealServer

  • Remote license management (for system administrators) that lets companies split one license across several machines/servers

  • MP3 streaming directly from the RealServer without using third-party plug-ins

6.1.1. RealEncoder and RealPublisher

RealNetworks offers two applications for encoding audio and video: RealEncoder and RealPublisher. The free RealEncoder, shown in Figure 6-2, enables you to encode audio or video files or a live input signal from an audio or video device into one or more RealMedia codecs. The RealPublisher offers the basic features of the free encoder plus advanced features such as wizards for creating HTML and built-in FTP support. The RealPublisher is especially useful for creating web pages that contain an embedded RealPlayer. The RealEncoder and RealPublisher both feature static encoding (for Macintosh and Windows) for pre-existing audio or video files and live encoding for broadcasting live events.

Figure 6-2

Figure 6-2. The RealEncoder 5.0 lets you encode audio or video files or a live input signal.

With the release of RealSystem G2, the RealEncoder and RealPublisher content creation tools have been renamed the RealProducer. The current version of RealAudio uses RealNetwork's new G2 compression technology. G2's new codecs offer tremendous improvement in sound quality over the RealAudio 1.0 and 2.0, which had been inferior to Shockwave's MPEG-based compression algorithms and Liquid Audio's Dolby compression technology.

6.1.2. RealServer

RealServer works in conjunction with a standard web server to stream encoded audio and multimedia content over the Internet. RealServer is the key component that separates RealAudio from other formats that primarily rely upon HTTP or TCP streaming from a web server. A dedicated RealAudio server offers greater reliability than a standard web server and features more sophisticated streaming capabilities, such as robust UDP and RTSP transmission, bandwidth negotiation, live splitting, IP multicasting, and clustering. RealServer also allows for more control over the stream, such as the ability to seek forward without waiting for the content to download. Additionally, data is sent across the network in a more consistent, regulated rate as compared to a web server's tendency to deliver data in bursts. The RealSystem also provides detailed usage logs and tracking analysis of hits and playback errors -- essential tools for system administrators and web developers.

6.1.3. RealPlayer

The last piece of the puzzle is RealPlayer -- the player or "decoder" (shown in Figure 6-3) that receives the incoming audio signal. The RealPlayer decodes incoming audio packets that have been compressed with the RealEncoder. The RealPlayer is free and features random access controls such as scroll, stop, start, and pause. The RealPlayer Plus lets you set custom presets or channels that point to your favorite RealAudio broadcasting sites and record RealAudio clips to your desktop. The G2 RealPlayer Plus includes a graphic equalizer video brightness, contrast, and tint controls (see Chapter 7, "Designing Multimedia Presentations with SMIL and RealSystem G2" for more information about RealSystem G2).

Figure 6-3

Figure 6-3. RealPlayer 5.0 decodes incoming audio packets that are compressed with the RealEncoder.

RealAudio web resources

 

Visit the RealNetworks Developer Zone web site at http://www.real.com/devzone/index.html. The Devzone's documentation library allows you to access hundreds of pages of online manuals and content creation guides. You will also find an impressive amount of free information including an extensive index of downloadable PDF RealMedia guides, side-by-side comparisons of the latest codecs, software developer kits, and an open forum with answers provided by RealAudio technical experts.

 

The RealAudio forum is an especially useful resource for finding solutions to a broad range of common problems. You can also read through past issues of the bi-weekly "digested" RealAudio forum to look for previously posted workarounds and solutions. You can even look through a searchable archive built by the media experts at Stanford University's MedNET site (http://mednet.stanford.edu/realforum.html) that contains all the previously posted RealAudio forums.

 

RealNetworks also provides a comprehensive content creation and authoring products site (http://www.real.com/products/index.html?src=eml,hardware,productsmain) with more than 20 free and commercial media products for Macintosh, Windows, and Unix from RealNetworks and other industry-leading companies.

6.1.4. RealAudio utilities

RealNetworks provides several RealMedia tools and utilities for editing and synchronizing RealMedia files, such as RMEdit and RMMerge. These tools come pre-installed with the RealEncoder.

RealMedia tools allow you to alter file information such as title, author, and copyright information, and features such as selective record and mobile playback. The selective record feature allows listeners to save RealAudio clips to disk, whereas mobile playback allows listeners to save audio clips for playback over an alternative listening device. The RealMedia tools also enable you to listen to the contents of a RealAudio file and perform simple editing to an .rm file, such as pasting multiple clips into one clip or shortening the length of a clip. For more information about specific utilities and tools, visit RealNetwork's Devzone.

6.1.5. RealAudio 5.0 file types and metafiles

The RealSystem 5.0 uses several file types, each identified by a specific file extension:

RealMedia Clip (.rm)

RealMedia Clips are audio or video encoded to RealAudio and RealVideo formats. The .rm files can contain multiple streams, including audio, video, image maps, and events. Note that previous versions of the RealAudio System used the .ra extension for RealAudio clips.

RealMedia metafile (.ram)

The metafile located on your web server connects a web page to your RealAudio, RealVideo, or RealFlash clips. The metafile contains the URL of one or more clips located on the RealServer. This file launches the external player, which then requests the RealMedia (.rm) file referenced in the metafile.

RealPlayer Plug-in metafile (.rpm)

The RealPlayer metafile is similar to the RealMedia metafile but it is used with the RealPlayer Plug-in when the player is embedded directly in a web page. Note that this metafile will not launch the external player.

6.1.6. RealAudio delivery

Figure 6-4 illustrates how a RealMedia clip is delivered to a listener. The numbers in Figure 6-4 correspond to the sequence of events that lead to the final delivery of a RealMedia clip:

  1. The browser displays a web page containing a link to a RealAudio metafile.

  2. The user clicks on the link. The browser requests the metafile from the web server.

  3. The web server delivers the RealAudio metafile to the browser. For files with a .ram file extension, the web server sets the MIME type of the file to audio/x-pn-realaudio. For files with a .rpm file extension (RealPlayer Plug-in), the web server sets the MIME type of the file to audio/x-pn-realaudio-plugin.

  4. The browser looks up the MIME type of the RealAudio metafile. Based on the MIME type, the browser starts RealAudio Player as a helper application and passes it to the metafile.

  5. RealAudio Player reads the first URL from the metafile and requests it from RealAudio Server.

  6. RealAudio Server begins streaming the requested RealAudio clip to RealAudio Player.

    Figure 6-4

    Figure 6-4. Many steps are involved from your first click to the final delivery of the audio stream.



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.