home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Book HomeDesigning Web AudioSearch this book

6.3. Professional webcasting

While simple HTTP pseudo-streaming is adequate for small-scale broadcasting purposes, it is not a professional solution for large-scale broadcasting. If audio is a mission-critical component of your web site or simply needs to be 100% reliable, use a dedicated RealServer. This section provides a step-by-step guide on how to prepare and serve professional-quality RealAudio.

The first step to professional RealAudio broadcasting is to capture the highest-quality RealAudio source material. If you are using RealAudio in a professional situation, you need to maintain broadcast-quality production techniques.

To achieve the best fidelity:

To create the best quality RealAudio clips:

6.3.1. Selecting the right RealAudio codecs

Once you have captured or imported a high-fidelity sound file into the RealEncoder, you need to select which codecs to use when exporting duplicates of the file. Choosing codecs can be a confusing process. With the release of RealSystem G2, there are six RealPlayers and dozens of RealAudio codecs in use. Compounding the problem, connection speeds vary greatly across the Internet.

Although RealSystem G2 simplifies the encoding process with its "encode once, stream anywhere" SureStream technology, it will take a considerable amount of time for the millions of people still using older players to upgrade to the new G2 player.

To make sure your audio is available to the widest possible audience, include several duplicate audio clips encoded at different bitrates. Generally, three or four codecs -- such as 20 Kbps mono, 56 Kbps ISDN, and stereo ISDN -- are adequate. Bandwidth negotiation is a RealServer feature that automatically detects the bandwidth of a listener and then streams the appropriate RealAudio clip. To use bandwidth negotiation, you need to select several RealAudio codecs.

To determine which codecs to use, remember that the cumulative bitrate of all files in your RealMedia presentation should equal no more than 75% of your target bandwidth. For example, if your target audience has standard 28.8 Kbps modems, your presentation bitrate should be 20 Kbps. Table 6-1 shows the optimum streaming rate for each target connection speed.

Table 6-1. Suggested maximum bitrate for different connection speeds

Target connection speed

Suggested maximum bitrate for streaming files

14.4 Kbps

10 Kbps

28.8 Kbps

20 Kbps

56 Kbps modem

34 Kbps

56 Kbps ISDN

45 Kbps

112 Kbps ISDN

80 Kbps

When choosing a RealAudio codec, keep in mind that different types of sound require higher-bandwidth codecs due to their frequency range. As discussed in Chapter 2, "The Science of Sound and Digital Audio", higher-pitched sounds need a higher sampling rate to be accurately reproduced. Most popular music recordings have a frequency range between 60 Hz to 16,000 Hz, whereas speech primarily resides in the 200 Hz to 5,000 Hz frequency range. Thus, 28.8 Kbps RealAudio clips can reproduce frequencies only under 4,000 Hz to 5,500 Hz. Accordingly, a 28.8 codec can reproduce speech quite well but not music.

You will need a higher bitrate codec for high-quality music broadcasting than for simple speech. Table 6-2 shows the low- to medium-bandwidth encoding options and lists which codecs the various RealPlayers support. Make sure that some of the codecs you use support older 2.0 player versions.

The table also lists each codec's frequency response. The higher the frequency response, the better the audio quality. Notice that the newest G2 codecs produce a much higher frequency response resulting in greatly improved music playback than older codecs. To view the full table, go to the RealAudio 5.0 Content Creation Guide.

Table 6-2. RealAudio's bandwidth codec chart (from low to medium)

Audio Codecs Supported

Players Supported

Frequency Response

Comments on Codecs

5 Kbps Voice

G2, 5

4 kHz

 

6.5 Kbps Voice

G2, 5, 4

4 kHz

 

8 Kbps Voice

G2, 5, 4, 3, 2,

4 kHz

Superceded by 8.5 Kbps Voice Codec

8 Kbps Music

G2, 6

4 kHz

Generation 2 Codec

8 Kbps Music

G2, 5, 4

4 kHz

 

8.5 Kbps Voice

G2, 5, 4

