Gstreamer nvvidconv GRAY8 to NV12 not working

I am working to convert a camera stream outputting GRAY8 to NV12. And I was utilizing the following gstream pipeline to perform a test.

# GStreamer pipeline
GST_DEBUG=3,v4l2src:5,nvvidconv:5 gst-launch-1.0 v4l2src device="/dev/video4" io-mode=2 \
! "video/x-raw,format=GRAY8,width=640,height=512,framerate=60/1" \
! nvvidconv \
! "video/x-raw(memory:NVMM),format=NV12" \
! nvv4l2h264enc insert-sps-pps=true idrinterval=60 iframeinterval=60 bitrate=5000000 vbv-size=5000000 preset-level=2 control-rate=1 \
! h264parse \
! matroskamux \
! filesink location=video.mkv

outputs an error:

ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason error (-5)

However, when I switch over to I420, I do not have these issues.

It says that this conversion should be possible from: Accelerated GStreamer — Jetson Linux Developer Guide documentation

And is also confirmed by the output of gst-inspect-1.0 nnvidconv:

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-raw(memory:NVMM)
                 format: { (string)I420, (string)I420_10LE, (string)P010_10LE, (string)UYVY, (string)YUY2, (string)YVYU, (string)NV12, (string)NV16, (string)NV24, (string)GRAY8, (string)BGRx, (string)RGBA, (string)Y42B, (string)Y444 }
                  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)NV16, (string)NV24, (string)GRAY8, (string)BGRx, (string)RGBA, (string)Y42B, (string)Y444 }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
  
  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)NV16, (string)NV24, (string)GRAY8, (string)BGRx, (string)RGBA, (string)Y42B, (string)Y444 }
                  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)NV16, (string)NV24, (string)P010_10LE, (string)GRAY8, (string)BGRx, (string)RGBA, (string)Y42B, (string)Y444 }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]

I am using a Jetson AGX Orin, with Jetpack version: 5.1.2-b104

Hi,
GRAY8 can be converted to GRAY8 or I420. Other formats are not supported. Please convert to I420 first and then NV12.

For further information, you can check source code of nvvidconv:

Jetson Linux 36.3 | NVIDIA Developer
Driver Package (BSP) Sources

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.