[Live-devel] I want to get disconnect event triggered from RTSP server.

Ross Finlayson finlayson at live555.com
Fri Mar 27 02:42:59 PDT 2020


Yes, thanks for the reminder that our RTSP server implementation - due to a bug that needs fixing - currently does not send a RTCP “BYE” when a stream ends.  That will be fixed sometime (perhaps fairly soon).  But that’s not particularly relevant here, because you are asking about how to program a RTSP *client*.


> No, you’re ‘barking up the wrong tree’ here.  All that is doing is detecting when the RTSP TCP connection has ended.  And that can happen at any time during the stream - not necessarily when the stream ends.  (It is perfectly legal for a RTSP server to close the RTSP TCP connection at any time - even while the RTP stream is ongoing.  Should that happen, our “RTSPClient” code would recover from this automatically; it is of no concern to application code.)
> 
> Yes, that is exact what I want to handle.

Sorry, but you can’t.  Once again, it’s perfectly legal for a server to close the RTSP TCP connection at any time, even before the stream has ended.  So even if you could detect when the RTSP TCP connection has closed - which you can’t - it wouldn’t tell you anything useful.


> In many times video stream in my app is stopped, I want to show GUI that the network is 
> disconnected.

No, what you want is to detect when packets have stopped arriving (at the client), after a certain threshold.  For an illustration of how to do this, note how “openRTSP” implements the
	-D <maximum-inter-packet-gap>
option: http://www.live555.com/openRTSP/#playing-time
(Search for “interPacketGapMaxTime” in “testProgs/playCommon.cpp”.)


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





More information about the live-devel mailing list