Windows Media Services SDK banner art
PreviousNext

Multicasting a Live Stream

The process for multicasting a live stream is similar to that for multicasting an .asf file. The following example shows how to set up a simple multicast of a live stream. However, this multicast is likely to produce unsatisfactory results because the stream is being encoded on the same computer where the multicast originates.  For best results, you must run Windows Media Encoder on a dedicated computer.

The main difference between the following example and the one described in Creating an On-Demand Multicast with the SDK is that the stream is distributed as an MSBD protocol stream, not an .asf file. Consequently, the stream format is retrieved from an ASF Stream Descriptor (.asd) file created by Windows Media Encoder. This accounts for the differences in the last parameter for the ChannelFormats.Add method.

To view this multicast, Windows Media Player opens the location http://MyServer/myNSC.nsc.

MCM.Connect "LocalHost"
Set MyStation = MCM.Channels.Open( "MyStation", MCM_PA_ALL_ACCESS )
MyStation.MulticastAddress = "238.8.217.48"
MyStation.Port = 14767
MyStation.DeliveryMode = MCM_DM_SESSIONLESS_3PH
Set MyStream = MCM.Streams.Open ("msbd://MyServer:1152", "MyStream", _
   MCM_PA_ALL_ACCESS)
MyStation.ChannelFormats.Add "C:\ASFRoot\Stream Formats\MyFormat.asd", _
   MCM_ASD_CH_FORMAT_FILE
MyStation.WriteNSC "C:\inetpub\wwwroot\MyStation.nsc", "True"
MyStation.SetActiveStream MyStream
MyStream.Start 0
PreviousNext


© 1996-1999 Microsoft Corporation. All rights reserved.