I have a pipeline for handling rtsp feeds based on deepstream-test3 app, with the ability to delete and add new sources as per deepstream_test_rt_src_add_del.c. I use the src_pad_buffer_probe function to track detections and note the frame_meta’s source_id so I can perform further logic as per the corresponding rtsp stream’s id.
I notice though that after deleting a video stream and adding another, instead of the feed number remaining constant, it gets incremented as noted by the source_ids being picked up in the probe. I was of the mind that using the stop_release_source function would completely remove the source from the pipeline. How do I completely delete the rtsp source so that the probe is working with the current number of rtsp streams? Or is this not the proper way of handling streams? Maybe I’m required to refresh the buffer?
@yuweiw May you please explain, I’m not sure I understand
If I have three sources and delete one, do you mean I should refresh the nvstreammux to reflect this change? Is there a sample app that maybe shows how to execute this?
Do you mean if I want to remove a source wholly from the system, I am required to delete its sinkpad as well? I thought this is what these lines in the stop_release_source function were doing:
This is what I currently have, and yet, after deleting sources and adding new ones, the frame_meta source_ids do not reflect this change. Meaning if I initially had 3 sources and deleted the 3rd, then added a new one, the source_id would reflect as the 4th. It would not take the place of the one just deleted.
To simplify the analysis, we will first reproduce your question using the following code runtime_source_add_delete.
What value do you want source_id to correspond to? Could you provide a detailed description of your needs?
@yuweiw I want the frame_meta’s source_id to identify the order of the streams in the pipeline. For example: source_id 0 for the 1st stream, source_id 1 for the 2nd etc.
This is what I am trying to do: I want to be able to delete a stream and have it completely removed from the system. What I would like to know is if there is a way to make the order of source_id reflect this. For example, say I delete the 2nd stream with source_id 1. If now I add a 3rd stream, why shouldn’t it assume source_id 1 of the frame object? Since there are only two streams currently in the pipeline. Or is this not the ideal approach for this situation? Is there another attribute instead of source_id that identifies the order of the stream in the pipeline?
As I attached before, this is the source id. This is defined and controlled by yourself. In our demo code, the source is deleted randomly. You need to delete by yourself.
And you shoudn’t add the probe after the nvtiler plugin. It will broke the batch.
Thanks @yuweiw,
We kept seeing dark blocks in the tiler after sources were deleted, so we weren’t sure if the deleted sources still somehow took up memory or not.