Monday, January 1, 2007

How to stream

As the Internet continues to play a larger and larger role in our lives, the role of the radio station must change to suit the times. With the introduction of audio streaming, listeners can access stations around the world. For a minimal investment, we can grab those listeners. Radio can take advantage of this new medium with two types of streams: static and live.

Static streaming takes a pre-recorded sound file and delivers it on demand. The file is recorded, then encoded and archived on the server hard drive. Good examples are demos, feature length programs or archived programs. This type of streaming does not require the use of a dedicated audio stream server. It can be streamed right off of your Web server to the client player. Some players begin playing the file before it is done downloading (quickstart), which is helpful for large sound files. Static streaming is supported by a variety of common audio file formats including .WAV, RealAudio, Quicktime, .WMP and .MP3.

Live streaming is a continuous audio feed that is always being encoded and delivered. The transmission side of a live streaming setup requires two main pieces of equipment: the encoder, which converts the audio signal to the delivery format, and the server, which accepts the single stream from the encoder and distributes it to the end user's client software.

Choosing a system


There are a growing number of streaming systems competing for dominance in the marketplace. Choose a system that compliments your audio and has players for every possible combination of hardware. Any system you choose will sound good at high bandwidth, but the trick is to choose a system that sounds good for low-speed users. It may pay to optimize your audio stream to the lowest common denominator.

Once a system has been chosen, decide how your stream will get onto the Net. There are a variety of ways in which to stream live audio.


1) Encode the audio at your facility and send the output of the encoder to a streaming provider. This is usually done with an encoding computer at your facility and a fixed Net connection — either a DSL or fractional T-1 to the provider. If you send your stream to a provider via DSL, remember that Net congestion and outages can affect streaming to all of your users. Some streaming providers insert advertising or picture clips in the player before the audio plays. Read your agreement carefully to be sure any ad insertions are appropriate for your station.
2) Encode the audio at your facility and send the output of the encoder to an in-house server. This requires at least a full T-1 access to the Internet. Top level access, providers that give direct access to the Internet backbone, is available through carriers such as UUnet, Verio, Digex, AT&T CERFnet and Exodus.
3) The third choice is to send your audio to a facility or ISP and have them handle the whole thing. This was the most common way to stream in the beginning. In many cases, a tuner was placed at the ISP and streamed directly to the Net. This method is the simplest, but a tuner feed of your air signal is usually a disaster unless you have a classical station with little to no processing on-air. Limiter by-products that are of little consequence to the air signal wreak havoc with the encoder. The extra harmonics and information cause distortion and noise in the decoded audio stream.

Nuts and bolts


Let's go through an on-site streaming system with Apple's Quicktime, and RealNetworks' Real Audio 5.0 and G2. These are the three systems we serve at WDUQ.

Prepare the audio with proper processing and equalization. Processing for the Net is different than processing for on air. Avoid traditional air-chain limiting and processing because heavy limiting does not work well with the encoder algorithm. Equalization ahead of the AGC is important, not to change frequency response, but rather to remove the frequencies that the encoder cannot pass. By placing the EQ ahead of the AGC, the AGC will not react to the frequencies that will not be heard anyway.

Listen on the player that your listeners will most commonly use. Adjust the processing while listening to a decoded signal. You want to hear the effects of the algorithm path. Hear what the user hears, just like adjusting air chain processing while listening carefully off air. There can be a considerable delay between the encoder input and audio decoder output, so take your time with adjustments. Many new processors are designed just for Internet encoding and have the settings and processing power needed for clean streaming.

Setting up an encoder


PCs and Macs work well as encoders. PCs should have a fast, modern CPU (Pentium class and at least 128MB RAM), a good sound card and network interface card (NIC). Older PowerPC Macs work well (128MB RAM and 100MHz PowerPC minimum). We encode on leftover Macintosh 8100s. Since Macs have very good on-board audio, a separate sound card is not needed. We use RealProducer software for our RealAudio streams and Sorenson Broadcaster with a Q Design PRO codec for our Quicktime streams.

The bit-rate speed is set at the encoder. Setting the speed too high will prevent modem users from receiving your stream. Setting it too low degrades audio quality. While cable modems and DSL are becoming more popular, a typical radio station will serve most of its users by POTS modem. Most of these users are still connecting at 28.8- to 33kb/s despite the availability of 56k modems. Some encoders, such as RealAudio's G2, are able to provide both higher speeds to users who can handle it and lower speeds to modem users. This is a great advance for streaming and really helps give you better choices.

