The correspondence between `camera_id` and `source_id`or `pad_index`

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) 3090
• DeepStream Version 7.1 docker nvcr.io/nvidia/deepstream:7.1-gc-triton-devel
• NVIDIA GPU Driver Version (valid for GPU only) NVIDIA-SMI 550.135 Driver Version: 550.135 CUDA Version: 12.4

start a nvmultiurisrcbin python pipeline, perf log is

**PERF:  {'stream0': 0.0, 'stream1': 0.0, 'stream2': 24.77, 'stream3': 24.77, 'stream4': 0.0, 'stream5': 0.0, 'stream6': 0.0, 'stream7': 0.0, 'stream8': 0.0, 'stream9': 0.0, 'stream10': 0.0, 'stream11': 0.0, 'stream12': 0.0, 'stream13': 0.0, 'stream14': 0.0, 'stream15': 0.0, 'stream16': 0.0, 'stream17': 0.0, 'stream18': 0.0, 'stream19': 0.0, 'stream20': 0.0, 'stream21': 0.0, 'stream22': 0.0, 'stream23': 0.0, 'stream24': 0.0, 'stream25': 0.0, 'stream26': 0.0, 'stream27': 0.0, 'stream28': 0.0, 'stream29': 0.0}

the perf code is

stream_index = f"stream{frame_meta.source_id}"
global perf_data
perf_data.update_fps(stream_index)

when add a stream with camera_id is stream5

curl -XPOST 'http://localhost:9999/api/v1/stream/add' -d '{
  "key": "sensor",
  "value": {
      "camera_id": "stream5",
      "camera_name": "front",
      "camera_url": "rtsp://xxxxxxxxxx:8558/4",
      "change": "camera_add",
      "metadata": {
          "resolution": "2560 x1440",
          "codec": "h264",
          "framerate": 30
      }
  },
  "headers": {
      "source": "vst",
      "created_at": "2021-06-01T14:34:13.417Z"
  }
}'

the log is

uri:/api/v1/stream/add
method:POST

**PERF:  {'stream0': 0.0, 'stream1': 0.0, 'stream2': 24.8, 'stream3': 24.8, 'stream4': 0.0, 'stream5': 0.0, 'stream6': 0.0, 'stream7': 0.0, 'stream8': 0.0, 'stream9': 0.0, 'stream10': 0.0, 'stream11': 0.0, 'stream12': 0.0, 'stream13': 0.0, 'stream14': 0.0, 'stream15': 0.0, 'stream16': 0.0, 'stream17': 0.0, 'stream18': 0.0, 'stream19': 0.0, 'stream20': 0.0, 'stream21': 0.0, 'stream22': 0.0, 'stream23': 0.0, 'stream24': 0.0, 'stream25': 0.0, 'stream26': 0.0, 'stream27': 0.0, 'stream28': 0.0, 'stream29': 0.0} 

Failed to query video capabilities: Invalid argument

stream4 update the value ,stream5 is still 0

why?

When you add a new stream, the pad id is not selected by the request information but some internal rule.

Please refer to the s_get_source_id() function in /opt/nvidia/deepstream/deepstream/sources/libs/gstnvdscustomhelper/gst-nvmultiurisrcbincreator.cpp

The nvmulturisrcbin is totally open source, you can get any information by the source code.

1 Like

Thank you. I saw it, I want to confirm that if a stream finishes playing, will its pad index be taken over by a new stream?

The pad index is decided by the s_get_source_id() function in /opt/nvidia/deepstream/deepstream/sources/libs/gstnvdscustomhelper/gst-nvmultiurisrcbincreator.cpp