[Live-devel] Dead lock on 408 Request timeout
Eric Beuque
eric.beuque at jet1oeil.com
Mon Oct 5 02:53:02 PDT 2020
> On Oct 4, 2020, at 8:16 PM, Alexander Tumarov <alextai at servision.net>
> wrote:
> >
> > You are receiving an additional response to Describe command that was
> previously received completely ( CSeq: 4).
> > Your setup sent with CSeq: 5 but response came to CSeq: 4 - Handler for
> this was already completed.
>
> Yes, this seems to be a bug in the RTSP server (network camera?). You
> should contact the manufacturer of this device (which, remember, is likely
> something that you paid for), asking them to fix this.
>
I actually also think there is a bug in the camera. I'm using hundreds of
cameras without problem, but this happen only with a Samsung camera. In
fact, i found maybe the problem is before the SETUP command.
My application start an RTSP to get the video stream. I also send an
OPTIONS command every 10 seconds to notify we are still alive (some cameras
need it otherwise they close the stream).
If we receive no video data within 30 seconds, we close the stream and we
try to restart it. The SETUP command fails, but some OPTIONS commands don't
receive any answer. The camera seems to be in a state where not able to
send any data. I just need a workaround to get livemedia not blocked, even
if the camera is buggy.
Is it a bad practice to send the OPTIONS commands like i do ? Maybe i have
a bug in my application, i'm doing something wrong.
I tried the openrtsp command, and this seems to work, but it's not sending
OPTIONS commands like me, i guess.
I will try to write a sample program to reproduce the problem.
Here an extract my code :
void continueAfterSETUP(RTSPClient* rtspClient, int resultCode, char*
resultString)
{
.... somethings ...
m_pMediaSubsession->sink->startPlaying(*(m_pMediaSubsession->readSource()),
CustomRTSPClient::subsessionAfterPlaying, m_pMediaSubsession);
.... somethings ...
m_streamCheckAliveTask =
m_env->taskScheduler().scheduleDelayedTask(TIMEOUT_CHECKALIVE,
(TaskFunc*)CustomRTSPClient::streamCheckAliveHandler, rtspClient);
.... somethings ...
}
void streamCheckAliveHandler(CustomRTSPClient* rtspClient)
{
TkCore::TimevalNow tvNow;
if(tvNow.diffMs(m_tvLastPacket) > 30000)
{
m_bError = true; // Timeout is an error
TkCore::Logger::debug("[Access::livemedia] No data received in
the last %d ms", 30000);
m_streamCheckAliveTask = NULL;
// Shutdown the stream
shutdownStream(rtspClient);
}else{
// Some stream have a session timeout, so we need to send a
command to tell we are alive
// Axis camera with firmware >= 5.60
m_pRtspClient->sendOptionsCommand(CustomRTSPClient::handlePingWithOPTIONS);
m_streamCheckAliveTask =
m_env->taskScheduler().scheduleDelayedTask(TIMEOUT_CHECKALIVE,
(TaskFunc*)CustomRTSPClient::streamCheckAliveHandler, rtspClient);
}
}
Here the logs :
12:02:15,269502 [LibLiveMedia] Sending request: OPTIONS rtsp://
192.168.1.3/onvif/profile2/media.smp RTSP/1.0
12:02:15,269542 [LibLiveMedia] CSeq: 22365
12:02:15,269557 [LibLiveMedia] Authorization: Digest username="admin",
realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://
192.168.1.3/onvif/profile2/media.smp",
response="76d96766be1ff27aa5f7875520a013d9"
12:02:15,269568 [LibLiveMedia] User-Agent: LIVE555 Streaming Media
v2018.11.26
12:02:15,269580 [LibLiveMedia] Session: 27543
12:02:15,269593 [LibLiveMedia]
12:02:15,269666 [LibLiveMedia] Sending request: OPTIONS rtsp://
192.168.1.3/onvif/profile2/media.smp RTSP/1.0
12:02:15,269692 [LibLiveMedia] CSeq: 22366
12:02:15,269706 [LibLiveMedia] Authorization: Digest username="admin",
realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://
192.168.1.3/onvif/profile2/media.smp",
response="76d96766be1ff27aa5f7875520a013d9"
12:02:15,269721 [LibLiveMedia] User-Agent: LIVE555 Streaming Media
v2018.11.26
12:02:15,269747 [LibLiveMedia] Session: 27543
12:02:15,269759 [LibLiveMedia]
12:02:15,269822 [LibLiveMedia] Sending request: OPTIONS rtsp://
192.168.1.3/onvif/profile2/media.smp RTSP/1.0
12:02:15,269833 [LibLiveMedia] CSeq: 22367
12:02:15,269845 [LibLiveMedia] Authorization: Digest username="admin",
realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://
192.168.1.3/onvif/profile2/media.smp",
response="76d96766be1ff27aa5f7875520a013d9"
12:02:15,269856 [LibLiveMedia] User-Agent: LIVE555 Streaming Media
v2018.11.26
12:02:15,269882 [LibLiveMedia] Session: 27543
12:02:15,269894 [LibLiveMedia]
12:02:15,270739 [LibLiveMedia] Received a complete OPTIONS response:
12:02:15,270777 [LibLiveMedia] RTSP/1.0 200 OK
12:02:15,270790 [LibLiveMedia] CSeq: 22365
12:02:15,270801 [LibLiveMedia] Date: Sun, 04 Oct 2020 09:57:32 GMT
12:02:15,270813 [LibLiveMedia] Expires: Sun, 04 Oct 2020 09:57:32 GMT
12:02:15,270839 [LibLiveMedia] Cache-Control: must-revalidate
12:02:15,270852 [LibLiveMedia] Session: 27543;timeout=60
12:02:15,270878 [LibLiveMedia] Public: DESCRIBE, SETUP, TEARDOWN, PLAY,
PAUSE, OPTIONS, GET_PARAMETER, SET_PARAMETER
12:02:15,270891 [LibLiveMedia]
12:02:15,271304 [LibLiveMedia] Received a complete OPTIONS response:
12:02:15,271363 [LibLiveMedia] RTSP/1.0 200 OK
12:02:15,271374 [LibLiveMedia] CSeq: 22366
12:02:15,271385 [LibLiveMedia] Date: Sun, 04 Oct 2020 09:57:32 GMT
12:02:15,271397 [LibLiveMedia] Expires: Sun, 04 Oct 2020 09:57:32 GMT
12:02:15,271408 [LibLiveMedia] Cache-Control: must-revalidate
12:02:15,271419 [LibLiveMedia] Session: 27543;timeout=60
12:02:15,271431 [LibLiveMedia] Public: DESCRIBE, SETUP, TEARDOWN, PLAY,
PAUSE, OPTIONS, GET_PARAMETER, SET_PARAMETER
12:02:15,271442 [LibLiveMedia]
12:02:15,312308 [LibLiveMedia] Received a complete OPTIONS response:
12:02:15,312342 [LibLiveMedia] RTSP/1.0 200 OK
12:02:15,312353 [LibLiveMedia] CSeq: 22367
12:02:15,312364 [LibLiveMedia] Date: Sun, 04 Oct 2020 09:57:32 GMT
12:02:15,312376 [LibLiveMedia] Expires: Sun, 04 Oct 2020 09:57:32 GMT
12:02:15,312387 [LibLiveMedia] Cache-Control: must-revalidate
12:02:15,312398 [LibLiveMedia] Session: 27543;timeout=60
12:02:15,312409 [LibLiveMedia] Public: DESCRIBE, SETUP, TEARDOWN, PLAY,
PAUSE, OPTIONS, GET_PARAMETER, SET_PARAMETER
12:02:15,312421 [LibLiveMedia]
12:02:25,269835 [LibLiveMedia] Sending request: OPTIONS rtsp://
192.168.1.3/onvif/profile2/media.smp RTSP/1.0
12:02:25,269882 [LibLiveMedia] CSeq: 22368
12:02:25,269905 [LibLiveMedia] Authorization: Digest username="admin",
realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://
192.168.1.3/onvif/profile2/media.smp",
response="76d96766be1ff27aa5f7875520a013d9"
12:02:25,269928 [LibLiveMedia] User-Agent: LIVE555 Streaming Media
v2018.11.26
12:02:25,269939 [LibLiveMedia] Session: 27543
12:02:25,269950 [LibLiveMedia]
12:02:25,270088 [LibLiveMedia] Sending request: OPTIONS rtsp://
192.168.1.3/onvif/profile2/media.smp RTSP/1.0
12:02:25,270110 [LibLiveMedia] CSeq: 22369
12:02:25,270122 [LibLiveMedia] Authorization: Digest username="admin",
realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://
192.168.1.3/onvif/profile2/media.smp",
response="76d96766be1ff27aa5f7875520a013d9"
12:02:25,270144 [LibLiveMedia] User-Agent: LIVE555 Streaming Media
v2018.11.26
12:02:25,270156 [LibLiveMedia] Session: 27543
12:02:25,270167 [LibLiveMedia]
12:02:25,270235 [LibLiveMedia] Sending request: OPTIONS rtsp://
192.168.1.3/onvif/profile2/media.smp RTSP/1.0
12:02:25,270258 [LibLiveMedia] CSeq: 22370
12:02:25,270269 [LibLiveMedia] Authorization: Digest username="admin",
realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://
192.168.1.3/onvif/profile2/media.smp",
response="76d96766be1ff27aa5f7875520a013d9"
12:02:25,270292 [LibLiveMedia] User-Agent: LIVE555 Streaming Media
v2018.11.26
12:02:25,270303 [LibLiveMedia] Session: 27543
12:02:25,270314 [LibLiveMedia]
12:02:35,270303 [LibLiveMedia] Sending request: OPTIONS rtsp://
192.168.1.3/onvif/profile2/media.smp RTSP/1.0
12:02:35,270353 [LibLiveMedia] CSeq: 22371
12:02:35,270377 [LibLiveMedia] Authorization: Digest username="admin",
realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://
192.168.1.3/onvif/profile2/media.smp",
response="76d96766be1ff27aa5f7875520a013d9"
12:02:35,270400 [LibLiveMedia] User-Agent: LIVE555 Streaming Media
v2018.11.26
12:02:35,270424 [LibLiveMedia] Session: 27543
12:02:35,270449 [LibLiveMedia]
12:02:35,270541 [LibLiveMedia] Sending request: OPTIONS rtsp://
192.168.1.3/onvif/profile2/media.smp RTSP/1.0
12:02:35,270563 [LibLiveMedia] CSeq: 22372
12:02:35,270576 [LibLiveMedia] Authorization: Digest username="admin",
realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://
192.168.1.3/onvif/profile2/media.smp",
response="76d96766be1ff27aa5f7875520a013d9"
12:02:35,270602 [LibLiveMedia] User-Agent: LIVE555 Streaming Media
v2018.11.26
12:02:35,270615 [LibLiveMedia] Session: 27543
12:02:35,270640 [LibLiveMedia]
12:02:35,270700 [LibLiveMedia] Sending request: OPTIONS rtsp://
192.168.1.3/onvif/profile2/media.smp RTSP/1.0
12:02:35,270734 [LibLiveMedia] CSeq: 22373
12:02:35,270757 [LibLiveMedia] Authorization: Digest username="admin",
realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://
192.168.1.3/onvif/profile2/media.smp",
response="76d96766be1ff27aa5f7875520a013d9"
12:02:35,270781 [LibLiveMedia] User-Agent: LIVE555 Streaming Media
v2018.11.26
12:02:35,270804 [LibLiveMedia] Session: 27543
12:02:35,270826 [LibLiveMedia]
12:02:45,270793 [LibLiveMedia] Sending request: OPTIONS rtsp://
192.168.1.3/onvif/profile2/media.smp RTSP/1.0
12:02:45,270835 [LibLiveMedia] CSeq: 22374
12:02:45,270860 [LibLiveMedia] Authorization: Digest username="admin",
realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://
192.168.1.3/onvif/profile2/media.smp",
response="76d96766be1ff27aa5f7875520a013d9"
12:02:45,270871 [LibLiveMedia] User-Agent: LIVE555 Streaming Media
v2018.11.26
12:02:45,270882 [LibLiveMedia] Session: 27543
12:02:45,270894 [LibLiveMedia]
12:02:45,270975 [LibLiveMedia] Sending request: OPTIONS rtsp://
192.168.1.3/onvif/profile2/media.smp RTSP/1.0
12:02:45,270998 [LibLiveMedia] CSeq: 22375
12:02:45,271012 [LibLiveMedia] Authorization: Digest username="admin",
realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://
192.168.1.3/onvif/profile2/media.smp",
response="76d96766be1ff27aa5f7875520a013d9"
12:02:45,271025 [LibLiveMedia] User-Agent: LIVE555 Streaming Media
v2018.11.26
12:02:45,271036 [LibLiveMedia] Session: 27543
12:02:45,271049 [LibLiveMedia]
12:02:45,271114 [LibLiveMedia] Sending request: OPTIONS rtsp://
192.168.1.3/onvif/profile2/media.smp RTSP/1.0
12:02:45,271125 [LibLiveMedia] CSeq: 22376
12:02:45,271137 [LibLiveMedia] Authorization: Digest username="admin",
realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://
192.168.1.3/onvif/profile2/media.smp",
response="76d96766be1ff27aa5f7875520a013d9"
12:02:45,271150 [LibLiveMedia] User-Agent: LIVE555 Streaming Media
v2018.11.26
12:02:45,271174 [LibLiveMedia] Session: 27543
12:02:45,271187 [LibLiveMedia]
12:02:55,271131 [Access::livemedia] No data received in the last 30000 ms
12:02:55,271167 [Access::livemedia] Stream shutdown
12:02:55,271202 [LibLiveMedia] Sending request: TEARDOWN rtsp://
192.168.1.3/onvif/profile2/media.smp RTSP/1.0
12:02:55,271227 [LibLiveMedia] CSeq: 22377
12:02:55,271240 [LibLiveMedia] Authorization: Digest username="admin",
realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://
192.168.1.3/onvif/profile2/media.smp",
response="438cef6b16a7839417c834cfd22de050"
12:02:55,271253 [LibLiveMedia] User-Agent: LIVE555 Streaming Media
v2018.11.26
12:02:55,271266 [LibLiveMedia] Session: 27543
12:02:55,271278 [LibLiveMedia]
12:02:55,271305 [Access::livemedia] End of event loop
12:02:55,271350 [Access::livemedia] Stream shutdown
12:02:55,271361 [Access::livemedia] Closing the stream.
12:02:55,271418 [Access::livemedia] Stream shutdown done
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20201005/d1fb0b26/attachment-0001.htm>
More information about the live-devel
mailing list