Pipeline with nvvidconv and nvstreammux on Jetson Xavier

My DeepStream app pipeline is as follows-

v4l2src > nvvidconv> nvstreammux> …

I get this error-
ERROR from element stream-muxer: Input buffer number of surfaces (0) must be equal to mux->num_surfaces_per_frame (1)
Set nvstreammux property num-surfaces-per-frame appropriately

Error details: /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvmultistream/gstnvstreammux.c(311): gst_nvstreammux_chain (): /GstPipeline:pipeline/GstNvStreamMux:stream-muxer

Can you provide platform information?
• Hardware Platform (Jetson / GPU)
• DeepStream Version
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)

What type of camera are you using? csi camera or usb camera? What is the output of the camera?

• Hardware Platform (Jetson / GPU) Jetson Xavier NX
• DeepStream Version 5.0
• JetPack Version (valid for Jetson only) 4.4
• TensorRT Version 7.1.3
Using USB camera.

Since we don’t know your device capability. I can just give you a sample of our usb camera. It can work. Please use DeepStream plugins for DeepStream. https://docs.nvidia.com/metropolis/deepstream/dev-guide/index.html#page/DeepStream%20Plugins%20Development%20Guide/deepstream_plugin_details.html#

gst-launch-1.0 v4l2src device="/dev/video1" ! ‘video/x-raw,width=640,height=480,format=YUY2’ ! nvvideoconvert ! ‘video/x-raw(memory:NVMM),format=NV12’ ! m.sink_0 nvstreammux name=m batch-size=1 width=640 height=480 ! nvvideoconvert ! nvegltransform ! nveglglessink sync=0