Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Channels ▼

Streaming Media Crash Course

, January 01, 2002

WebReview.com: August 3, 2001: Multimedia Developer: Streaming Media Crash Course

In last month's column, I preached the virtues of using Flash while decrying the fact that streaming media still needs more bandwidth to provide a pleasurable experience for all. This isn't to say that Flash can or should replace streaming media altogether, as video and audio use on the Web continues to rise at an exponential rate. As a matter of fact, RealNetworks (the overwhelming leader in the streaming market) claims that there are 200 million registered users of RealPlayer.

Television broadcasts took radio broadcasts to a new level, now streaming media looks to do the same to television. Streaming media is here to stay, and if you're working within the Web industry, it would be wise to learn a little about how it works.

The Basics

Before we start, let's take a look at a recipe of what we need to begin:

Select a good audio recording.
If you're not sure how to get good sounding audio, check out my audio how-to.

Select a video that will translate well.
Heck, I could write a full article on this topic alone. Basically you will want to keep your camera movements down to a minimum. Constant panning or zooming doesn't come out pretty when you try streaming it on the Web. Also try to keep your background simple. A solid background will lend itself better to having your subject stand out a bit more, where complex backgrounds tend to blend in with the subject, causing digital artifacts upon streaming. Most importantly, use a tripod if you can, otherwise your video will be looking like you filmed onboard a ship during a rough day at sea.

Install a video capture card.
This of course only applies if you plan on streaming video across the Net. Most computers you buy from major retailers will have an audio card installed, so we'll assume you have one already. You won't often see a video capture card come with your stock PC tower though. With a video capture card you can take the video and audio input of a given video source (like your digital camera or camcorder) and write it to your hard disk in a number of formats.

Get a multimedia program.
If you didn't know already, audio and video files are generally huge. In order to get your media down the narrow pipe that is the Internet, you have to change it a little. This is done through encoding your files, utilizing whichever codec (compress-decompress) your favorite program uses. By encoding your files, you take your original format and change it into a file which allows for more efficient streaming and a much smaller file size.

There are many programs to choose from, but chances are you are going to want to keep it simple. With RealProducer, you can transform most video or audio files into RealMedia files, which you will use for your streams. Although the program is a little pricey ($200), it will probably be just about all you need if you are concentrating solely on using RealMedia, and it's perfect for beginners.

If you're just going to be streaming audio, you'll do fine with CoolEdit or SoundForge, two of my favorite audio editing programs. Both of these are under $100, can save your audio files to a host of formats (mp3, wav, Realmedia, and so on) and you can get some pretty cool plug-ins that are rather inexpensive as well.

If you're looking for the absolute best, you'll want to turn to Terran's Media Cleaner 5, which will transform any media file into just about any format you can think of, while using a compression codec that keeps your file size to an absolute minimum without degrading the quality.

Choose a method of delivery
You can stream your media using the HTTP protocol, but I wouldn't recommend this if you get fairly heavy traffic to your Web site. The HTTP protocol ties up a server for long periods of time, as streaming media requires a constant flow of packets, so you end up with a dedicated connection. If you're interested in goofing around with streaming media or don't expect a heavy amount of traffic, using HTTP will work just fine for you.

For those who want to reach a wider audience, you'll need a server installed with some kind of streaming software. If you are renting server space from an outside source, make sure they have streaming software installed and that their license is up to date. If you have your own server and are interested in getting some software that will enable streaming, you have to make a choice between using services from Real, Quicktime, or Microsoft.

RealServer or QuickTime Streaming Server seem to be the best choices, as both have come to an agreement in which each company's software can stream both RealMedia and Quicktime streams, which makes sense since both use the industry-standard Internet protocols RTP and RTSP. RealServer costs a bit of money depending on your needs, and Quicktime is free, the drawback being that in order to use it, you must have Mac OS X running on the server side.

Microsoft on the other hand continues to be the lone gunman. They provide streaming software that is free, the only problem is that you have to be running an NT server in order to use it (insert your favorite security joke here). Currently the market leaders are Real and Quicktime, and seeing as Microsoft only allows its own format to be streamed, I can't recommend them as the most viable choice.

All Ready, What Next?

Once you have all your files in tip-top shape, upload them onto your server. If you are using Quicktime or Windows Media, just point to the file from wherever you want to link it from. If you are using Real, you have a couple of options of ways to point to your media. One way is to create a .ram file, which is simply a text file that contains the URL location of your media clip on your server. You then put a link pointing to that .ram file from your Web page. When the user clicks on the link, the .ram file tells RealPlayer to launch, and feeds it the URL that is in the .ram file.

A second way is to use a special feature on RealServer called ramgen (I believe that stands for .ram generator). By using ramgen you eliminate the need to write a separate .ram file. The URL that points to your media file will be just the path that you would have put into a .ram file, but you add the /ramgen/ parameter, which will fire up RealPlayer on the user's computer. For example, a link using ramgen will look something like this:


Where realserver.yourservername.com is the address of your server, 8080 is the port (8080 is the default, check with your server admin), and yourmedia is the name of your file.

More Complex Presentations

If you're looking to do more that just stream an audio file or a simple video, you may want to take a look at upgrading to Quicktime Pro, which gives you the power to do some nice interactive presentations, including digital slideshows and utilizing Flash. If you're like me and like to "roll your own", you might want to check out programming your presentations in SMIL, an easy to learn language which allows you to piece together and arrange your media files in the order that you would like them to appear, and puts them together as a single stream. For more on SMIL, check out my introduction to the language.

The demand for broadband access (thanks to Napster and other file-sharing networks) only increases the viability of streaming media. It's no doubt that traditional media and digital media will continue to merge, just as radio and television did years ago. Streaming media may seem less than satisfactory at times, but it will continue to get better as time goes on and broadband deployment continues. Now that you've read this article, you've got all you'll need to start Webcasting today. Have fun!

Steve is the founder of Lost Dog Found Music, a music industry service that places songwriter's music with publishers and record labels, and an author and producer for the O'Reilly Network.

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.