Multicasting a Live Stream

The process for multicasting a live stream (rather than multicasting an .asf file) is similar to that for multicasting a file. The following example shows how to set up a simple multicast of a live stream. However, this multicast would likely produce unsatisfactory results since the stream is being encoded on the same computer where the multicast originates.  For best results, you may need to run the encoder on a dedicated computer.

The main difference between this example and the previous one is that the stream is distributed as an MSBD protocol stream, not an .asf file. Consequently, the stream format is retrieved from an .asd file that was created by the encoder. This accounts for the differences in the last parameter for the ChannelFormats.Add method.

To view this multicast, a player would open the location http://astrid/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://astrid: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
© 1996-1998 Microsoft Corporation. All rights reserved.