[Live-devel] RTSP Server 'Keep Alive' support

Glen Gray slaine at slaine.org
Tue Sep 18 09:05:52 PDT 2007


Hey guys,

Further to my previous  questions on this. I'm wondering how to activate 
this feature and I'm still not sure on the standards as it's not my area 
of expertise. From what I can see in RFC2326, the servers response to 
SETUP is to populate the Transport: field with the timeout period in 
seconds ("...; timeout=60;"). I can't see this in the RTSPServer.cpp 
code (lines 797 - 838 is where I looked) or in the response I'm getting 
back from the server (attached below)

To get this to work on the Kasenna's you've to notify the server that 
you want it to use KeepAlive support. This is done in a pretty strange 
way, by setting the User-Agent string to have an _KA appended to the end.

Is there anything I should be doing in VLC's demuxer to get mediaServer 
to use KeepAlive ?

I'd previously submitted a patch to parse out the timeout value in the 
RTSPClient code. VLC checks for this value and then sets up the 
GET_PARAMETER sending function to fire every timeout-2 seconds

I'm testing with vlc-0.8.6c against the current live release and the 
mediaServer streaming an mpeg2 file. As you can see below, there's 
nothing coming back for me to trap. And with no activity (vlc doesn't 
send RTCP "RR" packets) live's mediaServer just keeps on serving to the 
client.

Thanks in advance for any help you can give on this.

Remote control interface initialized. Type `help' for help.
Sending request: OPTIONS rtsp://192.168.2.31:8554/bourne.ts RTSP/1.0
CSeq: 1
User-Agent: VLC media player (LIVE555 Streaming Media v2007.08.03)


Received OPTIONS response: RTSP/1.0 200 OK
CSeq: 1
Date: Tue, Sep 18 2007 15:13:04 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE


Sending request: DESCRIBE rtsp://192.168.2.31:8554/bourne.ts RTSP/1.0
CSeq: 2
Accept: application/sdp
User-Agent: VLC media player (LIVE555 Streaming Media v2007.08.03)


Received DESCRIBE response: RTSP/1.0 200 OK
CSeq: 2
Date: Tue, Sep 18 2007 15:13:04 GMT
Content-Base: rtsp://192.168.2.31:8554/bourne.ts/
Content-Type: application/sdp
Content-Length: 393


Need to read 393 extra bytes
Read 393 extra bytes: v=0
o=- 1190128384983870 1 IN IP4 192.168.2.31
s=MPEG Transport Stream, streamed by the LIVE555 Media Server
i=bourne.ts
t=0 0
a=tool:LIVE555 Streaming Media v2007.08.03
a=type:broadcast
a=control:*
a=range:npt=0-6238.254
a=x-qt-text-nam:MPEG Transport Stream, streamed by the LIVE555 Media Server
a=x-qt-text-inf:bourne.ts
m=video 0 RTP/AVP 33
c=IN IP4 0.0.0.0
a=control:track1

Sending request: SETUP rtsp://192.168.2.31:8554/bourne.ts/track1 RTSP/1.0
CSeq: 3
Transport: RTP/AVP;unicast;client_port=32784-32785
User-Agent: VLC media player (LIVE555 Streaming Media v2007.08.03)


Received SETUP response: RTSP/1.0 200 OK
CSeq: 3
Date: Tue, Sep 18 2007 15:13:04 GMT
Transport: 
RTP/AVP;unicast;destination=192.168.2.215;source=192.168.2.31;client_port=32784-32785;server_port=6970-6971
Session: 1


Sending request: PLAY rtsp://192.168.2.31:8554/bourne.ts/ RTSP/1.0
CSeq: 4
Session: 1
Range: npt=0.000-
User-Agent: VLC media player (LIVE555 Streaming Media v2007.08.03)


Received PLAY response: RTSP/1.0 200 OK
CSeq: 4
Date: Tue, Sep 18 2007 15:13:04 GMT
Range: npt=0.000-
Session: 1
RTP-Info: 
url=rtsp://192.168.2.31:8554/bourne.ts/track1;seq=7191;rtptime=1800190741

Ross Finlayson wrote:
>> Wondering if the liveMedia/RTSPServer.cpp code has support for 'Keep
>> Alive' functionality ?
>>     
>
> Yes.  Note the "reclamationTestSeconds" parameter (default value, 45 
> seconds) in "RTSPServer::createNew()".
>
>   
>> I see from the source code that it accepts the GET_PARAMETER calls and
>> responds to the client, but doesn't seem to do anything regarding the
>> session.
>>     
>
> Yes it does.  The server treats either an incoming RTCP "RR" packet, 
> or any RTSP command (not just "GET_PARAMETER") as indicating client 
> liveness.
>
> Note, though, that if you requested RTP-over-TCP streaming, then 
> (because of software limitations) the server will not see any RTSP 
> requests after "PLAY".  However, incoming RTCP "RR" packets will 
> always be handled (and used to indicate client liveness).
>
> All standards-clompliant RTSP/RTP clients should send RTCP "RR" packets.
>   


-- 
Glen Gray <slaine at slaine.org>



More information about the live-devel mailing list