MMS streaming

Prev

Next

 






































































































MMS Streaming

Description

The MMS streaming is activated when NetworkStreaming = ns_ASFDirectNetworkStreaming.


The TCP port used can be specified with ASFNetworkPort.


If ASFNetworkPort = 0, an available port is automatically assigned. This port is returned by the OnDirectNetworkStreamingHostUrl. This event returns also the full URL that can be given to the users to connect to this network stream.
The streaming URL that must be given to users to connect to the current stream is also returned by the StreamingURL property.

Increasing the default limitation of 5 concurrent clients
By default a standard ("non-server") Windows PC is limited to 5 concurrent connections.
This limit can be increased to a maximum of 50 connections by modifying the value of the HKEY_CLASSES_ROOTMedia ToolsMaxClientConnections registry key.

Controlling the users connected
- the maximum number of users that can connect to this network stream is specified by the ASFNetworkMaxUsers property (default value : 5 users).
- the current number of users connected is returned by the ASFStreaming_GetConnectedClientsCount function.
- the list of the users connected is returned by the ASFStreaming_GetConnectedClients string (as lines separated by CR/LF)
- it is possible to block an IP address (or a group of IP addresses) by invoking ASFStreaming_SetAuthorization
- the list of the blocked IP addresses is returned by the ASFStreaming_GetAuthorizationList string (as lines separated by CR/LF)
- to clear the list of the blocked IP addresses, invoke ASFStreaming_ResetAuthorizations.


SAMPLE CODE (server side)

Streaming a live video source (video only):

VideoGrabber1.VideoDevice := 0;
VideoGrabber1.NetworkStreaming := ns_ASFDirectNetworkStreaming;
VideoGrabber1.NetworkStreamingType := nst_VideoStreaming;
VideoGrabber1.ASFNetworkPort := 10500;
VideoGrabber1.StartPreview;

Streaming a live video source (audio + video):

VideoGrabber1.VideoDevice := 0;
VideoGrabber1.AudioDevice := 0;
VideoGrabber1.NetworkStreaming := ns_ASFDirectNetworkStreaming;
VideoGrabber1.NetworkStreamingType := nst_AudioVideoStreaming;
VideoGrabber1.ASFNetworkPort := 10500;
VideoGrabber1.StartPreview;

Streaming a video clip:

VideoGrabber1.VideoSource := vs_VideoFileOrURL;
VideoGrabber1.VideoSource_FileOrUrl := " replace by the file path to your video clip"
VideoGrabber1.NetworkStreaming := ns_ASFDirectNetworkStreaming;
VideoGrabber1.NetworkStreamingType := nst_AudioVideoStreaming;
VideoGrabber1.ASFNetworkPort := 10500;
VideoGrabber1.StartPreview;

To view the streaming on the client, you need to open the server URL, that is built as follows:
mms:// IP : port
E.g. if the server IP is 192.168.0.123 and the streaming port is 10500 the URL will be mms://192.168.0.123:10500

To know the IP address of the server.

- either run IPConfig on the server to show it,
- either use the OnDirectNetworkStreamingHostUrl event (on the server) that returns directly the URL to open in the client when starting the preview or recording (HostUrl parameter).


SAMPLE CODE (client side)

E.g. if the server IP is 192.168.0.123 and the port is 10500 the URL will be mms://192.168.0.123:10500

- Without the optional Datastead RTSP DirectShow source filter:

VideoGrabber1.VideoSource := vs_VideoFileOrURL;
VideoGrabber1.VideoSource_FileOrUrl := 'mms://192.168.0.123:10500';
VideoGrabber1.StartPreview;

- With the optional Datastead RTSP DirectShow source filter installed on the client:

VideoGrabber1.VideoSource := vs_VideoFileOrURL;
VideoGrabber1.VideoSource_FileOrUrl := 'mmsh://192.168.0.123:10500';
VideoGrabber1.StartPreview;