I used the word “replace” incorrectly. My intention wasn’t to remove the existing source_id variable and substitute it with camera_id.
My actual goal is to introduce camera_id as a new variable and have users start using it instead of source_id, which would remain in the system for compatibility purposes.
Since it can now be obtained through the
get-stream-infomethod, could you describe in detail how you plan to obtain and use thiscamera_idin a specific scenario? Thanks
Let me provide a concrete example of why extending camera_id usage is crucial:
Current Problem with source_id:
I created an pipeline using the REST API and added 3 file sources sequentially on-demand to the pipeline with sync=false on fakesink.
Here’s what happens:
-
Source added →
source_idis generated (unknown at this point) -
Frames start processing immediately through probes
-
Hundreds of frames processed before I can call
get-stream-infoto discover whichcamera_idbelongs to whichsource_id -
Data loss: All those initial frames are processed without knowing their
camera_id
Additional nvdsanalytics complexity: Since nvdsanalytics also depends on source_id, I have to:
-
Start the source
-
Wait to get the
source_id -
Rebuild the YAML/INI configuration file with the correct
source_id -
Reload nvdsanalytics to apply ROIs correctly
Even when done quickly, this introduces significant latency while hundreds of frames are already being processed without proper ROI configuration.
Before REST API vs Now:
-
Before: Users manually controlled
source_id- they knew exactly whichsource_idbelonged to which source before start source -
Now: The
source_idbecomes available once the source is already running, making it unknown until we query for it
Solution with camera_id: If camera_id were available in metadata:
-
Pre-configure: Load ROIs in nvdsanalytics using known
camera_idvalues BEFORE starting sources -
Immediate processing: When frames reach probes,
camera_idwould be immediately available in metadata -
No external queries: No need to call REST API during processing to map
source_idtocamera_id -
Zero latency: No frames lost or processed incorrectly during startup
This would eliminate the current race condition between source startup and configuration discovery.
Thanks.