[DeepStream 9.0] new nvstreammux + nvvideoconvert forces single resolution

Hardware Platform

GPU (RTX 4060)

DeepStream Version

DeepStream 9.0

TensorRT Version

TensorRT 10.14.1.48

NVIDIA GPU Driver Version

590.48.01

Issue Type

Bug / behavior clarification (question)

Question

I am using DeepStream Service Maker (Python Pipeline API / pyservicemaker) with new nvstreammux and want to confirm expected behavior with heterogeneous streams.

Goal

Use heterogeneous input streams and extract RGB tensors in Python (buffer.extract(batch_id)) while preserving per-stream native resolution.

Input streams

  • Stream A: 1280x720
  • Stream B: 942x530
  • Stream C: 1920x1080

Pipeline used (Service Maker)

nvmultiurisrcbin -> nvinfer -> nvtracker -> nvvideoconvert -> capsfilter(video/x-raw(memory:NVMM),format=RGB) -> fakesink

Probes used

  1. Probe after nvtracker:
    • Log frame_meta.source_width/source_height
  2. Probe after RGB capsfilter:
    • Call buffer.extract(batch_id)
    • Log tensor shape and source metadata

Observed logs

  • NATIVE_RES pad=0 src=1280x720
  • NATIVE_RES pad=1 src=942x530
  • NATIVE_RES pad=2 src=1920x1080
  • TENSOR_DEBUG shape=(720, 1280, 3) dtype=uint8 src=1920x1080
  • BBOX_DEBUG pad=2 buf=1280x720 meta_src=1920x1080 ...
  • BBOX_DEBUG pad=1 buf=1280x720 meta_src=942x530 ...

Actual behavior

  • Before nvvideoconvert: per-stream native resolutions are preserved.
  • After nvvideoconvert: all extracted RGB tensors become a single resolution (e.g. 1280x720) for all streams.

Additional note

If I remove nvvideoconvert, buffer.extract() is not usable in this flow because extraction requires RGB/RGBA.

My question

Is this behavior expected with new nvstreammux heterogeneous batching + downstream nvvideoconvert in Service Maker pipelines?
If yes, what is the NVIDIA-recommended way to extract per-stream native-resolution RGB tensors in Python?

  1. yes. nvvideoconvertwill output the same resolution if not passthrough mode.
  2. If your goal is per-stream native-resolution RGB tensors in Python, the working approach is to insert nvstreamdemux, and do nvvideoconvert → capsfilter(video/x-raw(memory:NVMM),format=RGB) on each demuxed branch separately. Then each branch has batch_size=1, and buffer.extract(0) returns that stream’s native RGB shape again. Please refer to this sample code workaround_native_rgb_demux.py (2.7 KB)
    .

Thanks for confirming and for the workaround sample.

Unfortunately, nvstreamdemux isn’t a viable option in our case. We use nvmultiurisrcbin to manage dynamic RTSP camera sources at runtime — cameras are added and removed via the REST API while the pipeline is in PLAYING state.

Our pipeline

nvmultiurisrcbin ── nvinfer(YOLO) ── nvtracker ── nvvideoconvert ── fakesink ── probe (buffer.extract)                                                                                                                                                                                                               

Why nvstreamdemux doesn’t work with dynamic sources

Since nvmultiurisrcbin manages sources dynamically, placing nvstreamdemux after the inference chain would require:

  1. Requesting/releasing demux pads every time a source is added or removed via the REST API

  2. Dynamically creating and tearing down per-stream downstream branches (nvvideoconvert → capsfilter) while the pipeline is PLAYING

  3. Keeping demux pad indices in sync with the internal mux pad indices that nvmultiurisrcbin manages

Is there a recommended approach for per-stream native-resolution RGB extraction in dynamic-source pipelines using nvmultiurisrcbi

Thanks for the sharing! Currently from the log “Only RGB format is supported for being extracted as a tensor”, buffer.extract() requires only RGB format. Since nvstreammux can’t otuput RGB foratmat, nvideoconvert is needed to convert RGBA to RGB, but nvvideoconvert will output the same resolution.

Thank you again!
quick follow-up question.

I see pyservicemaker already exposes DynamicSourceMessage (used in
deepstream_test5_app) so I can detect when a source is added or
removed from nvmultiurisrcbin.

But I couldn’t find how to add/remove an nvstreamdemux branch
(queue → nvvideoconvert → capsfilter(RGB) → sink) at runtime
using pyservicemaker.

Is there a way to handle this dynamic add/remove with pyservicemaker,
or do I need to do it directly with GStreamer (gi.Gst)?

Would you mind sharing your company name? You can use forum private email. Please click forum avatar → "personal messages’ → “view all personal messages” → “new message”.
Currently there is not ready-made sample. we are investigating, then get back to you.

Thank you!

After checking, Currently, pyservicemaker has support for demuxer with static input only and not with dynamic add/remove. Support dynamic add/remove for demuxer is is on our roadmap.

Thank you for your checking and response!