How to get only one stream from streammux, and drop others?

Please provide complete information as applicable to your setup.

• Hardware Platform (GPU)
• DeepStream Version 6.2
• Issue Type(new requirements)

I have a program to dynamic add and delete sources, https://github.com/NVIDIA-AI-IOT/deepstream_reference_apps/tree/master/runtime_source_add_delete

now I want to get one source from streammux, and drop the other sources, the source I want can dynamic use index or other flag to get , maybe I want first source , maybe third source source. How to do it? should I use nvstreamdemux, or without it I can drop the frames from other sources which i don’t want.

Yes. You need to use nvstreamdemux. You can refer to the source code: sources\apps\sample_apps\deepstream-ucx-test3\client\deepstream_ucx_test3_app_client.c.

  g_snprintf (pad_name, 15, "src_%u", 0);
  demuxsrcpad = gst_element_get_request_pad (streamdemux, pad_name);

Hello,

I have tried it , when I set

  g_snprintf (pad_name, 15, "src_%u", 0);
  demuxsrcpad = gst_element_get_request_pad (streamdemux, pad_name);

It can display the first source, but when I set

  g_snprintf (pad_name, 15, "src_%u", 1);
  demuxsrcpad = gst_element_get_request_pad (streamdemux, pad_name);

it can’t display the second source, with black screen.

Could you try the command below in your env?
1.save both source_0 and source_1

gst-launch-1.0 -e nvstreammux name=mux batch-size=2 width=1920 height=1080 ! nvinfer config-file-path=/opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app/config_infer_primary.txt batch-size=2  ! nvstreamdemux name=demux filesrc location=/opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.h264 ! h264parse ! nvv4l2decoder ! queue ! mux.sink_0 filesrc location=/opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.h264 ! h264parse ! nvv4l2decoder ! queue ! mux.sink_1 demux.src_0 ! "video/x-raw(memory:NVMM), format=NV12" ! queue ! nvvideoconvert ! "video/x-raw(memory:NVMM), format=RGBA" ! nvdsosd ! nvvideoconvert ! nvv4l2h264enc ! h264parse ! qtmux ! filesink location=./out_0.mp4 demux.src_1 ! queue ! nvvideoconvert ! "video/x-raw(memory:NVMM), format=RGBA" ! nvdsosd ! nvvideoconvert ! nvv4l2h264enc ! h264parse ! qtmux ! filesink location=./out_1.mp4

2.save source_1

gst-launch-1.0 -e nvstreammux name=mux batch-size=2 width=1920 height=1080 ! nvinfer config-file-path=/opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app/config_infer_primary.txt batch-size=2  ! nvstreamdemux name=demux filesrc location=/opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.h264 ! h264parse ! nvv4l2decoder ! queue ! mux.sink_0 filesrc location=/opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.h264 ! h264parse ! nvv4l2decoder ! queue ! mux.sink_1  demux.src_1 ! queue ! nvvideoconvert ! "video/x-raw(memory:NVMM), format=RGBA" ! nvdsosd ! nvvideoconvert ! nvv4l2h264enc ! h264parse ! qtmux ! filesink location=./out_1.mp4

Hi, I have write a demo, it can display at first by removing tiler element,

but sometime the demo can not change the source to show.
multi-gpu-test-ds63.zip (14.9 KB)

1.Are the sources added to the pipeline sometimes livesources or mp4 files?
2.If you use nvstreamdemux, there is no need to use nvmultistreamtiler in your code.

Hi,

  1. I tested the mp4 file and live sources, but in fact will use live source in project, the mp4 file is just for test. this would affect?

  2. I have commented the nvmultistreamtiler, so it not used in the code.

1.If it’s live source, you can set the live-source parameter to nvstreammux.
Can the pipeline I attached before select the stream normally in your environment?

Yes, I have try the pipeline you attached, it can run.

And I also set the live-source parameter in the code , you can see the code I attached

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

Could you try to use the fixed number of sources first?

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