0

This is the situation:

  1. I connect to RTSP Server with Live555 openRTSP Client
  2. Then supose that The Server connection is lost

To Re-connect the rtsp server, what should i do?

  1. Does openRTSP Client handle this? [ in my experiment it does not]
  2. If Not how should i detect connection lost, and modify the Open Rtsp Client code to re-connect the server?

Any suggestions?

mpromonet
  • 11,326
  • 43
  • 62
  • 91
Novalis
  • 2,265
  • 6
  • 39
  • 63

1 Answers1

0

IMO it would be easiest to setup a new RTSP session.

1.) not as far as I know

2.) you can schedule a periodic task in the live555 event loop that checks if any samples have been received in the last n seconds. If not, you could try to teardown the existing session before beginning a new one. However if the connection has gone down between the server and client, your TEARDOWN might also fail (which is ok since the RTSP server times out RTSP sessions in any case). The live555 timeout on the RTSP server is 60 seconds as far as I remember.

For clarity purposes: What exactly do you mean by connection: the link between the RTSP server and client? Are you streaming RTP over UDP or RTP over RTSP (TCP)? If you are interleaving RTP over RTSP, you may be able to detect the connection failure when the TCP connection goes down.

Ralf
  • 9,405
  • 2
  • 28
  • 46
  • The server stream RTP over UDP...So i should make a quest that if i did not take RTP packets for suppose 10 seconds, the server connection is down? But the network may be slow...Magic number? What should n be? – Novalis Nov 21 '11 at 15:25
  • By connection: "The link between server and clinet"...If server down the OpenRTSP client is down...But it should try for n times or t duration to re-connect and get streams again...Maybe server is "up" in an t time... – Novalis Nov 21 '11 at 15:30
  • This is a tricky problem since it is entirely dependent on the network issues you are experiencing. I would experiment somewhat with the magic number to see what suits you. We stream media using live555 RTP over RTSP and have seen timeouts of over 30 seconds after which the session has recovered ( which is ok as long as the period is under the RTSP server timeout), but this depends entirely on your target network, etc. – Ralf Nov 21 '11 at 16:57
  • I done it so using timer but i have problems while re-starting new client. http://stackoverflow.com/questions/8226021/live555-openrtsp-client-how-to-delete-currrent-rtps-client-properly-and-start – Novalis Nov 22 '11 at 11:34