Streammux warning and application exit when the number of videos reaches 0

• Hardware Platform :GPU
• DeepStream Version :5.1
• TensorRT Version:7.2
• language: python3.6
• camera IP: Hikvision

Hi, everyone
I usually add or delete the video of deepstream , the number of videos >1 work is ok, but number of video = 0 ,the streammux show “Warning” and exit application

logs

0:00:12.061124298 30143 0x7f83f8400320 WARN             nvstreammux gstnvstreammux.c:2291:gst_nvstreammux_src_push_loop:<Stream-muxer> warning: No Sources found at the input of muxer. Waiting for sources.
Warning: gst-resource-error-quark: No Sources found at the input of muxer. Waiting for sources. (3): gstnvstreammux.c(2291): gst_nvstreammux_src_push_loop (): /GstPipeline:pipeline0/GstNvStreamMux:Stream-muxer
core dumped

streammux_logs.txt (226.4 KB)

Can the application not exit when the number of videos is zero and wait for new videos?

Thanks

Hi,i found a solution that could serve as a reference.

When delete last of video source to set the state of streammux to NULL,it can be successfully deleted without warrning and crash

streammux.set_state(Gst.State.NULL) # first set the state of streammux to NULL 
delete(task_i['source_id']) # second to delete uridecodebin from pipeline

When add frist of video source , count 0 - > 1

streammux.set_state(Gst.State.PLAYING)# first set the state of streammux to PLAYING
delete(task_i['source_id']) # second to add video source 

I can provide the test code if required

It will be helpful if you can post the cod here.