[Live-devel] ForceMulticastOnUnspecified

Ross Finlayson finlayson at live555.com
Mon Jan 8 14:28:35 PST 2007


>It is the server that decides whether or not a
>stream is multicast or unicast.  It specifies this in its response to
>the initial RTSP "DESCRIBE" command (and it's not something that the
>client can change in its subsequent "SETUP" command).
>
>Ross,
>
>Thank you for your reply.
>The SDP that I receive from testOnDemandRTSPServer has the following lines:
>
>m=video 0 RTP/AVP 33
>c=IN IP4 0.0.0.0
>
>In the SDP I don't see that the server specifies unicast.

By convention, the "0.0.0.0" destination address (and the "0" port 
number) specifies that the stream will be unicast.  The RTSP 
specification does, however, allow for this to be used even for a 
multicast stream (in which case the address and port could get 
assigned by the client during "SETUP").  This feature is not well 
supported, however.  So far I've seen it only on some Axis servers 
(network cameras), but even they don't support this feature correctly 
(they assign the multicast address themselves during "SETUP", rather 
than letting the client assign the address).  The optional 
"forceMulticastOnUnspecified" parameter to 
"RTSPClient::setupMediaSubsession()" was added as a hack just over a 
year ago, in response to someone who wanted to accommodate those 
weird servers.

Because this feature is little understood and little implemented, I'm 
not going to try to support it at all in our RTSP *server* 
implementation.  Instead, the server can specify alternative unicast 
and multicast "ServerMediaSession" objects, as I noted in my earlier 
message.

>I want in the end to use mediaServer and have the sessions created
>dynamically as multicast sessions if the client transport string says
>multicast.  I am confused about how to do this using
>PassiveServerMediaSubsession.  In the examples of using
>PassiveServerMediaSubsession, the RTPSink is created ahead of time and
>sink->startPlaying() is called before the event loop is entered.  Is it
>reasonable to use PassiveServerMediaSubsession with mediaServer?  Will I
>have to modify anything so that handleCmd_PLAY() will set the stream
>playing?  What I really need is an "on demand" multicast session.

An 'on demand multicast session' doesn't really make a whole lot of 
sense.  Sure, you could (somehow) arrange to start streaming 
multicast only after the first client arrives, but thereafter every 
other client will end up getting the same multicast stream, so what's 
the point?  You might as well just stream multicast continuously - 
which is what "PassiveServerMediaSubsession" does.  (Sending a 
multicast stream that noone is listening to is OK; in modern 
multicast routing protocols, such traffic will never get past the 
first hop.)

So, just use separate "ServerMediaSession"s for unicast and 
multicast, as I noted earlier.  That's the simplest and most standard 
solution.
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list