Deepstream Rtspsrc Reconnection Problem

Hello, I am having a problem while using the rtspsrc element in deepstream sdk.

SDK Version is 6.3 and the problem is hardware independent.

When the camera is connected, the image comes without any problem. However, if the camera is not connected at startup, it gives an error and does not connect again when I reconnect the camera.

I need to close and reopen the application.

Error received when Camera is not Connected:

ERROR from element rtsp-source-0: Could not open resource for reading and writing.
Error details: gstrtspsrc.c(7893): gst_rtspsrc_retrieve_sdp (): /****:rtsp-source-0:
Failed to connect. (Generic error)

How can I ensure an automatic reconnection process when the camera connection is lost?

The parameters I have set on the object are as follows.

setConnectionSpeed(0);
setDebug(TRUE);
setDoRetransmission(TRUE);
setDoRtcp(TRUE);
setDoRtspKeepAlive(TRUE);
setDropOnLatency(FALSE);
setLatency(0);
setLocation("rtsp://****/cam/realmonitor?channel=1&subtype=1");
setMaxRtcpRtpTimeDiff(1000);
setMaxTsOffset(3000000000);
setMaxTsOffsetAdjustment(0);
setMulticastIface(NULL);
setNtpSync(FALSE);
setPortRange(NULL);
setProbation(2);
setProxy(NULL);
setProxyId(nullptr);
setProxyPw(nullptr);
setRetry(20);
setRfc7273Sync(FALSE);
setRtpBlocksize(0);
setShortHeader(FALSE);
setTcpTimeout(20000000);
setTeardownTimeout(100000000);
setTimeout(5000000);
setTlsValidationFlags(G_TLS_CERTIFICATE_INSECURE);
setUdpBufferSize(524288);
setUdpReconnect(TRUE);
setUsePipelineClock(FALSE);
setUserAgent("GStreamer/{VERSION}");
setUserId( "****");
setUserPw("****");

Thanks.

Which demo did you run?

For project deepstream-testsr, disconnect the camera and wait for a while.
Running…
In cb_newpad
Recording started…
Recording done.
Recording started…
Recording done.
** ERROR: RunUserCallback:207: No video stream found
Recording started…
nvstreammux: Successfully handled EOS for source_id=0
End of stream
** ERROR: RunUserCallback:207: No video stream found
Returned, stopping playback
Deleting pipeline
Process finished with exit code 0

If the camera is not plugged in at app startup:
Running…
Returned, stopping playback
Deleting pipeline
ERROR from element rtsp-source: Could not open resource for reading and writing.
Error details: gstrtspsrc.c(7893): gst_rtspsrc_retrieve_sdp (): /GstPipeline:dstest-sr-pipeline/GstRTSPSrc:rtsp-source:
Failed to connect. (Generic error)

If the camera is not plugged in at app startup, there won’t be any sources. If there are no sources, the pipeline cannot start properly. You need to start the pipeline first, then to trigger the reconnection mechanism.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.