Video Record Problem On AGX XAVIER

Hi everyone,

I’m having an issue with recording video using an RGB camera (FPGA). When I list the formats using v4l2-ctl --list-formats-ext, I see the following:

ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'AB24' (32-bit RGBA 8-8-8-8)
                Size: Discrete 1280x720

I’m attempting to record raw frames using the command:

v4l2-ctl --device /dev/video0 --stream-mmap --stream-count=1 --stream-to=frame2.raw

Now, I want to record an AVI video with the following pipeline:

gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! 'video/x-raw, format=(string)RGBA, \
     width=(int)1280, height=(int)720' ! nvvidconv ! \
     'video/x-raw(memory:NVMM), format=(string)I420' ! \
     nvv4l2h264enc ! 'video/x-h264, \
     stream-format=(string)byte-stream' ! h264parse ! \
     avimux ! filesink location=test.avi -e

However, I’m encountering the following error: “WARNING: erroneous pipeline: could not link nvv4l2camerasrc0 to nvvconv0, nvv4l2camerasrc0 can’t handle caps video/x-raw, format=(string)RGBA, width=(int)1280, height=(int)720”. How can I resolve this and successfully record video from my camera?
Thanks

Hi Ummet,

nvv4l2camerasrc is only able to capture in UYVY, you can check this using gst-inspect-1.0 nvv4l2camerasrc:

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-raw(memory:NVMM)
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
                 format: { (string)UYVY }
         interlace-mode: { (string)progressive, (string)interlaced }
              framerate: [ 0/1, 2147483647/1 ]

I would recommend changing the pipeline so that it uses v4l2src as the capture element, everything else looks okay to me. You can see more examples here:

"Hi @emmanuel.madrigal, thank you for your response. I tried the following pipeline:

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, format=(string)RGBA, width=(int)1280, height=(int)720' ! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)I420' ! nvv4l2h264enc ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! avimux ! filesink location=test.avi -e

However, I encountered an error: “erroneous pipeline: could not link v4l2src0 to nvvconv0, v4l2src0 can’t handle caps video/x-raw, format=(string)RGBA, width=(int)1280, height=(int)720”. I am using Linux for Tegra (Jetson Linux) version R35.4.1. When I check with gst-inspect-1.0 v4l2src, I get:

format: { (string)RGB16, (string)BGR, (string)RGB, (string)GRAY:8, (string)GRAY16_LE, (string)GRAY16_BE, (string)YVU9, (string)YV12, (string)YUY2, (string)YVYU, (string)UYVY, (string)Y42B, (string)Y41B, (string)YUV9, (string)NV12_64Z32, (string)NV24, (string)NV61, (string)NV16, (string)NV21, (string)NV12, (string)I420, (string)BGRA, (string)BGRx, (string)ARGB, (string)xRGB, (string)BGR15, (string)RGB15 }

I cannot see RGBA in the list. Does v4l2src not support RGBA? Does any version of Linux for Tegra support RGBA? I am receiving frames from an FPGA, not a camera sensor. Could this be causing the issue, as I am receiving raw frames?" Any nvdia driver like nvv4l2camerasrc for RGBA format?