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:
Start with a high-quality digital audio tape or CD when transferring audio to your computer.
Set the input levels into your sound card as high as possible without distorting.
Remove all unwanted noises and sound artifacts in your original source files with a sound editor.
Make sure to start with a stereo 44.1 kHz 16-bit audio file when encoding to lower-bandwidth audio codecs.
To create the best quality RealAudio clips:
Normalize your sound files to 95% of the maximum dB level.
If your clips do not have enough bass or treble, try boosting the low-end or high-end frequencies in your sound file before encoding to a particular codec. For bass, use EQ to increase the low-end frequencies in the 100 to 200 Hz range. For treble, boost the high-end frequencies from 5,000 to 8,000 Hz. Remember, anything higher than 8,000 Hz will get cut when you compress the file using a low-bandwidth setting. For voice, the sweet spots to boost are 500 Hz and 3,500 Hz. Boosting the bass frequencies for voice below 250 Hz may have little effect or may cause distortion of the voice.
If you are encoding for low-bandwidth codecs (14.4 and 28.8), use a low-pass equalization filter to cut frequencies above 10,000 Hz. (For a comprehensive overview on how to capture and edit high-quality audio, see Chapter 3, "Capturing Original Source Material" and Chapter 4, "Optimizing Your Sound Files".)
Avoid flat or dull-sounding RealAudio clips by adjusting the amplitude of your signal with a sound editor instead of recording directly into the RealEncoder. Recording into a sound editor maximizes the available dynamic range.
Prevent signal clipping by making sure that loud sounds in your original audio file signal do not exceed the acceptable amplitude levels. Clipping or "going in the red" can give rise to harmonic distortion in the form of clicks or crackling sounds on playback due to the introduction of odd harmonics. If your source file contains a clipped signal, your final RealAudio or RealVideo file will have high-frequency background noise or static. Lowering the input volume will help reduce clipping.
Limit excessive low-frequency noise by eliminating any DC offset. (DC offset occurs during the analog to digital conversion process when the 0-point in the waveform isn't actually at but offset either above or below. AnalogX (http://www.analogx.com) offers a Direct X plug-in that corrects DC offset errors. The AnalogX DC Offset plug-in is compatible with any Direct X application such as CoolEdit, Cakewalk, WaveLab, Paris, etc. DC offset is commonly produced in cheap PC sound cards. Several editing applications have built-in settings for fixing DC offset.
Ensure proper grounding in audio equipment to prevent AC 60 Hz line noise. If AC line noise is present in your audio files, you can partially remove it with EQ by lowering the frequency range that contains the noise. You can also try using special noise reduction software to perform this task.
In low-bitrate encoding, every bit of bandwidth is important. Every bit wasted on noise reduces the number of bits allocated to the desired content, thus reducing the quality. Noise includes any audio information other than the desired content such as background noise, distortion, quantization noise.
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.
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.
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 |
|
8 Kbps Music |
G2, 5, 4 |
4 kHz |
|
8.5 Kbps Voice |
G2, 5, 4 |
4 kHz |
|
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 |
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:
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.
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.
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.
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.
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.
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.
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. |
Once you have encoded your source material using the appropriate RealAudio codecs, you are ready to stream your RealMedia files 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.
Installing and configuring a RealAudio Server is a four-step process that entails:
Downloading the appropriate platform-specific server package from RealNetworks
Running the automatic installation process
Launching the server
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.
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.)
A computer running one of the supported operating systems: Macintosh System 8 or greater, Digital Unix v3.2, Microsoft Windows NT 4.0, Solaris 2.5, Linux 2.03, Sun OS 4.1.x, Silicon Graphics IRIX 6.2 and 6.3.
Space on the computer's hard disk for the RealServer software and RealAudio clips. You need upwards of 1 GB or more of hard disk space if you are serving high-bandwidth streams with bandwidth negotiation. One 6- to 10-minute audio file encoded with a range of high- and low-bandwidth codecs for bandwidth negotiation requires 15 MB to 20 MB of disk space. If you have disk space constraints, stick with low-bandwidth codecs.
A network connection with sufficient bandwidth to serve your users. For each listener connected to the Internet backbone, the RealServer requires at least 10 Kbps for 14.4 format and 20 Kbps for 28.8 format. A T3 line, for example, could stream 4,500 simultaneous streams. See Table 6-5 for the number of approximate streams for each bandwidth connection.
Network connection |
Number of 14.4 Kbps streams |
Number of 28.8 Kbps streams |
---|---|---|
ISDN (128 Kbps) |
12 |
8 |
T1 (1.5 Mbps) |
150 |
90 |
T3 (45 Mbps) |
4,500 |
2,700 |
A web server that supports configurable MIME types. RealServer works with the following web servers:
Website for Windows NT
Apache 1.1.1 and higher
Mac HTTP
HTTPD4Mac
Netscape Netsite and Netscape Enterprise Server
Microsoft Internet Information Server (IIS)
NCSA HTTPD (v 1.3, 1.4, 1.5)
CERN HTTPD (v3.0)
EMWAC HTTPS 0.96
Spinner 1.0b12-1.0b15 / Roxen 1.0
Webstar and Webstar PS
Sufficient processor and memory capacity. RAM, not processor speed, is the gating factor for the computer running RealServer. A 90 MHz Pentium processor, with enough available bandwidth, can simultaneously deliver at least 500 28.8 streams. For example, Real Audio Server 3.0 requires 20 KB RAM for each simultaneous stream. A stream of 60 simultaneous audio files requires approximately 4 MB of available RAM. 1,000 streams requires 70 MB of RAM, and so on.
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:
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
Create a generic directory (not a file) in the RealServer Content directory: C:\real\server\content\tradeshow.ra.
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
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
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.
Copyright © 2002 O'Reilly & Associates. All rights reserved.