[Live-devel] Keeping RTSP connection alive

sampsa sampsa.riikonen at dasys.fi
Tue Aug 23 05:44:16 PDT 2016


Hi,

When using a brand new axis camera, I stumbled upon the so-called 
"keep-alive" problem: the camera stops sending packets to my client 
after 60 secs. or so.

I tested this also with the openRTSP test program (the output is in the 
end of this message).

My questions are:

1) I suppose that openRTSP (and the RTSPClient class) sends periodic 
RTCP sender reports (based on RTSPClient source code) to the camera.  Am 
I correct ? (i.e. no special custom implementation is needed to achieve 
this).

2) .. and that should be enough to keep the camera sending those frames, 
right ?

3) So maybe this a problem of the camera not fullfilling the protocol .. ?

When trying with vlc, I can see that vlc sends periodic "GET_PARAMETER" 
commands to the camera and - supposedly because of this - the camera 
does not kill the stream.

4) Is sending periodic "GET_PARAMETER" command a legitimate way of 
keeping the connection up and alive or simply a "hack" that is widespread ?

(I'm using "v2016.02.22" of live555)


Regards,

Sampsa


[OpenRTSP output]

sampsa at sampsa-xps13:~/live555/live/testProgs$ ./testRTSPClient 
rtsp://root:nordic12345@192.168.1.90/axis-media/media.amp
Opening connection to 192.168.1.90, port 554...
...remote connection opened
Sending request: DESCRIBE 
rtsp://root:nordic12345@192.168.1.90/axis-media/media.amp RTSP/1.0
CSeq: 2
User-Agent: ./testRTSPClient (LIVE555 Streaming Media v2016.02.22)
Accept: application/sdp


Received 784 new bytes of response data.
Received a complete DESCRIBE response:
RTSP/1.0 200 OK
CSeq: 2
Content-Type: application/sdp
Content-Base: rtsp://192.168.1.90/axis-media/media.amp/
Server: GStreamer RTSP server
Date: Tue, 23 Aug 2016 12:14:09 GMT
Content-Length: 579

v=0
o=- 1188340656180883 1 IN IP4 192.168.1.90
s=Session streamed with GStreamer
i=rtsp-server
t=0 0
a=tool:GStreamer
a=type:broadcast
a=range:npt=now-
a=control:rtsp://192.168.1.90/axis-media/media.amp
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:50000
a=rtpmap:96 H264/90000
a=fmtp:96 
packetization-mode=1;profile-level-id=420029;sprop-parameter-sets=Z0IAKeKQCgC3YC3AQEB4eJEV,aM48gA==
a=control:rtsp://192.168.1.90/axis-media/media.amp/stream=0
a=framerate:20.000000
a=transform:-1.000000,0.000000,0.000000;0.000000,-1.000000,0.000000;0.000000,0.000000,1.000000

[URL:"rtsp://192.168.1.90/axis-media/media.amp/"]: Got a SDP description:
v=0
o=- 1188340656180883 1 IN IP4 192.168.1.90
s=Session streamed with GStreamer
i=rtsp-server
t=0 0
a=tool:GStreamer
a=type:broadcast
a=range:npt=now-
a=control:rtsp://192.168.1.90/axis-media/media.amp
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:50000
a=rtpmap:96 H264/90000
a=fmtp:96 
packetization-mode=1;profile-level-id=420029;sprop-parameter-sets=Z0IAKeKQCgC3YC3AQEB4eJEV,aM48gA==
a=control:rtsp://192.168.1.90/axis-media/media.amp/stream=0
a=framerate:20.000000
a=transform:-1.000000,0.000000,0.000000;0.000000,-1.000000,0.000000;0.000000,0.000000,1.000000

[URL:"rtsp://192.168.1.90/axis-media/media.amp/"]: Initiated the 
"video/H264" subsession (client ports 54028-54029)
Sending request: SETUP rtsp://192.168.1.90/axis-media/media.amp/stream=0 
RTSP/1.0
CSeq: 3
User-Agent: ./testRTSPClient (LIVE555 Streaming Media v2016.02.22)
Transport: RTP/AVP;unicast;client_port=54028-54029


Received 237 new bytes of response data.
Received a complete SETUP response:
RTSP/1.0 200 OK
CSeq: 3
Transport: 
RTP/AVP;unicast;client_port=54028-54029;server_port=50000-50001;ssrc=DDB8A9EB;mode="PLAY"
Server: GStreamer RTSP server
Session: nejiZy3Kl7WBhINH; timeout=60
Date: Tue, 23 Aug 2016 12:14:09 GMT


[URL:"rtsp://192.168.1.90/axis-media/media.amp/"]: Set up the 
"video/H264" subsession (client ports 54028-54029)
[URL:"rtsp://192.168.1.90/axis-media/media.amp/"]: Created a data sink 
for the "video/H264" subsession
Sending request: PLAY rtsp://192.168.1.90/axis-media/media.amp RTSP/1.0
CSeq: 4
User-Agent: ./testRTSPClient (LIVE555 Streaming Media v2016.02.22)
Session: nejiZy3Kl7WBhINH
Range: npt=0.000-


Received 244 new bytes of response data.
Received a complete PLAY response:
RTSP/1.0 200 OK
CSeq: 4
RTP-Info: 
url=rtsp://192.168.1.90/axis-media/media.amp/stream=0;seq=627;rtptime=1087975871
Range: npt=now-
Server: GStreamer RTSP server
Session: nejiZy3Kl7WBhINH; timeout=60
Date: Tue, 23 Aug 2016 12:14:09 GMT


[URL:"rtsp://192.168.1.90/axis-media/media.amp/"]: Started playing 
session...
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
73237 bytes.   Presentation time: 1471954453.082768!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
9293 bytes.    Presentation time: 1471954453.142779!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
8553 bytes.    Presentation time: 1471954453.182767!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
8509 bytes.    Presentation time: 1471954453.242767!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
7413 bytes.    Presentation time: 1471954453.282767!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
7109 bytes.    Presentation time: 1471954453.342755!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
6689 bytes.    Presentation time: 1471954453.382766!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
6809 bytes.    Presentation time: 1471954453.442766!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
6277 bytes.    Presentation time: 1471954453.482766!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
6029 bytes.    Presentation time: 1471954453.542766!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
6005 bytes.    Presentation time: 1471954453.582766!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
6169 bytes.    Presentation time: 1471954453.642766!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
5825 bytes.    Presentation time: 1471954453.682766!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
5561 bytes.    Presentation time: 1471954453.742766!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
5545 bytes.    Presentation time: 1471954453.782777!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
5821 bytes.    Presentation time: 1471954453.842765!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
5493 bytes.    Presentation time: 1471954453.882776!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
5261 bytes.    Presentation time: 1471954453.942776!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
5373 bytes.    Presentation time: 1471954453.982764!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
5469 bytes.    Presentation time: 1471954454.042764!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
69773 bytes.   Presentation time: 1471954454.082764!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
9109 bytes.    Presentation time: 1471954454.142775!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
8373 bytes.    Presentation time: 1471954454.182763!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
8045 bytes.    Presentation time: 1471954454.242763!
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
7253 bytes.    Presentation time: 1471954450.998845
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
6789 bytes.    Presentation time: 1471954451.058833
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
6185 bytes.    Presentation time: 1471954451.098833

...

...

Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
795 bytes.     Presentation time: 1471954514.599226
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
840 bytes.     Presentation time: 1471954514.659214
Stream "rtsp://192.168.1.90/axis-media/media.amp/"; video/H264: Received 
847 bytes.     Presentation time: 1471954514.699236




More information about the live-devel mailing list