Deepstream python app deepstream-test2 change input source to rtsp

hi all,

I am testing deepstream-test2 from deepstream_python_apps/apps/deepstream-test2 at master · NVIDIA-AI-IOT/deepstream_python_apps · GitHub

I find that deepstream-test3 allows rtsp source and I want to merge this to deepstream-test2.

I added uridecodebin to the code and the rtsp source is correct. But the app stucks.

Code:
GObject.threads_init()
Gst.init(None)

# Create gstreamer elements
# Create Pipeline element that will form a connection of other elements
print("Creating Pipeline \n ")
pipeline = Gst.Pipeline()

if not pipeline:
    sys.stderr.write(" Unable to create Pipeline \n")

uri_decode_bin=Gst.ElementFactory.make("uridecodebin", "uri-decode-bin")
if not uri_decode_bin:
    sys.stderr.write(" Unable to create uri decode bin \n")
# We set the input uri to the source element
uri_decode_bin.set_property("uri",args[1])

# Create nvstreammux instance to form batches from one or more sources.
streammux = Gst.ElementFactory.make("nvstreammux", "Stream-muxer")
if not streammux:
    sys.stderr.write(" Unable to create NvStreamMux \n")

# Use nvinfer to run inferencing on decoder's output,
# behaviour of inferencing is set through config file
pgie = Gst.ElementFactory.make("nvinfer", "primary-inference")
if not pgie:
    sys.stderr.write(" Unable to create pgie \n")

...

uri_decode_bin.connect("pad-added", lambda src, pad: src.link(streammux))  ( I suspect the problem is on the this line )

Output:
Creating Pipeline

Creating EGLSink

Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261

The program stuck at here.

Thank you.

Can you just use the same codes for uridecodebin as in deepstream-test3? If the codes are the same, it will work.

BTW, you can “export GST_DEBUG=3” before you run python app, it will output more log to show whether the gstreamer pipeline is working or not.

Another suggestion is to learn gstreamer before you start deepstream and deepstream python. PyGobject and Gst-python is also useful knowledge for deepstream python.