"nvvidconv" plugin producing error when negotiating for resolution with odd number

Hi,

I am trying set TX2 onboard sensor for odd resolution (e.g 100x101), I am experiencing the below error but it is working for any even resolution values.

ubuntu@gtegratx2:~$ gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM),width=100, height=1901, framerate=30/1, format=NV12' ! nvvidconv flip-method=0 ! nvegltransform ! nveglglessink -e
Setting pipeline to PAUSED ...

Using winsys: x11 
Pipeline is live and does not need PREROLL ...
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
Setting pipeline to PLAYING ...
New clock: GstSystemClock
GST_ARGUS: Creating output stream
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:546 Failed to create OutputStream

Inspecting the nvvidconv element I saw that it support even odd resolutions.

gst-inspect-1.0 nvvidconv
Factory Details:
  Rank                     primary (256)
  Long-name                NvVidConv Plugin
  Klass                    Filter/Converter/Video/Scaler
  Description              Converts video from one colorspace to another & Resizes
  Author                   amit pandya <apandya@nvidia.com>

Plugin Details:
  Name                     nvvidconv
  Description              video Colorspace conversion & scaler
  Filename                 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvidconv.so
  Version                  1.2.3
  License                  Proprietary
  Source module            gstreamer-nvvconv-plugin
  Binary package           GStreamer nvvconv Plugin
  Origin URL               http://nvidia.com/

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseTransform
                         +----Gstnvvconv

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/x-raw(memory:NVMM)
                 format: { (string)I420, (string)I420_10LE, (string)P010_10LE, (string)I420_12LE, (string)UYVY, (string)YUY2, (string)YVYU, (string)NV12, (string)BGRx, (string)RGBA }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-raw
                 format: { (string)I420, (string)UYVY, (string)YUY2, (string)YVYU, (string)NV12, (string)BGRx, (string)RGBA }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
  
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-raw(memory:NVMM)
                 format: { (string)I420, (string)I420_10LE, (string)UYVY, (string)YUY2, (string)YVYU, (string)NV12, (string)BGRx, (string)RGBA }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-raw
                 format: { (string)I420, (string)UYVY, (string)YUY2, (string)YVYU, (string)NV12, (string)BGRx, (string)RGBA }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]

Is it a bug? or the nvvidconv doc is misleading. Please help me to understand.

It is failing to create the Argus::OutputStream. The ISP requires that your resolution be a multiple of one of your camera’s supported modes so the DMA can be set up properly. Otherwise you would have all sorts of issues.

Try moving your caps to the other side of nvvidconv. That way you will pull images at their default resolution and then nvvidconv will scale it to match what you actually want.

gst-launch-1.0 nvarguscamerasrc ! nvvidconv flip-method=0 ! 'video/x-raw(memory:NVMM),width=100, height=1901, framerate=30/1, format=NV12' ! nvegltransform ! nveglglessink -e

If that doesn’t work you may need to use a CPU based conversion with ‘videoconvert’ before your sink

Hi Atrer,

Thanks for the kind reply. I would like to know why it didn’t fail for even resolution that is not multiples of the resolutions that it supports.

for e.g the below command is working fine.

ubuntu@gtegratx2:~$ gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM),width=100, height=100, framerate=30/1, format=NV12' ! nvvidconv flip-method=0 ! nvegltransform ! nveglglessink -e

Likewise, I have given all the even resolutions (256x256,100x120, etc) and the above command is working fine. I just want to know whether it is a restriction to use only even resolutions at the sensor end.

Ram

Perhaps one of the Nvidia devs will respond, but I’d guess it has to do with the ISP handling images in bayer format (https://en.wikipedia.org/wiki/Bayer_filter). In that format you need the rows to be an even number else your last row won’t have complete color information.

What happens if you make the width odd and the height even?

e.g.

ubuntu@gtegratx2:~$ gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM),width=101, height=100, framerate=30/1, format=NV12' ! nvvidconv flip-method=0 ! nvegltransform ! nveglglessink -e

Hi,
Hardware engine may hang for resolution in odd values. Please configure even values.

Atrer,

For odd height and even width values also it is producing the same error.

DaneLLL,

Thanks for the reply, will follow the even resolution format.

Ram