[Live-devel] RTP-over-TCP streaming (Noam Camiel)

Noam Camiel noamatari at yahoo.com
Thu Oct 25 09:44:20 PDT 2007


Ross Finlayson:
> This is not relevant to our implementation, because our server also 
> uses RTCP "RR" packets - coming from the client - as a keep-alive, 
> and clients (including ours) send those far more frequently than once 
> every 80 seconds.
> 
> If you have a client that is properly sending back RTCP "RR" packets, 
> then our server should not time out the stream, for either UDP or TCP 
> streams.


After some more checking it looks like the problem, like you said, is not keep-alives
but with RTSP messages sent to the server during video playing. 

If any RTSP message is sent from the client during the playing of video
(following a PLAY command), there is a chance the RTSP message
will cause the video stream to stop.

It is not certain whether a given RTSP messge sent during play will cause
the video playing to stop and that's why varying times of video playing
have been seen.

Here's some technical analysis:

When an RTSP message is sent during playing of video, it can end up at the
server in one of two places:
1. SocketDescriptor::tcpReadHandler() in RTPInterface.cpp
2. RTSPServer::RTSPClientSession::incomingRequestHandler1() in RTSPServer.cpp

If the RTSP messgae is received in (1), the message will cause the video stream to stop.
This is because the routine that reads from the socket looks for a '$' character that does not
exist in RTSP message, hence causing the stream to stop by calling
env.taskScheduler().turnOffBackgroundReadHandling()
As a result the picture on the client freezes and after a short while the client times out.

If the RTSP message is received in (2), the message is supposed to be handled correctly 
as other RTSP messgaes, however during play the received RTSP message stored in 
ptr = &fRequestBuffer[fRequestBytesAlreadySeen] may sometimes be different to the
contents in fRequestBuffer used when calling parseRTSPRequestString() several lines later.
This may be due to background frame reading?

I have seen some cases where a legal RTSP message was sent to the server, 
the message ended up in (2), was received correctly but parseRTSPRequestString() failed
because it tried to parse a video data messae (beginning with '$'). Somehow the 
contents of the RTSP data has been overridden.
As a result the server sent a "405 Method Not Alllowed" causing the stream to stop.

I would appreciate any remarks and info on the above.
Thanks
Noam






__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the live-devel mailing list