[Nano] nvstreammux without specifying output width and height

I am porting an existing DS 1.5 app that looks like this

uridecodebin ! plugin1 ! nvtracker ! plugin2 ! nvosd ! …

In DS 4.0 I use nvstreammux only to create metadata (as advised during EA)

uridecodebin ! nvstreammux ! plugin1 ! …

But the pipeline complains about needing to specify output width and height for nvstreammux.

I want the output width and height to be the same as the source. Is there a way
to pass this this to nvstreammux automatically without extra code to extract
source width and height?

Hi,

Please share which post suggests this approach.

For double confirmation, you are porting implementation from DS1.5/TX2 to DS4.0/Nano?

This approach was suggested here

https://devtalk.nvidia.com/default/topic/1055436/ds-4-0-for-nano-no-example-for-creating-metadata-for-first-plugin-immediately-after-source-/

Yes I am porting from DS1.5/TX2 to DS4.0/Nano.

Hi,
Please try

uridecodebin ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12,width=1920,height=1080' ! nvstreammux ! plugin1 ! ...

It should work on DS4.0

Still the same error message.

And even if it did work, I still have to specify source width and height
somewhere in the pipeline. This is something I did not
have to do in TX2/DS 1.5

Hi,
Please share a test code so that we can reproduce the error on DS4.0.

On the command line

gst-launch-1.0 uridecodebin uri=file:///home/nvidia/somefile.mp4 ! nvvidconv ! ‘video/x-raw(memory:NVMM),format=NV12,width=640,height=360’ ! m.sink_0 nvstreammux name=m batch-size=1 ! fakesink

I get

Setting pipeline to PAUSED …
ERROR: Pipeline doesn’t want to pause.
ERROR: from element /GstPipeline:pipeline0/GstNvStreamMux:m: Output width not set
Additional debug info:
/dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvmultistream/gstnvstreammux.c(2077): gst_nvstreammux_change_state (): /GstPipeline:pipeline0/GstNvStreamMux:m
Setting pipeline to NULL …
Freeing pipeline …

Hi,
Please run

gst-launch-1.0 uridecodebin uri=file:///home/nvidia/sample_720p.mp4 ! nvvideoconvert ! 'video/x-raw(memory:NVMM),format=NV12,width=640,height=360' ! m.sink_0 nvstreammux name=m batch-size=1 <b>width=640 height=480</b> ! fakesink

You may also refer to source8_1080p_dec_infer-resnet_tracker_tiled_display_fp16_nano.txt. It is must-have configurations. Please configure it accordingly.

IOW, from your command line

gst-launch-1.0 uridecodebin uri=file:///home/nvidia/sample_720p.mp4 ! nvvideoconvert ! ‘video/x-raw(memory:NVMM),format=NV12,width=640,height=360’ ! m.sink_0 nvstreammux name=m batch-size=1 width=640 height=480 ! fakesink

the output width and height are mandatory for nvstreammux

and the answer to my original question:

“I want the output width and height to be the same as the source. Is there a way
to pass this this to nvstreammux automatically without extra code to extract
source width and height?”

is a simple no.

Hi,
My bad I got confused by ‘Output width’. It is source/sink pad in gstreamer and output/capture planes in v4l2. Just confuse Output width to be sink pad.

On DS4.0, we support fixed resolution case. All width/height has to be configured according to the sources in the config file. Automatic resolution detection is not supported.