Request to include camera_url in /api/v1/stream/get-stream-info response for Gst-nvmultiurisrcbin

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
GPU
• DeepStream Version
7.1
• JetPack Version (valid for Jetson only)
• TensorRT Version
10.3
• NVIDIA GPU Driver Version (valid for GPU only)
566.03
• Issue Type( questions, new requirements, bugs)
new requirements
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Description:
When using Gst-nvmultiurisrcbin with nvds_rest_server, there’s an inconsistency in the handling of camera_url between different endpoints.

Current Behavior:

  1. For /stream/add endpoint:

    • Successfully adds sensors with camera_url
    • Documentation correctly states mandatory fields (value/camera_id, value/camera_url, value/change)
  2. For /stream/remove endpoint:

    • Requires camera_url as mandatory field
    • Documentation correctly states mandatory fields (value/camera_id, value/camera_url, value/change)
  3. For /api/v1/stream/get-stream-info endpoint:

    • Only returns camera_id and camera_name
    • Does not return camera_url
    • Example response:
      {
          "reason": "GET_LIVE_STREAM_INFO_SUCCESS",
          "status": "HTTP/1.1 200 OK",
          "stream-info": {
              "stream-count": 1,
              "stream-info": [
                  {
                      "camera_id": "UniqueSensorId1",
                      "camera_name": "UniqueSensorName1"
                  }
              ]
          }
      }
      

Expected Behavior:
The /api/v1/stream/get-stream-info endpoint should include camera_url in its response, since:

  1. camera_url is a mandatory field for other endpoints
  2. camera_url is required for stream removal
  3. This would provide consistency across all stream management endpoints

Issue Impact:
Currently, to remove a stream, users must maintain camera_url information separately since it’s not available through the get-stream-info endpoint, despite being required for removal.

Code Analysis:

  • Reviewed nvds_rest_server implementation
  • Found get_request_cb callback mechanism but unable to locate its implementation
  • Value exists in NvDsServerStreamInfo structure (value_camera_url) but isn’t being included in response

Request:
Please enhance the /api/v1/stream/get-stream-info endpoint to include camera_url in its response payload, maintaining consistency with other stream management endpoints.

Thank you for the suggestion!

The gst-nvmultiurisrcbin plugin is open source. You may add the uri to stream info REST API by modifying s_get_request_api_impl() function in /opt/nvidia/deepstream/deepstream/sources/gst-plugins/gst-nvmultiurisrcbin/gstdsnvmultiurisrcbin.cpp.

1 Like

Thank you. Worked like a charm.

/opt/nvidia/deepstream/deepstream/sources/gst-plugins/gst-nvmultiurisrcbin/gstdsnvmultiurisrcbin.cpp

// Log information from the retrieved list
        for (GList *temp = stream_info_list; temp; temp = g_list_next (temp)) {
          NvDsSensorInfo *sensor_info = (NvDsSensorInfo *) temp->data;
          //Create Json stream info objects for each active stream
          Json::Value stream;
          if (sensor_info->sensor_id)
            stream["camera_id"] = std::string(sensor_info->sensor_id);
          else
            stream["camera_id"] = std::string("");

          if (sensor_info->sensor_name)
            stream["camera_name"] = std::string(sensor_info->sensor_name);
          else
            stream["camera_name"] = std::string("");
          // custom impl
          if (sensor_info->uri)
            stream["camera_url"] = std::string(sensor_info->uri);
          else
            stream["camera_url"] = std::string("");
          // end custom

@Fiona.Chen

I need to implement runtime configuration changes for the nvdsanalytics plugin settings, following the approach discussed in this thread. However, I’ve encountered a limitation in the current API endpoint.

Current Situation

The /api/v1/stream/get-stream-info endpoint currently returns only basic camera information:

{
    "camera_name": "Camera1",
    "camera_id": "cam123",
    "camera_url": "rtsp://example.com/stream1"
}

Requested Change

I need to add the stream_id to the response to properly identify and update specific stream components:

{
    "camera_name": "Camera1",
    "camera_id": "cam123",
    "camera_url": "rtsp://example.com/stream1",
    "stream_id": "0"
}

This addition is necessary for:

  1. Implementing runtime configuration changes for nvdsanalytics
  2. Properly identifying and updating specific stream components
  3. Maintaining consistency between stream configurations and their respective IDs

Could you please help me add the stream_id field to the endpoint response? This would greatly help in implementing dynamic configuration updates for the analytics components.

Do you mean the source id?

Yes, exactly. Thank you.

It’s quite interesting to consider this information (camera_url, source_id) as default in the endpoint.

Added

          if (sensor_info->source_id)
            stream["source_id"] = std::to_string(sensor_info->source_id);
          else
            stream["source_id"] = std::string("");

An important point is to create an endpoint for nvdsanalytics now that we’ve already resolved the automatic reload of ROIs in the post mentioned above.

The source id is in the GstDsNvUriSrcConfig, it can be got by the camera_id and camera url with gst_nvmultiurisrcbincreator_get_source_config() interface. Please refer to s_stream_api_impl() source code.

1 Like

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