Setting up the server


You have a choice of several server platforms. We chose UNIX because it is a mature, reliable and well-established operating system. I obtained a refurbished Sun Microsystems workstation for $50 and went to work. I was amazed to see how the older, smaller and slower 50MHz UNIX machine could handle the Real 5 server without being overtaxed. We later upgraded to a larger multiple processor, a Sun SparcServer1000E. We also added the Quicktime server and Realaudio G2. One workstation runs all three by setting the input and output control to different ports for each service.

I recommend downloading the free versions of the server software to determine your needs and get a sense of how many users you will have. RealNetworks offers a free 25-user G2 server, and Apple offers a free 1,000-user Quicktime server. Buying a streaming server license based on concurrent users may not be wise because it may be overkill. It does not take much traffic to saturate a T-1.
______________________________________
______________________________________
______________________________________
How to Stream Video

Four Basic Steps:
Creating, digitizing and streaming video is an extremely complex process. The following is a vastly oversimplified outline of how to stream video. If you decide to actually do this, be prepared to spend MANY hours, lots of money (on a fast PC with a HUGE hard drive) and suffer through multiple system crashes.

Step 1: Creating Content.
Video content can be created through traditional means such as a camera, camcorder or VCR. However, the type of film and the filming technique will greatly affect the clarity of the resulting video stream.

Step 2: Digitizing the Video.
The resulting video must be transformed into a digital file. This is accomplished by using a computer equipped with a video capture card installed. The VCR, camcorder or other video device is connected directly to the capture card via standard RCA cords or S-video cords. An S-Video connection will give you better quality. Video editing software such as Adobe Premiere can be used to run the capture card, and edit the resulting file.

Video can be captured in a number of ways, and each setting will effect the ultimate quality of the resulting video. Some settings work better than others with various encoding methods (see next step). Furthermore, capture cards often perform their own hardware compression which may or may not work well with the encoder you choose.

Step 3: Compressing/encoding the Video.
The resulting digitized video file is far too big to transmit over the Internet. The file must altered to reduce it's size. There are many software packages that use different algorithms to accomplish this task. Once encoded, the files are usually only viewable on the player associated with the encoding software vendor. Some of the leading encoders include; Real Video, Vivo, VDO and Streamworks.

Most encoders provide numerous options for encoding at various speeds, levels of image quality and smoothness of motion. At this point it is really a zero-sum game; better resolution means fewer frames per second and vice versa. Setting a higher transmission rate vastly improves both image quality and fps.

There is no "best" way to encode video. It depends on content of the video (animation, fast motion, talking head) and the upper limit of transmission speed that is available. Most articles recommend encoding several ways, and viewing the results on a control PC.

Step 4: Serving the Video.
Once the video files are created, they must somehow be served to clients. The simplest method is to download the entire video file, and then view it with a plug-in or helper application. "Raw" video files are typically quite large, however, and the user is not able to begin viewing the video until the entire file has been downloaded. An example of this method would be a Windows Movie (.avi) file.

A second technique is often called pseudo-streaming. This technique allows for playback as soon as enough data has been downloaded to fill a playback buffer. The required size of the buffer is dependent on the overall quality of the video, the speed of the connection, and in some cases the length of the video. The object is to maintain some data in the buffer at all times, to prevent disruption of the video playback. One example of this technique are Vivo encoded files (.viv). The Apple Quicktime plug-in also allows psuedo-streaming for regular Quicktime (.mov) files.

The last technique, aside from analog methods, is "true" streaming. Like pseudo-streaming, the viewer software maintains a buffer of data, which it uses to playback without having to download the entire file. Typically the encoding software greatly reduces the file size of the original video. The technique then takes advantage of a specialized server (which works in conjunction with a web server) to manage the stream of video between the server and the client. The server can dynamically modify the rate of transmission based on network congestion and other factors, greatly improving the quality of the delivered video. This also allows the user to "skip ahead" to a later portion of video, without needing to download the earlier portion. An example of this technique would be Real Video (.rm) files served by a Real Video server.

0 comments: