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.
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?
yes. nvvideoconvertwill output the same resolution if not passthrough mode.
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.
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.
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.
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.