4 kHz

DolbyNet Codec

11 Kbps Music

G2

5 kHz

Generation 2 Codec

12 Kbps Music

G2, 5, 4

4 kHz

DolbyNet Codec

15.2 Kbps Voice-Mono

G2, 5, 4, 3, 2

4 kHz

Superceded by 16 Kbps Voice Codec

16 Kbps Voice-Mono

G2, 5

8 kHz

Highest bitrate Codec for voice

16 Kbps Music-G2 Mono

G2

8 kHz

Generation 2 Codec

16 Kbps Music-G2 Low Resp.

G2, 5, 4

4 kHz

DolbyNet Codec

16 Kbps Music Mono Medium Resp.

G2, 5, 4

4.7 kHz

Suitable for Pop/Rock music DolbyNet Codec

16 Kbps Music Mono High Resp.

G2, 5, 4

5.5 kHz

Classical Music -- DolbyNet Codec

20 Kbps Music-G2 Mono

G2

10 kHz

Generation 2 Codec

20 Kbps Music Stereo

G2, 5, 4, 3

4 kHz

DolbyNet Codec

6.3.2. Using the RealEncoder

There are several methods and tools for converting standard WAV, AIFF, or SND audio source files into the appropriate RealMedia .ra and .rm formats. The cheapest and simplest way to encode files is either to use the free RealEncoder available on the RealNetwork's web site or to export your files from an editing and recording application, such as CoolEdit, that supports .ra and .rm file extensions. The better alternative for .ra and .rm file conversion, if you can afford an extra few hundred bucks, is to usea batch conversion application such as Wave Convert Pro by Waves or BarbaBatch by Audio Ease. See Appendix A, "Creating the Ultimate Web Sound Studio: Buyers Guide and Web Resources" for more information about these applications. These batch conversion tools feature superior processing and file optimization capabilities and will make mastering your source files into high-quality RealAudio clips a much easier process. Here is a description of the options in the RealEncoder 5.0:

File Information

In the Properties section of the RealEncoder window, you can enter title, author, and copyright information for your output file. This information is displayed in the player.

Mobile Playback

RealPublisher features a Mobile Playback option, which enables users to download your audio clips for playback at a later time or via an alternative playback device.

Selective Record

To let RealPlayer and RealPlayer Plus users save your RealVideo or RealAudio clips to disk, click Selective Record before you output the file. If you frequently use the same codecs or copyright settings, you can set your default settings in the RealEncoder 3.0 Preferences window.

Using Templates

RealEncoder and RealPublisher 5.0 come with predefined templates comprised of various codecs that enable you to encode your content specifically for your target audience. You can adjust these templates or define a new one to optimize the type of audio and video you are encoding. You can select one or more templates that best suit your needs.

To create a custom template, select Custom from within the Advanced window on the RealEncoder 5.0. If one of the predefined templates does not achieve the effect you are looking for, you can modify the parameters and save it as a new custom template. Make sure to save the template as a new file so you do not overwrite the predefined template.

Setting the proper timeout values

Before batch-encoding, make sure to change the default timeout value from 60 seconds to a greater value -- such as 9,000 seconds -- to ensure adequate time for encoding all your files.

6.3.2.1. Encoding RealAudio with a batch processor

Running files through the RealAudio encoding algorithm is a time-consuming process. If you have to process dozens or hundreds of sound files at a time, a batch processor application can save hours and days of work. Wave Convert Pro for Mac and PC and BarbaBatch for Mac are great batch conversion and mastering tools. Wave Convert Pro and BarbaBatch will import an entire folder of audio files, normalize them, perform EQ enhancements, and convert them to RealAudio clips on the fly.

Video capture cards

Looking for the best video capture card? The Osprey 100 ($199) for Windows NT is the most highly recommended one on the market. In fact, it is the card RealNetworks uses for all their live video capture needs. If you have a reasonably good sound card installed, the audio sync is as good or better than more expensive cards with on-board audio, according to RealNetwork engineers. To capture video from a VHS tape, first capture the footage to an uncompressed AVI file, then compress it in non-real-time. (This takes large amounts of disk space, however.) You can find the Osprey 100 at http://www.real.com/products/tools/.

