The ideal way to host Windows Media files and streams is on a server running Microsoft Windows Media Services 9 Series. However, you can also host Windows Media files on any Web server. To stream from a Web server, add the Windows Media Multipurpose Internet Mail Extensions (MIME) type to your Web server, create simple Windows Media metafiles with .wax, .wvx, or .asx file name extensions in a text editor (such as Notepad), and then copy the content
Feedback
E-mail us with your comments and feedback about this article.
Abstract
This document describes how to stream media by using either a Windows Media server or a Web server.
(8 printed pages)
to your server. Any user can then connect to your site and play audio and video content with Windows Media Player. Later, when you decide to expand, you can add a Windows Media server to your Web site and take full advantage of the features and benefits that are available to you from Windows Media technologies.
This document includes information about the following topics:
You can stream Windows Media-based content over a network by using either a Windows Media server or a Web server:
Using a Windows Media server. The ideal way to stream content is with Microsoft Windows Media Services 9 Series, which is available only on computers that are running Microsoft Windows Server 2003. Windows Media Services is designed to handle the special requirements of streaming and administering Windows Media content on the Internet or on an intranet. Windows Media Services provides features, such as live broadcasting and intelligent streaming, which automatically adjusts the bit rate of each client stream according to bandwidth that is currently available. Windows Media Services also provides powerful logging and other features. You can stream by using the Real Time Streaming Protocol (RTSP), which was created specifically to control the delivery of real-time data over a network; the MMS protocol, which is the proprietary streaming media protocol developed for earlier versions of Windows Media Services; or Hypertext Transfer Protocol (HTTP). Using HTTP, you can stream through most firewall configurations.
Using a Web server. You can use any Web server to host Windows Media streaming content. There are many advantages to streaming from a Windows Media server. However, Web server streaming may be the best option if you plan to offer only a few audio clips, for example, or if you have a startup site with limited resources for adding servers. Because you can use your existing Web server, you can stream on the Internet or on an intranet by using Windows Media Technologies.
There are just a few tasks to complete to prepare for Web server streaming. One of the tasks is adding Windows Media MIME types to your Web server.
Before you can stream Windows Media-based content, your Web server must be configured to recognize the Windows Media MIME types. If you are using Microsoft Internet Information Services (IIS) 6.0, all of the appropriate MIME types for Windows Media Services are already set. If you are using a different Web server, make that sure the MIME types in the following table are defined in the HTTP Header properties, otherwise a number of unpredictable results can occur.
If Web server MIME types are not set up, the user might be prompted to download the media file instead of starting Windows Media Player and playing the content. Also, when the .wvx, .wax, or .asx MIME types are not set up, the contents of the file might be displayed in the user's browser instead of being opened in Windows Media Player.
Virtually every type of Web server has a different method for adding, editing, and deleting MIME types. On most servers, you either use an administration program or edit a configuration file. For more information about configuring MIME types on a variety of Web servers, see MIME Type Settings for Windows Media Services.
If you use an Internet service provider (ISP) to host your content and the ISP doesn't have the Windows Media MIME types configured on their Web servers, contact them and request that they add the following MIME types. If you must configure the Web server MIME types yourself, use the information in the following table.
File extension
MIME type
.asf
video/x-ms-asf
.asx
video/x-ms-asf
.nsc
video/x-ms-asf
.wax
audio/x-ms-wax
.wm
video/x-ms-wm
.wma
audio/x-ms-wma
.wmd
application/x-ms-wmd
.wmv
video/x-ms-wmv
.wmx
video/x-ms-wmx
.wmz
application/x-ms-wmz
.wvx
video/x-ms-wvx
Table 1. Web server MIME types
In addition to setting up MIME types on the server, MIME types must also be set up on a user's browser. However, MIME types do not typically have to be set manually. Windows Media Player configures browser MIME types when it is installed on a user's computer. If a MIME type problem occurs, it can most often be corrected by reinstalling Windows Media Player. If the browser does not allow automatic configuration, then you can set the MIME type manually by using the information that is in Table 1.
Windows Media Player renders audio and video content in the same way, whether a file is on a Windows Media server, a Web server, a network server, or a local hard disk. The server does not affect the quality of the media. What the server does affect is how the packets of data that contain the media are delivered to Windows Media Player.
A Windows Media server is designed to handle busy, congested networks and low-bandwidth connections to client computers that are running Windows Media Player. This section describes what you should consider before you encode content that will be hosted on a Web server, and then shows you how to configure Windows Media Encoder 9 Series.
Encoding Content for a Web Server
If you stream by using a Web server instead of a Windows Media server, keep these things in mind:
A Web server is not designed for streaming media, so playback is more likely to be interrupted by periods of buffering. Buffering occurs when Windows Media Player is not receiving audio and video data packets fast enough. Windows Media Player has to stop to refill its memory buffer before it can proceed with playback. To help correct for this, you may have to encode files at a lower bit rate than you would if they were being streamed from a Windows Media server.
Web servers do not support intelligent streaming. Multiple-bit-rate files contain a number of video streamseach of which are encoded at a different bit rate. These files enable the server to perform intelligent streaming. When using intelligent streaming, Windows Media Player sends feedback to the Windows Media server about current network conditions. The Windows Media server then delivers the most appropriate video stream for the current bandwidth from among the streams that are contained in the file. Because a Web server has no mechanism for dealing with intelligent streaming, it sends the entire file, which contains all the streams, and only the highest bit rate stream plays. This can result in wasted bandwidth and a poor user experience.
Procedures
The procedures in this section describe how to configure Windows Media Encoder 9 Series for Web server streaming. You can download the encoder from the Windows Media Web site. These procedures include:
How to configure Windows Media Encoder 9 Series to encode a file.
How to create a Windows Media metafile.
How to add a tag to an HTML file.
To configure Windows Media Encoder 9 Series to encode a file
On the toolbar, click New Session. The New Session Wizard starts.
On the Wizard tab, click Convert a file.
On the File Selection screen, type both the file that you want to convert (the source file) and the file that you want to create (the output file).
On the Content Distribution screen, click Web server (progressive download). When you click Web server (progressive download), only those encoding options that pertain to encoding files for Web servers are displayed.
On the Encoding Options screen, select how you want to encode your audio and video from the lists, and then click to select the appropriate bit rate check box.
On the next two screens, type display information and review your settings.
After you quit the wizard, click Start Encoding.
If you want to edit or create a new a profile, click Properties, and then click Edit on the Compression tab. In the Custom Encoding Settings dialog box, you enter the primary settings that the encoder will use to create your content. Keep in mind that the file you encode for a Web server must be able to play as it is downloading (progressive download). Therefore, for the smoothest playback, you should choose CBR (Constant Bit Rate) mode and only one bit rate.
Note: Creating and managing profiles is a method provided for advanced users with a detailed knowledge of bandwidth capacity, media settings, and codec usage. For more information, see Windows Media Encoder Help.
After you encode your files, there are two more steps to prepare your content for streaming from a Web server: creating Windows Media metafiles with .wax, .wvx, or .asx file name extensions, and adding tags to your HTML files. The HTML tag points the user's browser to the metafile, which points Windows Media Player to the content (the Windows Media file). You must use a metafile to reference the media because a direct reference to the media in an HTML tag will cause many browsers to attempt to download the media rather than stream it.
To create a Windows Media metafile
Open a text editor, such as Notepad.
Type the following metafile script, but replace the URL with that of your file. Reference the audio or video file just as you would any other Web file.
You can place the metafile in the same folder as that of your digital media file. If you do so, you can use a relative path, which is simply the name of the file. The REF line would look like this:
<REF HREF="YourFile.wmv" />
Save the text file using the name of your digital media file followed by the .wvx extension if the metafile points to a file with a .wmv extension, or .wax if the metafile points to a file with a .wma extension, such as YourFile.wvx. You can also use the .asx file name extension for either audio or video.
To add a tag to an HTML file
Using a text editor, such as Notepad, open the Web page to which you want to add the reference to the media.
Add the URL of the metafile. For example:
<HTML>
<BODY>
Play this Windows Media file:
<A href="http://YourWebServer/Path/YourFile.wvx">
Your File</A>
</BODY>
</HTML>
Copy the Windows Media files (with .wma, .wax, .wmv, and .wvx file name extensions) to your Web server.
When an end user clicks the reference on the Web page, the metafile is downloaded and Windows Media Player opens. Windows Media Player opens the metafile, and then opens and plays the Windows Media file from your Web server.
A Windows Media server is often the best way to stream media because Windows Media Services is designed specifically for that purpose, and all Windows Media components work together to enhance the end-user experience. Intelligent streaming, for example, involves Windows Media Encoder, Windows Media Services, and Windows Media Player.
This section compares the features of a Windows Media server and a Web server and describes the best way to determine which option is right for you. For a more complete comparison, see Web Server vs. Streaming Server
Comparing server features
The features of each type of server are compared in the following table.
Feature
Windows Media Services
Web server
Stream through most firewalls
X
X
Stream content with Digital Rights Management
X
X
Fast Streaming
X
Stream without downloading
X
Broadcast (live)
X
Intelligent streaming
X
Optimized for streaming Windows Media content
X
Indexing
X
Administering and logging
X
Table 2. Comparison of features for streaming Windows Media-based content
The following list describes each feature. If you are interested only in the features that a Web server can provide, then Web server streaming may be the right option for you.
Stream through most firewalls. Firewalls are special servers that filter information that flows between the Internet and private networks or intranets. Many firewalls are set up by default to block data that isn't from a Web serverdata such as a Windows Media stream. Firewalls can be reconfigured to allow this data into the intranet. Alternatively, Windows Media servers can be configured to stream using the same protocol as Web servers, HTTP.
Stream content with Digital Rights Management. Content that has been packaged using Microsoft Windows Media Rights Manager can be streamed or downloaded from either type of server. Windows Media Rights Manager helps content owners distribute licensed digital media over the Internet with superior audio quality.
Fast Streaming. A feature of Windows Media Services that allows for a combination of streaming, downloading, and caching to provide the best user experience. Fast Streaming includes Fast Start, which downloads the first few seconds of the content at as high a bit rate as possible, so the wait to start playing is reduced; Fast Cache, which uses available bandwidth to cache as much content as possible ahead of playback; Fast Recovery, which sends error correction data with the data packets instead of waiting for an error to occur; and Fast Reconnect, which enables the server to automatically restore connections that are lost.
Stream without downloading. Content from a Web server is downloaded. If Fast Cache is enabled on a Windows Media server, content might be cached to enhance playback. However, this feature can be disabled if you want your content streamed only.
Broadcast (live). Web servers can only host on-demand content (files). A Windows Media server can host content for on-demand delivery or as a broadcast. Broadcasting enables you to stream live content (events that occur in real time), and files and playlists that are played back from the server. Some examples of broadcasting are streaming live radio and television signals, and Internet radio stations.
Intelligent streaming. As mentioned earlier, this feature requires an interaction between a Windows Media server and Windows Media Player to optimize the stream for the current available bandwidth.
Optimized for streaming Windows Media content. Windows Media Services was designed for the special requirements of streaming media. For example, Windows Media Services handles resources on a computer better than a Web server when streaming. A Windows Media server is capable of delivering more concurrent streams on a given computer by making more efficient use of a computer's CPU and network bandwidth. A Windows Media server sends data at the same bit rate as the content. A Web server on the other hand does not control the bit rate at which it sends a stream. Consequently, two or more concurrent streams from a Web server could saturate a network's bandwidth.
Files are streamed from a Web server by using a method called progressive downloading. This means that a file plays as it downloads to the user's Internet cache. This can be a concern for users, because digital media files often consume a large amount of hard disk space. Also, a user cannot seek to different parts of the content, until the entire file is downloaded.
Indexing. This feature provides end users with a means of fast-forwarding and rewinding through a file that is being streamed, which requires interaction between a Windows Media server and Windows Media Player.
Administering and logging. You can control how a Windows Media server manages live content and files, and monitor overall system activity in real time. You can also create detailed logs that include data such as individual client connection information and server events.