Issues with Linking Dynamic Pads in GStreamer Pipeline

Please provide complete information as applicable to your setup.

Hardware Platform:Jetson

DeepStream Version: DeepStream 6.2

Issue Type: Bug

How to Reproduce the Issue:

Sample Application: demux-mlti-in-multi-out but in c++

log.txt (21.7 KB)

Pipeline Setup:
    Created a pipeline that includes a demux element with multiple outputs.
    Added dynamic pad handling to link the demux element outputs to downstream elements.

Request:

Assistance with configuring the demux element to properly handle dynamic pads and resolve the issues observed in the log messages. Additionally, please advise on creating separate RTSP URLs for each input if needed and how to resolve the issue with linking the elements.
main(1).txt (26.9 KB)

You can use nvmultiurisrcbin to add and remove rtsp cameras through restful api,

which is open source and the code is in /opt/nvidia/deepstream/deepstream/sources/gst-plugins/gst-nvmultiurisrcbin.

https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvmultiurisrcbin.html

need some guidance. Could you please provide:

A basic example of using nvmultiurisrcbin in a C++ pipeline?
Details on how to dynamically add or remove sources via the REST API?

/opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-server or /opt/nvidia/deepstream/deepstream/sources/apps/apps-common/src/deepstream_source_bin.c

The usage method is basically the same as uridecodebin/nvurisrcbin.

There are guidance in the link above. Just like

curl -XPOST 'http://localhost:9000/api/v1/stream/add' -d '{
  "key": "sensor",
  "value": {
     "camera_id": "uniqueSensorID1",
     "camera_name": "front_door",
     "camera_url": "file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4",
     "change": "camera_add",
     "metadata": {
         "resolution": "1920 x1080",
         "codec": "h264",
         "framerate": 30
     }
 },
 "headers": {
     "source": "vst",
     "created_at": "2021-06-01T14:34:13.417Z"
 }
}'

I couldn’t find the deepstream-server example in /opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-server as mentioned. Additionally, I encountered the following warning when trying to create the nvmultiurisrcbin element in my C++ code:

perl

0:00:00.247185280 18473 0xaaaae930d8c0 WARN GST_ELEMENT_FACTORY gstelementfactory.c:458:gst_element_factory_make: no such element factory “nvmultiurisrcbin”!

This suggests that the nvmultiurisrcbin plugin is not available or not correctly installed. Could you please provide guidance on ensuring that nvmultiurisrcbin is properly set up?

Also, I’m facing an issue where RTSP streams with multiple outputs work in Python but not in C++. Could you shed some light on why this discrepancy might occur and how to address it?

DS-6.2 was released a long time ago, and I am not sure whether the code is packaged on Jetson.
Or you can find the relevant code on x86 and then port it to Jetson, or try to upgrade DS-7.0, which contains this sample code.

 sudo /opt/nvidia/deepstream/deepstream/install.sh

What does RTSP streams with multiple outputs mean?

Generally speaking, python/cpp won’t cause these differences, it’s probably something to do with your code

After switching from tiler to demux for creating individual RTSP URLs for each stream, the RTSP stopped working. The following pipeline structure was used:

streammux → pgie → tracker → nvdslogger → nvdsanalytics → demux →
nvvidconv1 → nvosd → nvvidconv2 → caps_filter → encoder → codecparser →
rtppay → sink

The log I previously provided appeared after this change. This problem didn’t occur when using the tiler, but with demux, the RTSP stream fails.