So after some digging it appears the slow down I see when using TCP is due to a slow connection to the proxy. See the code in RTPInterface.cpp.
In the function RTPInterface::sendRTPorRTCPPacketOverTCP. The first send of the header is non-blocking, the second send is blocking ( the last parameter on sendDataOverTCP is set to True, which forces a blocking send). It also causes a problem with a duplicate data being sent again, we see this on the client side. Most clients seem to handle this but if your client is based off of the reference source (osrtspserver) it will fail. It seems that a EAGAIN can still occur even if the data was sent. I would guess the send must have succeed in this case? So I see two issues: 1. The blocking call to the second send in sendDataOverTCP to send the data after the header can block for significant amount of time if the connection is slow. (slowing the entire event loop) 2. The second send must fail with EAGAIN, but still the data must have been sent. I think send on a non-blocking socket can send paritial and you must check to see how much was sent and only send what is left over? Craig On 11/27/2013 12:46 PM, Craig Matsuura wrote: Hi Ross, I have a question. Running two live555proxyServers and clients. Using both openRTSP and gstreamer as clients. Here is my setup. * live proxy 1 (openRTSP 172.16.10.100) connect to camera * Client 1 (172.16.10.100) connected to live proxy 1 (172.16.10.100) * live proxy 2 (192.168.3.250) connect to live proxy 1 * Client 2 (gstream client 192.168.3.25) connect to live proxy 2 Both client 1 and client 2 slow down, when client 2 connects. Is there a setting or configuration I can use to solve this problem. slow down is much worse with client 2 is a gst playbin2. We have seen this on other types of clients connecting TCP (as client 2). We have a configuration where we need a proxy at once source and a proxy at a different source. We want to use the same code base from live555. We initial had different implementations, one based on live555 and another based on a different rtsp server, and did not have and slow down issues, but had other problems. Below are the outputs and calling parameters on the proxies and openRTSP (client). Thanks,. Craig Client are connecting via TCP (-t). ------------------------------------ 192.168.3.250> ./openRTSP -V -t -Q -d 10 rtsp://192.168.3.250:8554/Video Opened URL "rtsp://192.168.3.250:8554/Video"<rtsp://192.168.3.250:8554/Video>, returning a SDP description: v=0 o=- 1385580361225980 1 IN IP4 192.168.3.250 s=LIVE555 Streaming Media v2013.11.26 i=LIVE555 Streaming Media v2013.11.26 t=0 0 a=tool:LIVE555 Streaming Media v2013.11.26 a=type:broadcast a=control:* a=range:npt=0- a=x-qt-text-nam:LIVE555 Streaming Media v2013.11.26 a=x-qt-text-inf:LIVE555 Streaming Media v2013.11.26 m=video 0 RTP/AVP 96 c=IN IP4 0.0.0.0 b=AS:50 a=rtpmap:96 H264/90000 a=fmtp:96 packetization-mode=1;profile-level-id=64401F;sprop-parameter-sets=J2RAH6wsagFAFumoKDAqAAAH0gAB1MAo,KO4EYsA= a=control:track1 Created receiver for "video/H264" subsession (client ports 39104-39105) Setup "video/H264" subsession (client ports 39104-39105) Created output file: "video-H264-1" Started playing session Receiving streamed data (for up to 10.000000 seconds)... begin_QOS_statistics subsession video/H264 num_packets_received 290 num_packets_lost 0 elapsed_measurement_time 10.001134 kBytes_received_total 372.718000 measurement_sampling_interval_ms 1000 kbits_per_second_min 0.000000 kbits_per_second_ave 298.140591 kbits_per_second_max 1154.382976 packet_loss_percentage_min 0.000000 packet_loss_percentage_ave 0.000000 packet_loss_percentage_max 0.000000 inter_packet_gap_ms_min 0.002000 inter_packet_gap_ms_ave 26.072645 inter_packet_gap_ms_max 2007.246000 end_QOS_statistics First live Proxy on pointed to second live proxy (Note 192.168.3.216 is port forward from the 172.16.10.100) ------------------------------------------------------------------------------------------------------------ 192.168.3.250> ./live555ProxyServer.x86 rtsp://192.168.3.216/Video LIVE555 Proxy Server (LIVE555 Streaming Media library version 2013.11.26) RTSP stream, proxying the stream "rtsp://192.168.3.216/Video"<rtsp://192.168.3.216/Video> Play this stream using the URL: rtsp://192.168.3.250:8554/Video (We use port 8000 for optional RTSP-over-HTTP tunneling.) Second live Proxy pointed to camera to stream --------------------------------------------- root@touchlink-847e405d04f4:~# ./live555ProxyServer -V rtsp://172.16.10.101:554/ live.sdpADDRCONF(NETDEV_CHANGE): eth0: link becomes ready LIVE555 Proxy Server (LIVE555 Streaming Media library version 2013.11.26) Opening connection to 172.16.10.101, port 554... RTSP stream, proxying the stream "rtsp://172.16.10.101:554/live.sdp"<rtsp://172.16.10.101:554/live.sdp> Play this stream using the URL: rtsp://172.16.10.100/Video (We use port 80 for optional RTSP-over-HTTP tunneling.) ...remote connection opened Sending request: DESCRIBE rtsp://172.16.10.101:554/live.sdp RTSP/1.0 CSeq: 2 User-Agent: ProxyRTSPClient (LIVE555 Streaming Media v2013.11.26) Accept: application/sdp Received 510 new bytes of response data. Received a complete DESCRIBE response: RTSP/1.0 200 OK CSeq: 2 Date: Wed, 27 Nov 2013 12:25:5 GMT Content-Base: rtsp://172.16.10.101/live.sdp/ Content-Type: application/sdp Content-Length: 348 v=0 o=RTSP 1385555105 945 IN IP4 0.0.0.0 s=RTSP server c=IN IP4 0.0.0.0 t=0 0 a=charset:Shift_JIS a=range:npt=0- a=control:* a=etag:1234567890 m=video 0 RTP/AVP 98 b=AS:0 a=rtpmap:98 H264/90000 a=control:trackID=1 a=fmtp:98 packetization-mode=1; profile-level-id=64401f; sprop-parameter-sets=J2RAH6wsagFAFumoKDAqAAAH0gAB1MAo,KO4EYsA= ProxyServerMediaSession["rtsp://172.16.10.101/live.sdp/"<rtsp://172.16.10.101/live.sdp/>] added new "ProxyServerMediaSubsession" for RTP/video/H264 track Sending request: OPTIONS rtsp://172.16.10.101/live.sdp/ RTSP/1.0 CSeq: 3 User-Agent: ProxyRTSPClient (LIVE555 Streaming Media v2013.11.26) Received 145 new bytes of response data. Received a complete OPTIONS response: RTSP/1.0 200 OK CSeq: 3 Date: Wed, 27 Nov 2013 12:25:35 GMT Public: OPTIONS, DESCRIBE, PLAY, SETUP, GET_PARAMETER, SET_PARAMETER, TEARDOWN ProxyServerMediaSubsession["H264"]::createNewStreamSource(session id 0) Initiated: ProxyServerMediaSubsession["H264"] ProxyServerMediaSubsession["H264"]::createNewRTPSink() ProxyServerMediaSubsession["H264"]::closeStreamSource() ProxyServerMediaSubsession["H264"]::createNewStreamSource(session id 3097014589) Sending request: SETUP rtsp://172.16.10.101/live.sdp/trackID=1 RTSP/1.0 CSeq: 4 User-Agent: ProxyRTSPClient (LIVE555 Streaming Media v2013.11.26) Transport: RTP/AVP;unicast;client_port=56926-56927 ProxyServerMediaSubsession["H264"]::createNewRTPSink() Received 169 new bytes of response data. Received a complete SETUP response: RTSP/1.0 200 OK CSeq: 4 Date: Wed, 27 Nov 2013 12:25:43 GMT Session: 15618451;timeout=70 Transport: RTP/AVP;unicast;client_port=56926-56927;server_port=5580-5581 ProxyRTSPClient["rtsp://172.16.10.101/live.sdp/"<rtsp://172.16.10.101/live.sdp/>]::continueAfterSETUP(): head codec: H264; numSubsessions 1 queue: H264 Sending request: PLAY rtsp://172.16.10.101/live.sdp/ RTSP/1.0 CSeq: 5 User-Agent: ProxyRTSPClient (LIVE555 Streaming Media v2013.11.26) Session: 15618451 Received 201 new bytes of response data. Received a complete PLAY response: RTSP/1.0 200 OK CSeq: 5 Date: Wed, 27 Nov 2013 12:25:43 GMT Session: 15618451;timeout=70 RTP-Info: url=rtsp://172.16.10.101/live.sdp/trackID=1;seq=0;rtptime=0 Range: npt=0- RTCP-Interval: 250 Sending request: OPTIONS rtsp://172.16.10.101/live.sdp/ RTSP/1.0 CSeq: 6 User-Agent: ProxyRTSPClient (LIVE555 Streaming Media v2013.11.26) Session: 15618451 Received 144 new bytes of response data. Received a complete OPTIONS response: RTSP/1.0 200 OK CSeq: 6 Date: Wed, 27 Nov 2013 12:26:3 GMT Public: OPTIONS, DESCRIBE, PLAY, SETUP, GET_PARAMETER, SET_PARAMETER, TEARDOWN Sending request: OPTIONS rtsp://172.16.10.101/live.sdp/ RTSP/1.0 CSeq: 7 User-Agent: ProxyRTSPClient (LIVE555 Streaming Media v2013.11.26) Session: 15618451 Received 145 new bytes of response data. Received a complete OPTIONS response: RTSP/1.0 200 OK CSeq: 7 Date: Wed, 27 Nov 2013 12:26:41 GMT Public: OPTIONS, DESCRIBE, PLAY, SETUP, GET_PARAMETER, SET_PARAMETER, TEARDOWN Sending request: OPTIONS rtsp://172.16.10.101/live.sdp/ RTSP/1.0 CSeq: 8 User-Agent: ProxyRTSPClient (LIVE555 Streaming Media v2013.11.26) Session: 15618451 Received 145 new bytes of response data. Received a complete OPTIONS response: RTSP/1.0 200 OK CSeq: 8 Date: Wed, 27 Nov 2013 12:27:35 GMT Public: OPTIONS, DESCRIBE, PLAY, SETUP, GET_PARAMETER, SET_PARAMETER, TEARDOWN Sending request: OPTIONS rtsp://172.16.10.101/live.sdp/ RTSP/1.0 CSeq: 9 User-Agent: ProxyRTSPClient (LIVE555 Streaming Media v2013.11.26) Session: 15618451 Received 145 new bytes of response data. Received a complete OPTIONS response: RTSP/1.0 200 OK CSeq: 9 Date: Wed, 27 Nov 2013 12:28:27 GMT Public: OPTIONS, DESCRIBE, PLAY, SETUP, GET_PARAMETER, SET_PARAMETER, TEARDOWN Sending request: OPTIONS rtsp://172.16.10.101/live.sdp/ RTSP/1.0 CSeq: 10 User-Agent: ProxyRTSPClient (LIVE555 Streaming Media v2013.11.26) Session: 15618451 Received 145 new bytes of response data. Received a complete OPTIONS response: RTSP/1.0 200 OK CSeq: 10 Date: Wed, 27 Nov 2013 12:29:1 GMT Public: OPTIONS, DESCRIBE, PLAY, SETUP, GET_PARAMETER, SET_PARAMETER, TEARDOWN Sending request: OPTIONS rtsp://172.16.10.101/live.sdp/ RTSP/1.0 CSeq: 11 User-Agent: ProxyRTSPClient (LIVE555 Streaming Media v2013.11.26) Session: 15618451 Received 145 new bytes of response data. Received a complete OPTIONS response: RTSP/1.0 200 OK CSeq: 11 Date: Wed, 27 Nov 2013 12:30:1 GMT Public: OPTIONS, DESCRIBE, PLAY, SETUP, GET_PARAMETER, SET_PARAMETER, TEARDOWN Sending request: OPTIONS rtsp://172.16.10.101/live.sdp/ RTSP/1.0 CSeq: 12 User-Agent: ProxyRTSPClient (LIVE555 Streaming Media v2013.11.26) Session: 15618451 Received 146 new bytes of response data. Received a complete OPTIONS response: RTSP/1.0 200 OK CSeq: 12 Date: Wed, 27 Nov 2013 12:30:40 GMT Public: OPTIONS, DESCRIBE, PLAY, SETUP, GET_PARAMETER, SET_PARAMETER, TEARDOWN
_______________________________________________ live-devel mailing list live-devel@lists.live555.com http://lists.live555.com/mailman/listinfo/live-devel