Unable to add and remove pipes in Deepstream's bus_call function when using nvmultiurisrcbin plugins with nvstreamdemux

Please provide complete information as applicable to your setup.
• Hardware Platform: GPU
• DeepStream 6.3
• TensorRT 8.5.3-1+cuda11.8
• NVIDIA GPU Driver Version: 535.183.01
I am using the following pipeline to write the code, but I am having trouble that I cannot get the pad of nvstreamdemux to associate it with the new bin when I receive the camera add or remove signal in the bus_callback function. Can you explain why I cannot get the pad of nvstreamdemux in this dynamic way and is there any way I can fix it? Thanks! Below is the sample code and pipeline that I am planning to test.

gst-launch-1.0 nvmultiurisrcbin file-loop=true port=9000 ip-address=localhost batched-push-timeout=33333 max-batch-size=3 drop-pipeline-eos=1 live-source=1 uri-list=file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4,file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 width=1920 height=1080 name=mux ! nvstreamdemux name=demux demux.src_0 ! queue ! "video/x-raw(memory:NVMM), format=NV12" ! queue ! nvvideoconvert ! nvdslogger fps-measurement-interval-sec=1 name=log_0 ! fakesink sync=false demux.src_1 ! queue ! "video/x-raw(memory:NVMM), format=NV12" ! queue ! nvvideoconvert ! nvdslogger fps-measurement-interval-sec=1 name=log_1 ! fakesink sync=false demux.src_2 ! queue ! "video/x-raw(memory:NVMM), format=NV12" ! queue ! nvvideoconvert ! nvdslogger fps-measurement-interval-sec=1 name=log_2 ! fakesink sync=false 

Is the pipeline in “PLAYING” state when you request the nvstreamdemux src pad?

Yes, the pipeline is in the PLAYING state and has called the bus_callback function, but I can’t get the pad of nvstreamdemux at that moment.

Can you upgrade to the latest DeepStream 7.1 GA version and try your case?

I am still encountering an error where I cannot get the request pad from nvstreamdemux when using nvcr.io/nvidia/deepstream:7.1-triton-multiarch
deepstream_server_test.zip (4.5 KB)

Your codes show that you set the pipeline to “PLAYING” state before the first source is added. Please change the logic to add the first source and first sink when the pipeline is in “NULL” state.

1 Like

Sorry for the delayed response, and thank you for replying. The pipeline I wrote is working with the add and remove functions in runtime with the element nvmultiurisrcbin, but when I execute the add and remove commands multiple times with the same camera_id, it seems like nvdslogger is printed exactly the number of times I add and remove the camera. I don’t understand why this is happening. I think it might be because I’m removing the pad and process_bin incorrectly when I call remove camera. Could you help me identify where the mistake is? Below are the images and code where I encountered this issue. Thank you.


ds_server_test_debug.zip (5.6 KB)

Please refer to the deepstream-test5 sample. /opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-test5

What do you mean by this?

I expect that when I add or remove any camera, it will show the current cameras. For example, if there are 3 cameras: cam0, cam1, cam2, it should display like this:
**PERF : FPS_0 (29.97)
**PERF : FPS_1 (29.97)
**PERF : FPS_2 (29.97).

But with the code above, if I remove cam2 and add it back, it will display like this:
**PERF : FPS_0 (29.97)
**PERF : FPS_1 (29.97)
**PERF : FPS_2 (29.97)
**PERF : FPS_2 (29.97)
cam2 has been printed twice consecutively at the same time

There is no enough clue to tell anything about your observation.

I have pushed the code above, can you try it, it is having the problem I mentioned, can you explain to me why it is like that?

It is not reproduced with DeepStream 7.1 . Can you upgrade to DeepStream 7.1?

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