In the Windows environment, Microsoft Windows Media Server is the de-facto standard. Windows Media Server comes as part of Windows 2003 Server. Needless to say, its compatibility with Windows simply has no comparison.
Windows Media Server provides streaming support with two protocols:
- Microsoft Media Server (MMS) protocol -- This is a proprietary streaming protocol which can run on UDP, TCP and even HTTP. Although MMS over HTTP may appear to be a strange combination, it is almost guaranteed to work over any firewall.
- Real-time Streaming Protocol (RTSP) -- RTSP provides VCR-like commands such as play and pause, and random access to files on a server.
Windows Media Server's standard formats for streaming video and audio are WMV and WMA, respectively. These formats can be created using the Windows Media Encoder. Live inputs can also be captured using Windows Media Encoder. The design of WMV appears to be based on MPEG-4. To control the playback of media streams, an advanced stream redirector (ASX) file has to be used. ASX files are plain text files that manage streaming of WMV and WMA files.
As the name suggests, the main task of ASX files is to redirect requests for media to the streaming server, as explained in Figure 1.1. At a minimum, an ASX file needs to contain a URL that points to the server and file that the user wants to play. A simple ASX file is shown below:
<ASX version = "3.0"> <Entry> <Ref href = "mms://WindowsMediaServer/MyFile.wmv" /> </Entry> </ASX>
ASX has many options for refining control of the playback. It can join multiple media types together to be played sequentially or in parallel. A detailed description of the format and use of ASX files can be found here if you are interested.
It is also possible to embed a streaming media within a webpage, as shown in Figure 1.2.
Source: http://www.audiovideoweb.com/windowsvideoembedsample.htm (visited in July 2012)
The following code embeds a streaming media into a webpage:
<OBJECT ID="MediaPlayer" WIDTH=320 HEIGHT=240 classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"> <PARAM NAME="FileName" VALUE="">http://interface.audiovideoweb.com/lnk/avweb_windows_demos/sears_1.wmv/play.asx">; <PARAM NAME="ShowControls" VALUE="1"> <PARAM NAME="ShowDisplay" VALUE="1"> <PARAM NAME="ShowStatusBar" VALUE="1"> <PARAM NAME="AutoSize" VALUE="1"> <Embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/windowsmedia/download/AllDownloads.aspx/" filename="http://interface.audiovideoweb.com/lnk/avweb_windows_demos/sears_1.wmv/play.asx" src="http://interface.audiovideoweb.com/lnk/avweb_windows_demos/sears_1.wmv/play.asx" Name=MediaPlayer ShowControls=1 ShowDisplay=1 ShowStatusBar=1 width=320 height=240> </embed> </OBJECT>
Basically, the above code embeds a Windows Media Player in a webpage and then passes a number of parameters to it using the PARAM element. These parameters control the player's look and functionality. Each of the parameters has a name and a value associated with it. Most of the parameters used above should be self-explanatory.
If you want to develop your own application with Windows Media Server, you can download the Windows Media Server SDK from Microsoft. With the SDK, you can programmatically configure the application, monitor both the server and clients connected to it, and access all logging statistics. The following is a list of functionalities provided by the SDK:
- authentication
- cache/proxy
- control protocol
- data writer
- data source
- event notification and Authorization
- logging
- media parser
- playlist parser.
As you would expect, the SDK works well with Microsoft Visual Studio. Further information about the SDK can be obtained here.
There are other popular streaming servers for different platforms. For example, the Darwin Streaming Server is an open source version of Apple's Quicktime Streaming Server. The Darwin Streaming Server is available for various platforms including Linux, Mac and Windows. Other commercial products are available from Real Networks (www.realnetworks.com) as well as Sun (www.sun.com).
- 瀏覽次數:3020