<div dir="ltr"><div dir="ltr"><div><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"></div></div></div></div></div></div></div></div></div></div></div></div></div><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> On Oct 4, 2020, at 8:16 PM, Alexander Tumarov <<a href="mailto:alextai@servision.net" target="_blank">alextai@servision.net</a>> wrote:<br>
> <br>
> You are receiving an additional response to Describe command that was previously received completely ( CSeq: 4).<br>
> Your setup sent with CSeq: 5 but response came to CSeq: 4 - Handler for this was already completed.<br>
<br>
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.<br></blockquote><div><br></div><div>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.</div><div><br></div><div>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).</div><div>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.<br></div><div><br></div><div>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.</div><div>I tried the openrtsp command, and this seems to work, but it's not sending OPTIONS commands like me, i guess.</div><div><br></div><div>I will try to write a sample program to reproduce the problem.<br></div><div><br></div><div></div><div>Here an extract my code :<br></div><div><pre style="background-color:rgb(255,255,255);color:rgb(8,8,8);font-family:"JetBrains Mono",monospace"><span style="color:rgb(0,51,179)">void </span><span style="color:rgb(0,98,122)">continueAfterSETUP</span>(<span style="color:rgb(0,128,128)">RTSPClient</span>* rtspClient, <span style="color:rgb(0,51,179)">int </span>resultCode, <span style="color:rgb(0,51,179)">char</span>* resultString)<br>{<br></pre><pre style="background-color:rgb(255,255,255);color:rgb(8,8,8);font-family:"JetBrains Mono",monospace"> .... somethings ...<br><span style="color:rgb(102,14,122)"> m_pMediaSubsession</span>-><span style="color:rgb(102,14,122)">sink</span>->startPlaying(*(<span style="color:rgb(102,14,122)">m_pMediaSubsession</span>->readSource()), <span style="color:rgb(0,128,128)">CustomRTSPClient</span>::subsessionAfterPlaying, <span style="color:rgb(102,14,122)">m_pMediaSubsession</span>);<br> .... somethings ...<span style="color:rgb(102,14,122)"><br> m_streamCheckAliveTask </span>= <span style="color:rgb(102,14,122)">m_env</span>->taskScheduler().scheduleDelayedTask(<span style="color:rgb(31,84,46);font-weight:bold">TIMEOUT_CHECKALIVE</span>, (<span style="color:rgb(55,31,128)">TaskFunc</span>*)<span style="color:rgb(0,128,128)">CustomRTSPClient</span>::streamCheckAliveHandler, rtspClient);<br> .... somethings ...<br>}<br></pre></div><div><pre style="background-color:rgb(255,255,255);color:rgb(8,8,8);font-family:"JetBrains Mono",monospace"><span style="color:rgb(0,51,179)">void </span><span style="color:rgb(0,98,122)">streamCheckAliveHandler</span>(<span style="color:rgb(0,128,128)">CustomRTSPClient</span>* rtspClient)<br>{<br> <span style="color:rgb(0,128,128)">TkCore</span>::<span style="color:rgb(0,128,128)">TimevalNow </span><span style="color:rgb(0,0,0)">tvNow</span>;<br> <span style="color:rgb(0,51,179)">if</span>(<span style="color:rgb(0,0,0)">tvNow</span>.diffMs(<span style="color:rgb(102,14,122)">m_tvLastPacket</span>) > <span style="color:rgb(23,80,235)">30000</span>)<br> {<br> <span style="color:rgb(102,14,122)">m_bError </span>= <span style="color:rgb(0,51,179)">true</span>; <span style="color:rgb(140,140,140);font-style:italic">// Timeout is an error<br></span><span style="color:rgb(140,140,140);font-style:italic"> </span><span style="color:rgb(0,128,128)">TkCore</span>::<span style="color:rgb(0,128,128)">Logger</span>::debug(<span style="color:rgb(6,125,23)">"[Access::livemedia] No data received in the last %d ms"</span>, <span style="color:rgb(23,80,235)">30000</span>);<br> <span style="color:rgb(102,14,122)">m_streamCheckAliveTask </span>= <span style="color:rgb(31,84,46);font-weight:bold">NULL</span>;<br> <span style="color:rgb(140,140,140);font-style:italic">// Shutdown the stream<br></span><span style="color:rgb(140,140,140);font-style:italic"> </span>shutdownStream(rtspClient);<br> }<span style="color:rgb(0,51,179)">else</span>{<br> <span style="color:rgb(140,140,140);font-style:italic">// Some stream have a session timeout, so we need to send a command to tell we are alive<br></span><span style="color:rgb(140,140,140);font-style:italic"> // Axis camera with firmware >= 5.60<br></span><span style="color:rgb(140,140,140);font-style:italic"> </span><span style="color:rgb(102,14,122)">m_pRtspClient</span>->sendOptionsCommand(<span style="color:rgb(0,128,128)">CustomRTSPClient</span>::handlePingWithOPTIONS);<br><br> <span style="color:rgb(102,14,122)">m_streamCheckAliveTask </span>= <span style="color:rgb(102,14,122)">m_env</span>->taskScheduler().scheduleDelayedTask(<span style="color:rgb(31,84,46);font-weight:bold">TIMEOUT_CHECKALIVE</span>, (<span style="color:rgb(55,31,128)">TaskFunc</span>*)<span style="color:rgb(0,128,128)">CustomRTSPClient</span>::streamCheckAliveHandler, rtspClient);<br> }<br>}</pre></div></div><div class="gmail_quote"></div><div class="gmail_quote">Here the logs :</div><div class="gmail_quote"><br></div><div class="gmail_quote">12:02:15,269502 [LibLiveMedia] Sending request: OPTIONS rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a> RTSP/1.0<br>12:02:15,269542 [LibLiveMedia] CSeq: 22365<br>12:02:15,269557 [LibLiveMedia] Authorization: Digest username="admin", realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a>", response="76d96766be1ff27aa5f7875520a013d9"<br>12:02:15,269568 [LibLiveMedia] User-Agent: LIVE555 Streaming Media v2018.11.26<br>12:02:15,269580 [LibLiveMedia] Session: 27543<br>12:02:15,269593 [LibLiveMedia] <br>12:02:15,269666 [LibLiveMedia] Sending request: OPTIONS rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a> RTSP/1.0<br>12:02:15,269692 [LibLiveMedia] CSeq: 22366<br>12:02:15,269706 [LibLiveMedia] Authorization: Digest username="admin", realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a>", response="76d96766be1ff27aa5f7875520a013d9"<br>12:02:15,269721 [LibLiveMedia] User-Agent: LIVE555 Streaming Media v2018.11.26<br>12:02:15,269747 [LibLiveMedia] Session: 27543<br>12:02:15,269759 [LibLiveMedia] <br>12:02:15,269822 [LibLiveMedia] Sending request: OPTIONS rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a> RTSP/1.0<br>12:02:15,269833 [LibLiveMedia] CSeq: 22367<br>12:02:15,269845 [LibLiveMedia] Authorization: Digest username="admin", realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a>", response="76d96766be1ff27aa5f7875520a013d9"<br>12:02:15,269856 [LibLiveMedia] User-Agent: LIVE555 Streaming Media v2018.11.26<br>12:02:15,269882 [LibLiveMedia] Session: 27543<br>12:02:15,269894 [LibLiveMedia] <br>12:02:15,270739 [LibLiveMedia] Received a complete OPTIONS response:<br>12:02:15,270777 [LibLiveMedia] RTSP/1.0 200 OK<br>12:02:15,270790 [LibLiveMedia] CSeq: 22365<br>12:02:15,270801 [LibLiveMedia] Date: Sun, 04 Oct 2020 09:57:32 GMT<br>12:02:15,270813 [LibLiveMedia] Expires: Sun, 04 Oct 2020 09:57:32 GMT<br>12:02:15,270839 [LibLiveMedia] Cache-Control: must-revalidate<br>12:02:15,270852 [LibLiveMedia] Session: 27543;timeout=60<br>12:02:15,270878 [LibLiveMedia] Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, OPTIONS, GET_PARAMETER, SET_PARAMETER<br>12:02:15,270891 [LibLiveMedia] <br>12:02:15,271304 [LibLiveMedia] Received a complete OPTIONS response:<br>12:02:15,271363 [LibLiveMedia] RTSP/1.0 200 OK<br>12:02:15,271374 [LibLiveMedia] CSeq: 22366<br>12:02:15,271385 [LibLiveMedia] Date: Sun, 04 Oct 2020 09:57:32 GMT<br>12:02:15,271397 [LibLiveMedia] Expires: Sun, 04 Oct 2020 09:57:32 GMT<br>12:02:15,271408 [LibLiveMedia] Cache-Control: must-revalidate<br>12:02:15,271419 [LibLiveMedia] Session: 27543;timeout=60<br>12:02:15,271431 [LibLiveMedia] Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, OPTIONS, GET_PARAMETER, SET_PARAMETER<br>12:02:15,271442 [LibLiveMedia] <br>12:02:15,312308 [LibLiveMedia] Received a complete OPTIONS response:<br>12:02:15,312342 [LibLiveMedia] RTSP/1.0 200 OK<br>12:02:15,312353 [LibLiveMedia] CSeq: 22367<br>12:02:15,312364 [LibLiveMedia] Date: Sun, 04 Oct 2020 09:57:32 GMT<br>12:02:15,312376 [LibLiveMedia] Expires: Sun, 04 Oct 2020 09:57:32 GMT<br>12:02:15,312387 [LibLiveMedia] Cache-Control: must-revalidate<br>12:02:15,312398 [LibLiveMedia] Session: 27543;timeout=60<br>12:02:15,312409 [LibLiveMedia] Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, OPTIONS, GET_PARAMETER, SET_PARAMETER<br>12:02:15,312421 [LibLiveMedia] <br><br>12:02:25,269835 [LibLiveMedia] Sending request: OPTIONS rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a> RTSP/1.0<br>12:02:25,269882 [LibLiveMedia] CSeq: 22368<br>12:02:25,269905 [LibLiveMedia] Authorization: Digest username="admin", realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a>", response="76d96766be1ff27aa5f7875520a013d9"<br>12:02:25,269928 [LibLiveMedia] User-Agent: LIVE555 Streaming Media v2018.11.26<br>12:02:25,269939 [LibLiveMedia] Session: 27543<br>12:02:25,269950 [LibLiveMedia] <br>12:02:25,270088 [LibLiveMedia] Sending request: OPTIONS rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a> RTSP/1.0<br>12:02:25,270110 [LibLiveMedia] CSeq: 22369<br>12:02:25,270122 [LibLiveMedia] Authorization: Digest username="admin", realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a>", response="76d96766be1ff27aa5f7875520a013d9"<br>12:02:25,270144 [LibLiveMedia] User-Agent: LIVE555 Streaming Media v2018.11.26<br>12:02:25,270156 [LibLiveMedia] Session: 27543<br>12:02:25,270167 [LibLiveMedia] <br>12:02:25,270235 [LibLiveMedia] Sending request: OPTIONS rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a> RTSP/1.0<br>12:02:25,270258 [LibLiveMedia] CSeq: 22370<br>12:02:25,270269 [LibLiveMedia] Authorization: Digest username="admin", realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a>", response="76d96766be1ff27aa5f7875520a013d9"<br>12:02:25,270292 [LibLiveMedia] User-Agent: LIVE555 Streaming Media v2018.11.26<br>12:02:25,270303 [LibLiveMedia] Session: 27543<br>12:02:25,270314 [LibLiveMedia] <br><br>12:02:35,270303 [LibLiveMedia] Sending request: OPTIONS rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a> RTSP/1.0<br>12:02:35,270353 [LibLiveMedia] CSeq: 22371<br>12:02:35,270377 [LibLiveMedia] Authorization: Digest username="admin", realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a>", response="76d96766be1ff27aa5f7875520a013d9"<br>12:02:35,270400 [LibLiveMedia] User-Agent: LIVE555 Streaming Media v2018.11.26<br>12:02:35,270424 [LibLiveMedia] Session: 27543<br>12:02:35,270449 [LibLiveMedia] <br>12:02:35,270541 [LibLiveMedia] Sending request: OPTIONS rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a> RTSP/1.0<br>12:02:35,270563 [LibLiveMedia] CSeq: 22372<br>12:02:35,270576 [LibLiveMedia] Authorization: Digest username="admin", realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a>", response="76d96766be1ff27aa5f7875520a013d9"<br>12:02:35,270602 [LibLiveMedia] User-Agent: LIVE555 Streaming Media v2018.11.26<br>12:02:35,270615 [LibLiveMedia] Session: 27543<br>12:02:35,270640 [LibLiveMedia] <br>12:02:35,270700 [LibLiveMedia] Sending request: OPTIONS rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a> RTSP/1.0<br>12:02:35,270734 [LibLiveMedia] CSeq: 22373<br>12:02:35,270757 [LibLiveMedia] Authorization: Digest username="admin", realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a>", response="76d96766be1ff27aa5f7875520a013d9"<br>12:02:35,270781 [LibLiveMedia] User-Agent: LIVE555 Streaming Media v2018.11.26<br>12:02:35,270804 [LibLiveMedia] Session: 27543<br>12:02:35,270826 [LibLiveMedia]<br><br>12:02:45,270793 [LibLiveMedia] Sending request: OPTIONS rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a> RTSP/1.0<br>12:02:45,270835 [LibLiveMedia] CSeq: 22374<br>12:02:45,270860 [LibLiveMedia] Authorization: Digest username="admin", realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a>", response="76d96766be1ff27aa5f7875520a013d9"<br>12:02:45,270871 [LibLiveMedia] User-Agent: LIVE555 Streaming Media v2018.11.26<br>12:02:45,270882 [LibLiveMedia] Session: 27543<br>12:02:45,270894 [LibLiveMedia] <br>12:02:45,270975 [LibLiveMedia] Sending request: OPTIONS rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a> RTSP/1.0<br>12:02:45,270998 [LibLiveMedia] CSeq: 22375<br>12:02:45,271012 [LibLiveMedia] Authorization: Digest username="admin", realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a>", response="76d96766be1ff27aa5f7875520a013d9"<br>12:02:45,271025 [LibLiveMedia] User-Agent: LIVE555 Streaming Media v2018.11.26<br>12:02:45,271036 [LibLiveMedia] Session: 27543<br>12:02:45,271049 [LibLiveMedia] <br>12:02:45,271114 [LibLiveMedia] Sending request: OPTIONS rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a> RTSP/1.0<br>12:02:45,271125 [LibLiveMedia] CSeq: 22376<br>12:02:45,271137 [LibLiveMedia] Authorization: Digest username="admin", realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a>", response="76d96766be1ff27aa5f7875520a013d9"<br>12:02:45,271150 [LibLiveMedia] User-Agent: LIVE555 Streaming Media v2018.11.26<br>12:02:45,271174 [LibLiveMedia] Session: 27543<br>12:02:45,271187 [LibLiveMedia]<br><br>12:02:55,271131 [Access::livemedia] No data received in the last 30000 ms<br>12:02:55,271167 [Access::livemedia] Stream shutdown<br>12:02:55,271202 [LibLiveMedia] Sending request: TEARDOWN rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a> RTSP/1.0<br>12:02:55,271227 [LibLiveMedia] CSeq: 22377<br>12:02:55,271240 [LibLiveMedia] Authorization: Digest username="admin", realm="iPOLiS", nonce="A57B7EF43799CBE77D46CEDD7D5703A2", uri="rtsp://<a href="http://192.168.1.3/onvif/profile2/media.smp">192.168.1.3/onvif/profile2/media.smp</a>", response="438cef6b16a7839417c834cfd22de050"<br>12:02:55,271253 [LibLiveMedia] User-Agent: LIVE555 Streaming Media v2018.11.26<br>12:02:55,271266 [LibLiveMedia] Session: 27543<br>12:02:55,271278 [LibLiveMedia] <br>12:02:55,271305 [Access::livemedia] End of event loop<br>12:02:55,271350 [Access::livemedia] Stream shutdown<br>12:02:55,271361 [Access::livemedia] Closing the stream.<br>12:02:55,271418 [Access::livemedia] Stream shutdown done</div><div class="gmail_quote"><div></div><br><div><br></div><div><br></div><br></div></div>