Most video capture cards have a 2 GB AVI file size limitation. Some video card manufacturers purport to have solutions to break this barrier. However, the SGI is the only platform that truly supports 2 GB+ video file formats. RealNetworks has an encoder for the SGI IRIX OS, which in conjunction with the video file format, offers the best solution for long format video clips.

Advanced users can use the command-line RealAudio utilities for batch processing of multiple files. Within the DOS command line, you can automatically encode several files sequentially by using the following syntax:

RVBatch RVEncode.exe options  

Table 6-3 lists the command-line batch encoding options in the Rvencode directory.

Table 6-3. Command-line batch encoding options

Option

Description (default in parentheses)

/I

Use this option to specify an Input File.

/O

Use this option to specify an outfile or directory -- Output File Name or Directory (infile.rm or dir\YYYYMMDDHHMMSS.rm).

/L

Use this option to specify Use Live Input.

/S

Use this option to specify server[:port]/file -- Server Name, Port, and File (Port 7070).

/W

Use this option to specify password -- Server Password.

/D

Use this option to specify hhh:mm:ss -- Maximum Encoding Duration (continuous).

/A

Use this option to specify an Audio Codec (0).

/V

Use this option to specify a Video Codec (0).

/F

Use this option to specify a frame rate -- Frame Rate (Optimal).

/B

Use this option to specify total Kbps for clip (100).

/N

Encoding Speed range 1 to 5, where 1 = normal, 5 = fastest (1).

/M

Optimal Framerate Bias, where 1 = sharpest image, 3 = smoothest motion (2).

/Q

Use this option to specify Quality, 1 to 100 (100).

/T

Use this option to specify a Clip Title.

/U

Use this option to specify a Clip Author.

/C

Use this option to specify a Clip Copyright.

/R

Use this option to enable Selective Record. Valid options are Disabled and 1 Enabled (1).

/K

Use this option to enable Mobile Playback. Valid options are Disabled and 1 Enabled (0).

Macintosh users can use AppleScript to batch-encode audio files. Table 6-4 describes the encoding parameters for Macintosh. These can also be obtained by opening the RVBatch Dictionary installed with the RealEncoder.

Table 6-4. Macintosh encoding parameters

Parameter

Description

encode 

Use this option to specify an Input File.

output 

Use this option to specify an FSSpec or full pathname of the output file.

audio 

Enable audio encoding.

using audio codec 

Audio codec name.

video 

Enable video encoding.

using video codec 

Video codec name.

at frame rate 

Frame rate.

optimal bias 

Determines the behavior of optimized encoding and can be one of the following options: sharpest image, normal, or smoothest motion.

cropping 

Sets the cropping rectangle and follows this form: top, left, bottom, right.

at bitrate 

Total bitrate.

at quality 

Video quality setting (1-100).

encoding speed 

Speed of encoding -- the faster the speed, the less the quality of the encoding. Can be one of the following options: normal, medium, fast, faster, or fastest.

title 

Title string.

author 

Author string.

copyright 

Copyright string.

Mobile Playback 

Enable Mobile Playback.

Selective Record 

Enable Selective Record.

Preparing and encoding audio for RealVideo broadcasting

 

Audio quality is the biggest tradeoff when preparing content for low-bandwidth RealVideo. Because video is so data-heavy, only a small percentage of the bandwidth can be allocated to audio. For most RealVideo broadcasts, better picture quality takes priority over audio quality.

 

At Fox News, RealVideo clips generally contain shots of newscasters talking. Stationary video footage of "talking heads" are ideally suited for low-bandwidth RealVideo encoding. If there is little motion in the video feed, you can set the ratio settings in favor of video quality while still preserving speech intelligibility.

 

