[Live-devel] testOnDemandRTSPServer multicast question
Tim J Shackleton
live555 at timshackleton.com
Mon Dec 17 12:28:45 PST 2012
On 17/12/12 13:53, Ross Finlayson wrote:
> First, I'll try to look into exactly what's happening. If there's a
> bug in the supplied LIVE555 code, then I'll try to fix it.
>
Thanks Ross, I appreciate this greatly.
I have done a little further investigation myself and thought I'd share
it with you in case it helps.
I voided my warranty, so to speak, by adding a printf("."); to
BasicUDPSource::incomingPacketHandler1() in order to see when the source
is processing packets.
As expected, no packets are processed until the first client connects to
the RTSP server, at which time packets are processed at an expected rate.
When that client leaves, packets are no longer processed.
When the next client connects, packets seem to be processed, but
remarkably slower than when the first client was connected. Here's the
debug output to illustrate this:
> "test" stream, from a UDP Transport Stream input source
> (IP multicast address 239.200.1.102, port 5500)
> Play this stream using the URL "rtsp://10.2.1.182:8554/test"
> accept()ed connection from 10.201.17.53
> RTSPClientConnection[0x1ecbed0]::handleRequestBytes() read 121 new
> bytes:OPTIONS rtsp://10.2.1.182:8554/test RTSP/1.0
> CSeq: 2
> User-Agent: LibVLC/2.0.4 (LIVE555 Streaming Media v2012.09.13)
>
>
> parseRTSPRequestString() succeeded, returning cmdName "OPTIONS",
> urlPreSuffix "", urlSuffix "test", CSeq "2", Content-Length 0, with 0
> bytes following the message.
> sending response: RTSP/1.0 200 OK
> CSeq: 2
> Date: Mon, Dec 17 2012 20:11:07 GMT
> Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE,
> GET_PARAMETER, SET_PARAMETER
>
> RTSPClientConnection[0x1ecbed0]::handleRequestBytes() read 147 new
> bytes:DESCRIBE rtsp://10.2.1.182:8554/test RTSP/1.0
> CSeq: 3
> User-Agent: LibVLC/2.0.4 (LIVE555 Streaming Media v2012.09.13)
> Accept: application/sdp
>
>
> parseRTSPRequestString() succeeded, returning cmdName "DESCRIBE",
> urlPreSuffix "", urlSuffix "test", CSeq "3", Content-Length 0, with 0
> bytes following the message.
> sending response: RTSP/1.0 200 OK
> CSeq: 3
> Date: Mon, Dec 17 2012 20:11:07 GMT
> Content-Base: rtsp://10.2.1.182:8554/test/
> Content-Type: application/sdp
> Content-Length: 320
>
> v=0
> o=- 1355775062508879 1 IN IP4 10.2.1.182
> s=Session streamed by VPS-UAT
> i=test
> t=0 0
> a=tool:LIVE555 Streaming Media v2012.11.30
> a=type:broadcast
> a=control:*
> a=range:npt=0-
> a=x-qt-text-nam:Session streamed by VPS-UAT
> a=x-qt-text-inf:test
> m=video 0 RTP/AVP 33
> c=IN IP4 0.0.0.0
> b=AS:5000
> a=control:track1
> RTSPClientConnection[0x1ecbed0]::handleRequestBytes() read 176 new
> bytes:SETUP rtsp://10.2.1.182:8554/test/track1 RTSP/1.0
> CSeq: 4
> User-Agent: LibVLC/2.0.4 (LIVE555 Streaming Media v2012.09.13)
> Transport: RTP/AVP;unicast;client_port=1612-1613
>
>
> parseRTSPRequestString() succeeded, returning cmdName "SETUP",
> urlPreSuffix "test", urlSuffix "track1", CSeq "4", Content-Length 0,
> with 0 bytes following the message.
> sending response: RTSP/1.0 200 OK
> CSeq: 4
> Date: Mon, Dec 17 2012 20:11:07 GMT
> Transport:
> RTP/AVP;unicast;destination=10.201.17.53;source=10.2.1.182;client_port=1612-1613;server_port=6970-6971
> Session: 2283FFFD
>
> RTSPClientConnection[0x1ecbed0]::handleRequestBytes() read 157 new
> bytes:PLAY rtsp://10.2.1.182:8554/test/ RTSP/1.0
> CSeq: 5
> User-Agent: LibVLC/2.0.4 (LIVE555 Streaming Media v2012.09.13)
> Session: 2283FFFD
> Range: npt=0.000-
>
>
> parseRTSPRequestString() succeeded, returning cmdName "PLAY",
> urlPreSuffix "test", urlSuffix "", CSeq "5", Content-Length 0, with 0
> bytes following the message.
> sending response: RTSP/1.0 200 OK
> CSeq: 5
> Date: Mon, Dec 17 2012 20:11:07 GMT
> Range: npt=0.000-
> Session: 2283FFFD
> RTP-Info:
> url=rtsp://10.2.1.182:8554/test/track1;seq=12753;rtptime=3031997768
>
> ...RTSPClientConnection[0x1ecbed0]::handleRequestBytes() read 147 new
> bytes:GET_PARAMETER rtsp://10.2.1.182:8554/test/ RTSP/1.0
> CSeq: 6
> User-Agent: LibVLC/2.0.4 (LIVE555 Streaming Media v2012.09.13)
> Session: 2283FFFD
>
>
> parseRTSPRequestString() succeeded, returning cmdName "GET_PARAMETER",
> urlPreSuffix "test", urlSuffix "", CSeq "6", Content-Length 0, with 0
> bytes following the message.
> sending response: RTSP/1.0 200 OK
> CSeq: 6
> Date: Mon, Dec 17 2012 20:11:07 GMT
> Session: 2283FFFD
>
> ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................RTSP
> client session (id "2283FFFD", stream name "test"): Liveness indication
> ..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................RTSP
> client session (id "2283FFFD", stream name "test"): Liveness indication
> .................................................................................................................................................................................................................................................................................................................................................................................................................................................RTSP
> client session (id "2283FFFD", stream name "test"): Liveness indication
> RTSPClientConnection[0x1ecbed0]::handleRequestBytes() read 142 new
> bytes:TEARDOWN rtsp://10.2.1.182:8554/test/ RTSP/1.0
> CSeq: 7
> User-Agent: LibVLC/2.0.4 (LIVE555 Streaming Media v2012.09.13)
> Session: 2283FFFD
>
>
> parseRTSPRequestString() succeeded, returning cmdName "TEARDOWN",
> urlPreSuffix "test", urlSuffix "", CSeq "7", Content-Length 0, with 0
> bytes following the message.
> sending response: RTSP/1.0 200 OK
> CSeq: 7
> Date: Mon, Dec 17 2012 20:11:15 GMT
>
> RTSPClientConnection[0x1ecbed0]::handleRequestBytes() read -1 new
> bytes (of 10000); terminating connection!
Now, I reconnect that client:
> accept()ed connection from 10.201.17.53
> RTSPClientConnection[0x1ecbed0]::handleRequestBytes() read 121 new
> bytes:OPTIONS rtsp://10.2.1.182:8554/test RTSP/1.0
> CSeq: 2
> User-Agent: LibVLC/2.0.4 (LIVE555 Streaming Media v2012.09.13)
>
>
> parseRTSPRequestString() succeeded, returning cmdName "OPTIONS",
> urlPreSuffix "", urlSuffix "test", CSeq "2", Content-Length 0, with 0
> bytes following the message.
> sending response: RTSP/1.0 200 OK
> CSeq: 2
> Date: Mon, Dec 17 2012 20:12:40 GMT
> Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE,
> GET_PARAMETER, SET_PARAMETER
>
> RTSPClientConnection[0x1ecbed0]::handleRequestBytes() read 147 new
> bytes:DESCRIBE rtsp://10.2.1.182:8554/test RTSP/1.0
> CSeq: 3
> User-Agent: LibVLC/2.0.4 (LIVE555 Streaming Media v2012.09.13)
> Accept: application/sdp
>
>
> parseRTSPRequestString() succeeded, returning cmdName "DESCRIBE",
> urlPreSuffix "", urlSuffix "test", CSeq "3", Content-Length 0, with 0
> bytes following the message.
> sending response: RTSP/1.0 200 OK
> CSeq: 3
> Date: Mon, Dec 17 2012 20:12:40 GMT
> Content-Base: rtsp://10.2.1.182:8554/test/
> Content-Type: application/sdp
> Content-Length: 320
>
> v=0
> o=- 1355775062508879 1 IN IP4 10.2.1.182
> s=Session streamed by VPS-UAT
> i=test
> t=0 0
> a=tool:LIVE555 Streaming Media v2012.11.30
> a=type:broadcast
> a=control:*
> a=range:npt=0-
> a=x-qt-text-nam:Session streamed by VPS-UAT
> a=x-qt-text-inf:test
> m=video 0 RTP/AVP 33
> c=IN IP4 0.0.0.0
> b=AS:5000
> a=control:track1
> RTSPClientConnection[0x1ecbed0]::handleRequestBytes() read 176 new
> bytes:SETUP rtsp://10.2.1.182:8554/test/track1 RTSP/1.0
> CSeq: 4
> User-Agent: LibVLC/2.0.4 (LIVE555 Streaming Media v2012.09.13)
> Transport: RTP/AVP;unicast;client_port=1666-1667
>
>
> parseRTSPRequestString() succeeded, returning cmdName "SETUP",
> urlPreSuffix "test", urlSuffix "track1", CSeq "4", Content-Length 0,
> with 0 bytes following the message.
> sending response: RTSP/1.0 200 OK
> CSeq: 4
> Date: Mon, Dec 17 2012 20:12:40 GMT
> Transport:
> RTP/AVP;unicast;destination=10.201.17.53;source=10.2.1.182;client_port=1666-1667;server_port=6970-6971
> Session: 69932E25
>
> RTSPClientConnection[0x1ecbed0]::handleRequestBytes() read 157 new
> bytes:PLAY rtsp://10.2.1.182:8554/test/ RTSP/1.0
> CSeq: 5
> User-Agent: LibVLC/2.0.4 (LIVE555 Streaming Media v2012.09.13)
> Session: 69932E25
> Range: npt=0.000-
>
>
> parseRTSPRequestString() succeeded, returning cmdName "PLAY",
> urlPreSuffix "test", urlSuffix "", CSeq "5", Content-Length 0, with 0
> bytes following the message.
> sending response: RTSP/1.0 200 OK
> CSeq: 5
> Date: Mon, Dec 17 2012 20:12:40 GMT
> Range: npt=0.000-
> Session: 69932E25
> RTP-Info:
> url=rtsp://10.2.1.182:8554/test/track1;seq=39224;rtptime=2724475800
>
> ..............RTSPClientConnection[0x1ecbed0]::handleRequestBytes()
> read 147 new bytes:GET_PARAMETER rtsp://10.2.1.182:8554/test/ RTSP/1.0
> CSeq: 6
> User-Agent: LibVLC/2.0.4 (LIVE555 Streaming Media v2012.09.13)
> Session: 69932E25
>
>
> parseRTSPRequestString() succeeded, returning cmdName "GET_PARAMETER",
> urlPreSuffix "test", urlSuffix "", CSeq "6", Content-Length 0, with 0
> bytes following the message.
> sending response: RTSP/1.0 200 OK
> CSeq: 6
> Date: Mon, Dec 17 2012 20:12:40 GMT
> Session: 69932E25
>
> ..........................................................RTSP client
> session (id "69932E25", stream name "test"): Liveness indication
> .RTSP client session (id "69932E25", stream name "test"): Liveness
> indication
> .RTSP client session (id "69932E25", stream name "test"): Liveness
> indication
> ..RTSP client session (id "69932E25", stream name "test"): Liveness
> indication
> .RTSP client session (id "69932E25", stream name "test"): Liveness
> indication
> .RTSP client session (id "69932E25", stream name "test"): Liveness
> indication
> RTSPClientConnection[0x1ecbed0]::handleRequestBytes() read 142 new
> bytes:TEARDOWN rtsp://10.2.1.182:8554/test/ RTSP/1.0
> CSeq: 7
> User-Agent: LibVLC/2.0.4 (LIVE555 Streaming Media v2012.09.13)
> Session: 69932E25
>
>
> parseRTSPRequestString() succeeded, returning cmdName "TEARDOWN",
> urlPreSuffix "test", urlSuffix "", CSeq "7", Content-Length 0, with 0
> bytes following the message.
> sending response: RTSP/1.0 200 OK
> CSeq: 7
> Date: Mon, Dec 17 2012 20:13:11 GMT
>
> RTSPClientConnection[0x1ecbed0]::handleRequestBytes() read -1 new
> bytes (of 10000); terminating connection!
As you can see, the frequency that incomingPacketHandler1() is called is
much, much less. What I just noticed in addition to this, is that the
frequency of it's calling is proportional to the time between clients.
That is, if the client is reconnected quickly, more packets are
processed. However, the longer you wait between clients, the slower
they are processed. To illuminate this further, in the example directly
above, between clients I was formatting this email, probably 60+ seconds
between clients. This next segment I will paste, there will be only a
few seconds between clients:
> Session: CC070355
>
> .................................................................RTSP
> client session (id "CC070355", stream name "test"): Liveness indication
> ....................................................................................................RTSP
> client session (id "CC070355", stream name "test"): Liveness indication
> ....................................................................................RTSP
> client session (id "CC070355", stream name "test"): Liveness indication
> ...........................................................................RTSPClientConnection[0xe23f20]::handleRequestBytes()
> read 142 new bytes:TEARDOWN rtsp://10.2.1.182:8554/test/ RTSP/1.0
As you can see - much more data is received, but significantly less than
required!
So, it would seem to me that there's perhaps a timing delta being used
somewhere that becomes wildly incorrect between client connections
(supposing the client count becomes 0).
Hope this helps some!
Thanks and regards,
-Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20121218/01122bdd/attachment-0001.html>
More information about the live-devel
mailing list