Adding Streaming Media (Audio and Video)  to Your Web Site
 
 Click the Play button to see the introductory video (1:55)
Requires the Windows Media Player

You may have seen audio or video used effectively on the web, and want to add some to your own web site.  This can be especially effective if you are teaching online and do not ordinarily speak face-to-face with your students.  What is missing from some online classes is the direct expression of learning cues from professor to student.  These can and are delivered in print, of course, but they can become much more meaningful when they are heard in an audio file or even seen and heard, emphasizing the professor's body language, in a video file.

Streaming Media Examples from Palomar College

Though the process can seem daunting at first, it is only moderately difficult once the initial concepts are understood. At Palomar College, there is in-person help available to Palomar staff all along the way through the Academic Technology departmentWe will be glad to help you produce and mount your media project.  If you wish to do it yourself, however, be aware that any media work, especially the initial recording of the media, requires patience and practice.  This page is a beginner's guide to adding audio and video, primarily streaming audio and video, to your web site.  If the discussion seems far too technical, call us (ext. 2877 - tgray@palomar.edu) and we will help you with your media projects.

In broad outline, there are the four basic steps:

  1. Create your digital media.

  2. Encode your media for a streaming server.

  3. Mount the media on a streaming server.

  4. Link to the media from a web page.

Click here to see a diagram of the process.

The following provides details, but is by no means an exhaustive discussion.  It assumes the PC platform and the Windows operating system, though Mac and Mac alternatives are discussed.

 Analog vs. Digital

Create the media you want to place on the web.  This means that you must either:

  1. Transfer pre-record media to a computer, for example, music from a CD or cassette tape, video from a VHS tape or captured from a television show. 

  2. Record your own media from scratch, for example, videotape yourself with a camcorder or record yourself speaking into a microphone.

Your source recording will either be in digital or analog format.  If analog, like a VHS video tape or sound recorded on a cassette tape, it must be converted to a digital format before it can be placed on the web.  Special hardware is required to make this conversion.  In the case of audio files, the sound card already installed in your computer is probably capable of doing the job.  In the case of video, a special video capture card is required.

In addition to hardware, software is also needed to convert analog to digital.  With audio files, there is a good, free alternative, but with video, the software required will usually come with your video capture card, or can be purchased separately. 

On the other hand, if your media is recorded digitally in the first place, like from a digital camcorder or audio spoken into a media recorder on your computer, it is not necessary to convert it further, though it may be necessary to use software to edit it.  In the case of audio, an original digital recording will yield far better results, and generally be much easier to work with, than a recording converted from analog to digital.  With video this is also true, but to a lesser extent.

The idea with capturing or recording media files is to get them into an uncompressed, or raw, digital file format, which can then be compressed--in order to reduce their size--for the web.  For video files, this will either be an AVI or MOV  format; for audio files, either a WAV or AIFF format.  This discussion will concentrate on the PC world, so it will discuss Microsoft AVI and WAV formats.  Remember, AVI files store uncompressed video data (usually comprised of both video and audio tracks), and WAV files store uncompressed audio data.  These files can be enormous, especially in the case of video files.