According to David Dadekian, technical director for Fox News, the RealVideo 20 Kbps stream allocates 6.5 Kbps to audio and 13.5 Kbps to video. The 50 Kbps Fox News stream allocates 8.5 Kbps to audio and 41.5 Kbps for the six frames per second video. Devoting a higher ratio of bandwidth to video preserves picture quality. Raising the audio portion of the audio-to-video data ratio degrades the respectable 176-by-144 pixel video quality.

 

For some content, increasing the ratio of video bandwidth will not help picture quality. High-motion video, such as sports footage with rapid action or music videos with dancing, are not suited for low-bandwidth codecs. For instance, video clips of regular season NBA basketball highlights encoded with the same settings used for Fox News footage resulted in indistinguishable blurry pictures. Reducing the frame rate of the basketball reel produced a higher-quality picture.

 

The best approach for encoding sporting events is to create a slide show with the video set to one image per second and the rest of the bandwidth allocated to audio. You do not get true video action, but at least you get high quality stills.

 

Encoding video content with music requires a higher ratio of bandwidth dedicated to audio. Music content is generally unacceptable at the audio rates of 6.5 Kbps and 8.5 Kbps used by Fox News. When David encodes RealVideo clips with music content for TV Guide Entertainment Network, he sets the audio at a minimum of 15 Kbps. For a 50 Kbps stream, he sets the audio at 32 Kbps and the video at 18 Kbps. Setting the bandwidth ratio at 32 Kbps/audio and 18 Kbps/video produces an engaging slideshow of one image per second with good music quality.

Once you have encoded your source material using the appropriate RealAudio codecs, you are ready to stream your RealMedia files with the RealServer.

6.3.3. Broadcasting audio with the RealServer

To broadcast audio with the RealServer, you can either install your own RealServer or contract with an outside service provider to host your RealMedia content.

If audio is a small component of your web site, you probably want to consider installing a 25-stream Basic RealServer available for free at the RealNetworks web site. If you need more streams or advanced features, you will need to consider one of RealNetwork's commercial server options, which range from $695 to $30,000, depending on the range of simultaneous streams you need and extra features you want, such as live broadcasting, RealFlash broadcasting, and commerce functionality. Visit RealNetworks' Servers and Solutions page at http://www.real.com/solutions/servers/index.html.

If audio is an integral part of your web site and you broadcast to a large audience of more than 1,000 simultaneous listeners, consider using a third-party hosting service that guarantees superior reliability, fault tolerance, load balancing, and a number of simultaneous streams. For example, the RealNetworks Broadcast Network can support up to 50,000 simultaneous unicast streams. You can find a list of RealMedia-qualified ISPs at http://www.real.com/solutions/partners/isp/index.html.

6.3.3.1. RealServer installation

Installing and configuring a RealAudio Server is a four-step process that entails:

  1. Downloading the appropriate platform-specific server package from RealNetworks

  2. Running the automatic installation process

  3. Launching the server

  4. Testing the server to ensure audio playback

One of the strong points of the RealSystem is easy automatic installation for a variety of popular platforms including Unix, NT, Windows 98/2000, and Macintosh. Once you have purchased and downloaded the appropriate RealServer package, run the automatic installer application to configure the settings for your platform. The RealServer installer asks a series of simple questions regarding personal information, directory names, and default port setting options, then automatically installs itself on your system with the appropriate settings.

To install the RealServer on a Unix machine, create a separate directory to hold all of your RealAudio clips before launching the application. Do not place the RealServer under the root directory; instead create a separate directory with its own user ID to prevent access to your machine (Unix). Once you have placed the RealServer and all of its corresponding files into a separate directory, launch the server from the command line.

Make sure to type in a command in the boot script so that your machine will launch the RealServer whenever the computer is re-booted.

