[Live-devel] RTP Multicast Streaming

Ross Finlayson finlayson at live555.com
Tue Sep 17 04:39:42 PDT 2019


You didn’t say so explicitly in your message, but I presume that you are using our “LIVE555 Streaming Media” libraries to implement both your server (i.e., your IP camera), and your receiver(s)/client(s).[*]

The multicast streaming RTSP server examples that we provide (in the “testProgs” directory) all use a “PassiveServerMediaSubsession” object.  This means that the RTSP server - in this case - describes a stream that is ‘ongoing’.  In this case, RTSP “PLAY”, “PAUSE”, and “TEARDOWN” commands have no effect on the stream; it continues regardless.

In contrast, our server implementation of RTSP unicast streams use a “OnDemandServerMediaSubsession” object.  This class handles RTSP “PLAY”, “PAUSE”, and “TEARDOWN” commands (to start, pause, and end a stream, respectively).  However, this class is used only to implement unicast streaming, not multicast streaming.

Note that “PassiveServerMediaSubsession” and “OnDemandServerMediaSubsession” are both subclasses of an abstract class “ServerMediaSubsession”.  They each implement several virtual functions, including:
	- sdpLines()
	- getStreamParameters()
	- startStream()
	- pauseStream()
	- deleteStream()
These virtual functions (and others) are implemented differently in the “PassiveServerMediaSubsession” and “OnDemandServerMediaSubsession” subclasses.

What you want, therefore, is a new subclass of “ServerMediaSubsession” that serves a multicast session, but does so ‘on demand’ - i.e., in response to RTSP “PLAY”, “PAUSE”, and “TEARDOWN” commands.  We do not provide such a subclass; you would need to implement it yourself.  In this new subclass of “ServerMediaSubsession” (which you might name “MulticastOnDemandServerMediaSubsession”), you would have to reimplement several virtual functions, e.g.:
	- sdpLines() would be implemented similarly to the implementation in “PassiveServerMediaSubsession” 
	- getStreamParameters() would be implemented similarly to the implementation in “PassiveServerMediaSubsession” 
	- startStream() would be implemented similarly to the implementation in “OnDemandServerMediaSubsession”, except that if the multicast stream has already been started, you would not create/start a new one.  Instead, in this case, you’d just do nothing.
	- pauseStream() would be implemented similarly to the implementation in “OnDemandServerMediaSubsession” (if you wish to implement “PAUSE” at all)
	- deleteStream() would be implemented similarly to the implementation in “OnDemandServerMediaSubsession”, assuming that you want one multicast RTP receiver (RTSP client) to be able to stop any other clients from receiving the stream.


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

[*] As always, if you are using our code to implement commercial products, you are free to do so, but you must comply with the conditions of the LGPL; see http://live555.com/liveMedia/faq.html#copyright-and-license





More information about the live-devel mailing list