Creating these initial files is by far the most difficult part of the process, especially if editing is required and you are combining multiple files into a single file.  There is no substitute for practice with your software of choice when doing this.  If you want to edit video files, Adobe Premiere is the Cadillac editor (at least in any normal person's price range), but there are many low cost alternatives--usually those that come bundled with video capture cards.  The question to keep in mind when picking a video editing program is: can the program read and write uncompressed AVI files?  If so, you won't have any trouble preparing files for the web.  You will also need a large hard drive to work with video.  Uncompressed video files are very, very large.

Audio editing programs are much more affordable.  SoundForge FX is a good, low cost (about $60.00) program that will do everything you need.  Audio, on the other hand, usually requires less editing than video, and is, in general, much easier to work with.  A free program like MusicMatch Jukebox may be all you need to create and convert good, digital audio files.  When recording digital audio, the microphone is the most important component.  If you are recording yourself speaking into your computer, setting the sound level on your computer is also important.  Finding the right set up takes some.

Detailed Example:  Click here for screen shots and explanations on how to record yourself digitally using MusicMatch Jukebox.  (This page includes a section on how to set recording volume levels in Windows).

  Compress Files for the Web

Once you have a finished, uncompressed digital master file--either an AVI format video file (which, in fact contains both video and audio tracks, in most cases) or a WAV format audio file, you could place this file on your web site, link directly to it, and when your users click on the link it would invoke the associated media player, download the file, and play it.  In all likelihood, this would be such a painfully slow process, even with a relatively short audio file (unless the recording is extremely short--say a couple of seconds) that your users would lose interest and cancel the operation.  This is because of the enormous size of the original, raw files.  In order to reduce their size, and prepare them for mounting on a media server, they must first be encoded.  Only encoded files (that is, files compressed using a codec--or, code/decode algorithm) can be streamed.

The purpose of encoding is to greatly reduce the media file's size, and to prepare it for efficient use of a streaming server.  Encoded files can be linked directly from web pages, and downloaded and played much as raw AVI or WAV files can, but this is not the same as streaming.  It will occur more quickly for your users than will the raw-file scenario described above, but still not quickly enough, and will probably be jerky and unreliable.  True streaming is done from a specialized streaming server that uses fast, real-time Internet protocols and retains two-way communication with the media player, feeding it as much of the stream as it needs to proceed.  The three most popular types of streaming servers are:

  Microsoft media

  Real media

  QuickTime

QuickTime files can be streamed from an advanced Real server.

Which is the best format?  Good media players for all three types of servers exist for both the PC and Mac platforms.  Let's be practical, though.  Market research indicates that approximately 65% of Internet users have installed the Real media player as their primary media player, 21% the Windows media player, and 14% the QuickTime player.  These numbers are always in flux, but give an idea of the "market" out there. It is probably true that most users have both the Windows Media player (it comes with recent versions of Windows) and the Real player.  Many also have the QuickTime player, but it is definitely less popular. To reach the largest audience in the format they are most comfortable with, it makes the most sense to stream for Real media.  On the other hand, since Real uses proprietary codecs, and since Real servers have a restrictive licensing policy, and sometimes do not get along with firewalls, it is also a good strategy to stream for Windows media.  Windows media servers are based on open standards and do not usually have problems with firewalls--at least in Windows server environments.  Because QuickTime files can be streamed from a Real server, and QuickTime users tend to be Mac users also--a very small percentage of the at-home market--we do not support QuickTime as a dominant format at Palomar College.  This discussion will concentrate on Real and Windows media formats from here on.

So how does encoding happen?  The easiest way to encode a media file is to load it into a video or audio editing program that has built-in plug-ins to encode using one of the popular media formats: Windows media or Real media.  A program like Adobe Premiere or Pinnacle Systems Studio 7 have such plug-ins.

A stand alone program, like Terran Media Cleaner, could also be used.  It is a sort of all-in-one program than can be used to encode many formats--though its performance is quite slow.

If you do not wish to use a for-pay option, the software tools for encoding media files can be obtained free, if you are willing to learn how to use them.  If you wish to encode files for Windows media format, you will need the Windows Media Encoder.  The Windows media encoder is based on open standards and supports many freely available codecs.  If you wish to encode for Real media, you will need the free Real Producer Basic.  Real media encodes for the proprietary Real media format.

Before encoding, a key decision must be made:  what bandwidth target do you want to achieve?  A bandwidth target refers to the speed of the connection your user will have to the Internet.  A high bandwidth target, such as a corporate LAN or home broadband access to Internet through DSL or cable connection can support a larger video picture and higher quality audio than can a limited bandwidth target, such as a 28.8 modem.  As a general rule, this is only truly relevant with video files, not audio files.  High audio fidelity can be achieved in bandwidths as low as those aimed at the 28.8 modem user (though most users these days have at least a 56k modem).  Not so with video.  A video file, even an encoded video file, requires a lot of bandwidth.  Only the smallest, postage-stamp sized video window with a very low-fidelity sound track can be aimed at such a narrow bandwidth target.  For all practical purposes, video at modem speeds can be done, but be prepared for low quality.  The Windows media encoder comes with many pre-sets from which you can choose to help you choose a bandwidth target.  Since Real uses proprietary codecs, its choices are fewer, but both are easy to understand and customize, if need be.

Once encoded, your original raw AVI or WAV file will become a WMV (video) or WMA (audio) file, if you have encoded for Windows media; or a RM (video or audio) or RA (audio) file if you have encoded for Real media.  If you look at the file size, you will notice that it is dramatically smaller than the original, uncompressed file.

Even encoded files can be linked and played directly from a web server, using http protocols, but this is not the same as streaming them.  This is still a download and play scenario which, because the file sizes are much smaller, will occur more quickly, but not as quickly or reliably as true streaming.

 

Detailed Example:  Click here for screen shots and explanations on how to encode a WAV file using Real Producer Basic.

 Streaming Media Servers

To achieve true streaming, an encoded media file must be mounted on a streaming media server.  It is the media server's job to use special real-time protocols and control techniques to stream multiple instances of your file over Internet in a very efficient manner.  Palomar College Academic Technology supports two streaming server formats, Real and Windows media.  The process of mounting your file is simple, and it is the same for both.  First, use our web request form to request a personal folder on one or both of our servers. We will email you the details of how to access your folder.  Usually, we recommend you ftp your encoded media files to your personal folder(s).  If you do not have an ftp program, we recommend the simple to use WS_FTP client program.  The following is a download link for this PC program:

WS_FTP Download

Once you have moved your encoded file to the streaming server, you are ready to create a link to it on a web page.

 

Detailed Example:  Click here for screen shots and explanations on how to ftp your file using WS_FTP.

 Invoking or Embedding the Media Player

There are two ways to link to an encoded media file on a Real or a Windows media server:

  1. So that the file will be played in a stand-alone instance of the media player, which is invoked when the user clicks on the link on your web page.

  2. So that the media player is embedded in the web page, and when the user clicks on the player control, embedded on the page, the media plays, pauses, stops, and so on.

The easiest method, and the one with the most advantages, is the first, though there are specific times when the second is the better choice.  Because embedding is so technical, it is only briefly discussed below.

In the first instance, invoking the stand alone player, you link to a redirector file, which in turns invokes the media player and starts the stream.  With the Windows media player, this is known as a WVX (video), WAX (audio), or ASF (older video or audio formats) file.  It is a simple text file containing XML commands that control the playing of the media.  With Real media, this redirector file is known as a RAM file (or RPM file if linking to an embedded player).  Examples are provided below.

A Windows Media Metafile

To link to a Windows media file, you must create a redirector file to the media.  A  WVX, WAX or ASF file should be created in a simple text editor, like Microsoft Notepad.  The following is a very simple example:

<ASX version = "3.0">
<Entry>
    <Ref href = "mms://venus.palomar.edu/path/MyFile.wmv" />
</Entry>
</ASX>

Metafiles use an XML-based scripting language.  In this example, the metafile simply instructs Windows Media Player to play one file from the Windows media server "venus.palomar.edu," in the path (assigned when you request it from Academic Technology), named MyFile.wmv.  The wmv extension means it is a Windows Media Video file.  Audio files have WMA file extensions.  Older media files, video or audio, may have the ASF extension, but this is only of historical interest.

  1. The ASX element defines the enclosed script as being part of a Windows Media metafile.

  2. The Entry element specifies the digital media.

  3. The Ref href element specifies the URL of the media. MMS is the Windows Media streaming protocol that is recognized by Windows Media Services.

Once this text file has been created, save it with the file extension WVX (for example, "myfile.wvx" (an audio redirector file should be saved with the extension WAX).  Import it into your web and then link to it, using the http protocol.  For example:

http://myfile.wvx

The file extension wvx (or wax, or asx) is associated with the Windows media player.  If your user has the Windows media player installed (version 7 or above) it will be invoked and the video will stream from the streaming server.
 
Metafile Extension When to use
.wax All digital media is audio-only, with .wma file name extensions.
.wvx Media contains video, with a .wmv file name extension.
.asx Media is created with previous versions of Windows Media Technologies and has an .asf file name extension.

Of course there are many features which could be added to a Windows media metafile.  For complete information on how to create a Windows media redirector files, and most other aspects of using Windows streaming media, visit the MSDN web site.

A Real Media Metafile

A similar process is used to link to a Real media file.  Use a plain text editor, such as Microsoft Notepad, and create a simple script which contains a link to the Real media file on a Real server, using the Real Time Streaming Protocol.  Then save the file with a .RAM extension and import it into your web.  Finally, link to the RAM file via and http link.  Here is an example of the simplest possible:

rtsp://real.palomar.edu/palomar/palpromohigh.rm

This simple one line file contains the following elements:

Internet Protocol:  rtsp://

Real Server Name:  real.palomar.edu

Path to media file:  /palomar/

Name of encoded file:  palpromohigh.rm

Assuming you have saved this file with the filename "palpromohigh.ram," (it is always a good idea to name your ram files with the same name as the media file to which it links, though this is not required), construct your web page link to this file like this:

http://palpromohigh.ram

(Go ahead and click it.  It really works.)

As with the Microsoft redirector files, there are many parameters and scripting features that can be implemented through the RAM file.  To find out more, visit the Real Networks production web site:

http://www.realnetworks.com

The Ramgen Alternative

Real provides an alternative that makes it far easier to create a link directly to your folder in the following fashion:

http://real.palomar.edu:8080/ramgen/path/yourfile.rm

If you use this style link on your web page, the necessary RAM file will automatically be generated and executed by the Real server.  Once it is executed, the Real player will be invoked and your file will play.

Here is one that actually works:

http://real.palomar.edu:8080/ramgen/palomar/palpromohigh.rm

This IS the actual link within a web page.  It is not contained within a separate redirector file.

What if the user does not have the Windows or Real media players?

Links to the stand-alone media player, while simple, only work if the user already has the player installed.  Therefore, it is customary and courteous to supply a link to a web page where the user can download the appropriate player if necessary.  Here is a typical example, showing links to low and high bandwidth targerts, and helpful links for obtaining the players:

 
Chess Pains
an RTV Production
 28k or 56k modem Network, Cable or DSL
Windows Media modem broadband
Real Media modem broadband
Requires Windows  media player, ver. 7, or Real Player ver. 8, or above.

 

Detailed Example:  Click here for screen shots and explanations on how to create a Real media redirector file using Microsoft Notepad, and then how to upload the file to your web site and link to the file using Microsoft FrontPage.

Embedding Media Players on a Web Site

If you are familiar with entering raw HTML code into a web page, and know a little about scripting, you may want to embed an instance of the media player on your web page.  This is more of an advanced application, however, and you may not want to undertake the coding.  If so, call Academic Technology (ext. 2877) for assistance.  We will be glad to help you.

Since this can be a complex process, the exact methods are not described here.  Rather, a couple of examples are shown, and links to the technical documentation at the Microsoft and Real support web sites are provided.

Note that the Real Producer Basic (free software) will produce a web page for you
with the Real player embedded.
Additional Document Resources