How to achieve overlapping/parallel Smart Recording sessions in DeepStream without I/O blocking or Cache conflicts?

DeepStream 9.0 NVIDIA GPU Driver 595.80 RTX 3050

build in docker.

The Issue: Based on my observation, nvurisrcbin utilizes a single shared circular buffer (Cache) for the Smart Record module. When I attempt to trigger multiple start_recording calls, the system enters a “BLOCKING MODE,” which causes significant I/O latency and often leads to the Could not read from resource error, effectively dropping frames for the second recording task.

Specific Concerns:

  1. Cache Overwrite: In a high-concurrency scenario, if the smart-rec-cache size is limited, the time window for the second video (Video B) might be overwritten by the time I/O operations for the first video (Video A) are finalized.

  2. Blocking I/O: The current architecture seems to force a synchronous block on the pipeline when writing to the physical disk, preventing parallel recording sessions for the same source.

Questions:

  • Is there a recommended architectural pattern in DeepStream to handle multiple overlapping recording sessions from a single RTSP source without causing BLOCKING MODE or buffer contention?

  • Should I be implementing a custom “Tee” architecture where I split the stream into multiple recording-only pipelines, or is there a way to offload the raw buffer handling to a custom memory pool/callback before it triggers the I/O block?

  • Does the Smart Record module support concurrent Session IDs for the same source, or is this fundamentally a single-session-at-a-time limitation of the underlying sr_context?

I am looking for a scalable approach for traffic law enforcement applications where event detection occurs in rapid succession. Any insights or architectural best practices would be greatly appreciated.

The nvurisrcbin is open source in /opt/nvidia/deepstream/deepstream/sources/gst-plugins/gst-nvurisrcbin, the smart recording is implemented by the smart recording APIs. The smart recording is also open source /opt/nvidia/deepstream/deepstream/sources/libs/gst-nvdssr. There is only one smart recording context in nvurisrcbin, so there is only one smart recording session supported.

The so-called overlay recording means multiple smart recording sessions, you may implement it by yourself.

The other questions can be replied by the source codes.

You may also try the DeepStream Code Agent which provide the DeepStream skills. DeepStream/skills at main · NVIDIA/DeepStream, you can use Cursor or Claude CLI to generate sample app for overlapped smart recording.

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks.