Delete source dynamically error

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) GPU
• DeepStream Version 4.0.2 and 5.0
• JetPack Version (valid for Jetson only) jetpack 4,4
• TensorRT Version 6 and 7
• NVIDIA GPU Driver Version (valid for GPU only) 2080ti

Hi,
I refer this link https://github.com/NVIDIA-AI-IOT/deepstream_reference_apps/blob/master/runtime_source_add_delete/deepstream_test_rt_src_add_del.c to realize my own application which can add and delete sources dynamically. It worked well for both local file and rtsp. However, recently, I find a problem.
The problem is about rtsp source. When I use rtsp address via Network Video Recorder, deleting source is OK. But, When I use rtsp address via IP camera, some error occur when deleting. This is the error:

ERROR from element source: Unhandled error
Error details: gstrtspsrc.c(6161): gst_rtspsrc_send (): /GstPipeline:analysis-pipeline/GstBin:source-bin-0-00/GstURIDecodeBin:uri-decode-bin-0-00/GstRTSPSrc:source:
Option not supported (551)
ERROR from element source: Could not write to resource.
Error details: gstrtspsrc.c(8244): gst_rtspsrc_pause (): /GstPipeline:analysis-pipeline/GstBin:source-bin-0-00/GstURIDecodeBin:uri-decode-bin-0-00/GstRTSPSrc:source:
Could not send message. (Generic error)

Could you give me some useful advice? Thank you very much.

I test again using deepstream_reference_apps/deepstream_test_rt_src_add_del.c at master · NVIDIA-AI-IOT/deepstream_reference_apps · GitHub source code. same error.
My IP Camera is hikvision.
Could you reproduce this issue?

This sample is only a client to receive rtsp stream from “IP camera”. And this error means the rtsp client send a request to server, but server response to client to tell it the request is “Option not supported”. This is a standard response in RTSP protocol. RFC 2326: Real Time Streaming Protocol (RTSP). From the log, it is impossible to know what request evoke the server to response this error. But it is clear that the server refused the client to connect to it.
If you want to dig into the root cause, it is better to analysis the packets between sever and client according to the protocol RFC 2326: Real Time Streaming Protocol (RTSP). This issue has nothing to do with DeepStream and can not be identify by only client side. If you are using rtspsrc plugin to get the stream, one way is to set “debug” property of rtspsrc plugin as TRUE(rtspsrc), then you can analysis the information according to RFC 2326: Real Time Streaming Protocol (RTSP). Any more information, please refer to the information for rtsp protocol with internet.
If you are not using rtspsrc plugin, there are also a lot of open source rtsp analysis tools such as wireshark (Wireshark · Download) which can help to analysis the rtsp requests and responses. Any details and questions, please refer to their official website https://www.wireshark.org

1 Like

@Fiona.Chen, Thanks for your reply.
I use wireshark to analyze the rtsp stream from IP camera.
Here is the log when deleting the rtsp source:


Could you give me some advice?

My advice is to refer to RFC 2326: Real Time Streaming Protocol (RTSP) and consult with RTSP expert. Google will help.

Thank you,
I temporarily solved this problem.
Deleting rtsp source cause sending “PAUSE” option message to IP camera server. But IP camera server replies “Option not suuported”, This is becase my IP camera may not support “PAUSE” option. This link may be helpful:Can a RTSP pause request be supported while playing a live video stream? - Stack Overflow. So I modify the gstreamer source code(gstrtspsrc.c), sending “TEARDOWN” option instead of “PAUSE” option. It worked now.

Hi, can you show more information about your modify? I meet same problem when I delete rtsp source. Thanks !

There is another simple solution to solve this issue. In bus_call function, in “case GST_MESSAGE_ERROR:” part, you can comment this line: “g_main_loop_quit (loop);”. The application should work well, although it still prints errors.

1 Like

Yes, it can run succeed, but I wonder how you change source code, I can’t find gstrtspsrc.c in my system.
Thanks !

you should download gstreamer source code, compile rtsp part and repalce .so file. I just comment Pause part in source code, i think it is not a good way.

1 Like

OK, I know your mean, thanks.

This is an IP Camera problem. You can forward the video stream through the streaming media server to solve this problem