Windows

Broaden your Windows Media skills with multicast and live streams

Boost your streaming media capability by using the Windows Media Administrator. This utility will allow you to conserve bandwidth by multicasting broadcasts and stream live events to your users. Scott Lowe shows you how it's done.

Windows Media Services can do much more than create simple point-to-point streams for your users. For example, you can also stream live events to your users, as well as create multicast streams that are more efficient when streaming data to multiple users. In this Daily Drill Down, I’ll show you how to make Windows Media Services accomplish these additional tasks by using the Windows Media Administrator.

What's a multicast stream?
A multicast stream is just like a unicast stream except that many people can watch it at the same time. You can think of a unicast stream as a DVD or videotape that you watch by yourself and a multicast stream as a TV show where many people watch the same program at the same time on different monitors. Since the multicast stream allows many people to watch a single data stream, a multicast broadcast also has the potential to reduce server utilization and network bandwidth. For more information about the difference between unicast and multicast streams, see the Daily Drill Down "Prepare your network to support Windows Media Services."

Setting it up
There are three components required to set up a multicast presentation: a station, a program, and a stream. A station is a point from which a player can receive a stream. A program organizes the content to be distributed. The stream is the actual media stream.

First, I’ll show you how to set up a station. To start, click Start | Program Files | Administrative Tools | Windows Media. Click on Multicast Stations in the Windows Media Administration utility. This will bring up a window with configuration utilities for all three components, as shown in Figure A.

Figure A
Windows Media Administrator allows you to manage multicast streams.


To set up a station, make sure that the box marked Use Wizard To Create New Station is checked and then choose Stations | New from the Stations button. Then the Configure And Publish Multicast Broadcast Streams Wizard will appear. Click Next on the initial wizard screen. When the Select A Station screen appears, make sure that Create A New Station is chosen and then click Next to continue. Then the Create A New Station screen will appear, as shown in Figure B.

Figure B
You must specify a name for the multicast station.


For this example, I’ve named our new station “Station1” and described it as “Multicast station.” You also need to select the Distribution Mode of Multicast And Distribution. This allows other servers and multicast-enabled clients to pick up the stream. Click Next to continue. Then the Specify A Program And Stream Name screen will appear, as shown in Figure C.

Figure C
You must also specify a name for the program you want to stream.


On this screen, you’ll choose program and stream names to associate with this station. For this example, I kept the defaults of Program1 and Stream1. Also, make sure you check the box marked Replay Stream Objects Once Finished (Loop) along with the Start Program Once Wizard Is Finished box. Click Next to continue.

Now the Specify A Source For The Stream Object screen will appear, and you’ll tell the wizard what you want to stream over this multicast. For this example, I will stream a local .asf file. If you wanted to, you could multicast a live broadcast using the Windows Media Encoder or redistribute a stream from another server by choosing Remote station or broadcast publishing point instead. Choose Advanced Streaming Format (.asf) file and click Next.

When the Specify A Source URL For the Stream Object screen appears, you’ll select the file you want to stream. For this example, I will stream the sample file Welcome2.asf that was a part of the default installation for Media Services. On this screen, you also need to tell the wizard the path a player would take to find the file, not the path the file system would take to find it. Since the welcome2.asf file is in C:\Asfroot, which is the root for the media server on my system, the path should read mms://SCOTT-2KS/welcome2.asf. Click Next.

When the Specify Stream Format Information screen appears, tell the wizard about the physical location of the .asf file. On my system, this is C:\Asfroot\welcome2.asf. Click Next.

For any multicast, the client player needs to know specific information about the file that it is trying to play. This information is stored in an .NSC file, which is a Windows Media Station file. The best location for this file is on a Web server, where it is accessible to the client. On my test lab server, I placed the .nsc file in C:\Inetpub\Wwwroot\Station1.nsc, which is the root of my Web server. Click Next.

The wizard will now ask how the file should be accessed—via a file share or using HTTP on the Station Information File URL screen. If you are presenting a file over the Internet, then HTTP is the obvious choice. If you are streaming over a local network, then either option can work, depending on your setup. For this example, I chose the HTTP option, with the input box reading http://SCOTT-2KS/Station1.nsc. Click Next to display the Select Publishing Method screen, as shown in Figure D.

Figure D
This screen will prompt you to tell the wizard how you want to publish the file.


On this screen, you’ll see a number of options on how this stream should be published. For this example, in addition to the option that is checked, choose Create An .Htm File With An <HREF> Tag That Links To An .Asx File and click Next.

The Ready To Publish screen will appear. This is a summary screen that displays all of your choices. Review your options and click Finish.

At this point, you’ll see the Save .ASX File dialog box. Here you’ll create the .asx file that you defined earlier. Save it to your Web server root location, which for me is C:\Inetpub\Wwwroot.

The .htm file will also need to be saved. You’ll do this in the next dialog box, which is called Save .HTM W/ <HREF> File. Save the .htm file to the same location as the .asx file.

After that, you’re done. When the Publishing Complete screen appears, click Close. Your server will now start the multicast stream. Refresh your Windows Media Administration console window and take a look at the Multicast Stations properties page shown at the bottom of Figure E.