Finally, make sure you test your RealServer by connecting a web browser via HTTP to the RealAudio port 7070 (http://yourservername:7070). This port has a link to pre-installed stock audio samples for testing, so you don't have to encode your own test file. The RealServer diagnostic test detects that you are making an HTTP request rather than a standard RealAudio request and generates system reports on the fly. If you hear the audio playing back, you should be ready to stream RealAudio.

6.3.3.2. RealServer system requirements

To run your own RealServer, you need the following items. (For more detailed information, refer to the RealAudio Server documentation located at the RealNetwork's Developer Zone.)

6.3.3.3. Using bandwidth negotiation

Once you have installed the RealServer or found an ISP running one, use bandwidth negotiation to manage the delivery of RealAudio content. Bandwidth negotiation checks the listeners' modem speed settings then sends the appropriate stream for their bandwidth. If you encode three or four versions of your audio clip, you can reach a wider audience by offering low-bandwidth users a smaller compressed RealAudio clip and high-bandwidth users a CD-quality clip. Note that when bandwidth negotiation checks the connection setting of the client player, the player reports the speed at which it has been set, not the speed of the actual network connection.

In most cases, bandwidth negotiation works fine. On occasion, however, the RealServer overestimates a RealPlayer's "real" connection speed. Many web developers run into problems because the default setting of the RealPlayer is 28.8. This setting may not be optimized for the user's available bandwidth. Frequently, RealPlayer bandwidth preferences are set too high for the actual available data throughput. If a user clicks on a link to a RealMedia clip that streams at too high a data rate for the user's real connection speed, a somewhat cryptic error message will appear indicating that the network connection or CPU speed is insufficient to view the content.

Selecting the right TCP/IP port

If the RealServer is configured on the same machine and IP address as the web server, the web server's TCP port must be changed. The RealServer uses the standard TCP Port 80 for its "cloaking," so the web server has to be relocated to Port 81 or any other available TCP port. A single machine also could have two IP addresses with the web server bound to the first IP address and the RealServer bound to the second.

RealSystem G2's SureStream technology promises to alleviate this problem. The RealPlayer G2 "switches down" to a lower bandwidth without rebuffering the clip when a user's Internet connection degrades or when the user's bandwidth was misjudged. RealEncoder G2 with SureStream generates one master file that includes several different bandwidth settings. In the future, as older players get upgraded, the G2 Encoder will make it easier to reliably stream RealAudio content.

If you are using RealServer 5.0, include a separate file for 28.8 Kbps modems, 56 Kbps modems, and ISDN connections along with one or two files for older players. For example, if you want to encode an important tradeshow presentation so people with 14.4, 28.8, and 56 Kbps modems can listen, encode the live audio to three different files or capture the audio to a .wav first and then encode it three times.

To stream a presentation using bandwidth negotiation, follow these steps:

  1. Encode your audio content into at least three separate files:

    • 14.4: Encode one file at 5 Kbps, 6.5 Kbps or 8.5 Kbps

    • 28.8: Encode a higher-bitrate file with a maximum of 20 Kbps

    • 56: Encode a final audio clip with a 40+ Kbps stereo or mono codec

  2. Create a generic directory (not a file) in the RealServer Content directory: C:\real\server\content\tradeshow.ra.

  3. Place the files generated in step 1 into that directory. For example:

    C:\real\server\content\tradeshow.ra\tradeshow_14.ra

    C:\real\server\content\tradeshow.ra\tradeshow_28.ra

    C:\real\server\content\tradeshow.ra\tradeshow_56.ra

  4. Change the filenames to the following (as listed in the Content Creation Guide):

    C:\real\server\content\tradeshow.ra\pnrv.18

    C:\real\server\content\tradeshow.ra\pnrv.36

    C:\real\server\content\tradeshow.ra\pnrv.43

  5. On your web page, reference the files as pnm://yourservername/tradeshow.ra.

Be sure to add RealAudio 2.0 codecs for people using 2.0 players. Use RealEncoder 3.0 to create RealPlayer 2.0 compatible codecs. Remember, you will have to manually name the files generated by the RealEncoder 3.0 and place them in the proper folder.

The RealSystem is a versatile tool that does much more than bandwidth negotiation. Let's take a look at some of the other advanced RealSystem features and encoding techniques.



Library Navigation Links

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