Figure E
You can monitor the playback of the stream at the bottom of the Multicast Stations screen.


You’re now ready to view the stream. Point a browser from a client to your .asx file. In my test lab, this is http://scott-2ks/station1.asx. If everything worked, which it did for my test setup, you should get the chance to hear the welcome2.asf file over and over again, since we asked it to replay during the setup.

Creating live events
Having the ability to stream live broadcasts is one reason that many organizations choose to set up streaming media servers. Unfortunately, I cannot go through an entire example of setting up a live stream because there are many different methods you can use to capture the live video, each of which has its own configuration steps. However, I will go through the steps that are required and tell you about some of the prerequisites that you will need to take care of before beginning the setup. To show you how live broadcasts work, I’ll set up a pseudo-live show by streaming an existing file via the Windows Media Encoder in the same way that you would if you were streaming a live broadcast.

Before you can even begin to consider streaming a live event, you need a video capture board. A low-end video capture board with S-Video, RCA, and audio inputs will cost $150-$200, while a professional-level board capable of capturing 30 frames per second at 640 x 480 will cost upwards of $500-$1,000.

For any board you choose, the first step is to install it and make sure it works. In my experience, the easiest way to see if a board works is to connect a VCR to one of the inputs and try to capture something to a file with the appropriate software, such as the Windows Media Encoder. Getting both the audio and video working together can be somewhat tricky. Make sure that this is working before you try to stream a live show to cut down on the number of points you’ll need to troubleshoot in the event of a problem.

If you want to record media for later playback that you currently have in an analog format, such as a VHS tape, use Start | Program Files | Windows Media | Windows Media Encoder and follow the instructions in that program.

Once you have the hardware installed and working, you can begin to set up a live broadcast. You’ll need to use the Windows Media Administrator, as we did in the previous example. Since I cannot actually set up a live broadcast, I will simulate one by live encoding one of my MP3 files. While it is not live, it is a close approximation, since I will stream the MP3 file out as it is playing.

Choose a media file (audio only) that you want to stream live out to your clients. Even though it’s called a live broadcast, it’s not actually live. Instead, the broadcast is sent out via the Windows Media Encoder while the file is still being encoded. Therefore, there will naturally be a small delay between the actual event and what the user sees in Media Player.

For this example, I will be streaming an MP3 file that happens to be on the server named walkthroughthefire.mp3. The first step is to set up the encoder to do its job. Click Start | Windows Media | Windows Media Encoder. When Windows Media Encoder starts, you’ll see the Welcome screen, as shown in Figure F.

Figure F
Start Windows Media Encoder using QuickStart.


Choose QuickStart and press OK to continue. On the Select A Template Stream Format screen, I chose 128 CD Transparency Audio since I will be streaming this test broadcast on my local network, where bandwidth is not an issue. Depending on your circumstances, audience, available bandwidth, server horsepower, etc., you will need to determine what level of quality you wish to assign to a particular live broadcast. If you are broadcasting out to folks on the Internet, I highly recommend keeping this setting in the 28.8 to 56 Kbps range, since that is the speed at which many of your clients will use to connect to the Internet.

Once you have chosen a quality, click OK to continue. This will bring you to the main encoder screen shown in Figure G. At this point, we need to choose a file to stream live to your clients. Choose Encode | Properties | Input, choose AVI/WAV/MP3 File, and select a file of one of these types from your system that you will use as a test. When you are done, click OK.

Figure G
You'll use Windows Media Encoder to generate live broadcasts.


Once you have chosen a speed and a file, you will see a screen similar to the one above. Make note of the Stream Reference section in the Connection Information. You will need this information when you move over to the Windows Media Administrator to actually set up the live stream.

Keep this window open and start the Windows Media Administrator. From the Unicast Publishing Points menu, choose Broadcast | New. On the Select A Publishing Point Page, choose Create A Broadcast Publishing Point and click Next. For the source, specify Windows Media Encoder and click Next. The next configuration option asks you to give the new broadcast stream an alias and a path with a port. For the alias, I named this example “walk.” For a path, I used “msbd://scott-2ks” with a port of 2173. Notice that the port number 2173 corresponds with the msbd stream reference port from the Windows Media Encoder. Once you have set these options, choose Next to continue.

The final option asks you what publishing methods you would like to use. For this example, choose the option Create An .Htm File With <EMBED> And <OBJECT> Tags and click Next to continue. Click Finish.

You will now need to save the various .asx and .htm files that you created to the root of the Web server. Click Close on the Publishing Complete screen to finish the process.

To test the broadcast, go back to the Media Encoder session and click the Play button to start the live encoding process. Then, go to a client workstation to test it. In my setup, I browse to http://scott-2ks/walk_object_tag.htm to get the stream. If the stream works correctly, an embedded Windows Media Player opens up inside Internet Explorer, and the song being encoded on the media server plays.

Conclusion
Unicast streams are relatively simple to set up, but they can’t do everything. In situations when you expect lots of traffic, you may want to multicast the event. In other situations, you may want to broadcast a live event. In both cases, you can use Windows Media Administrator to publish the events in a manner that suits your needs.
0 comments

Editor's Picks