Jetson Nano CSI Camera - Output Formats

Hi everyone,

I have a question regarding CSI cameras and their output formats. I’m currently testing out the Alvium C-319 and C-158 cameras from Allied Vision.

I want to be able to change the output formats to support YUV but not sure how (I’m using Gstreamer). Running:

v4l2-ctl /dev/video0 --list-formats-ext

gives me:

ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘RGGB’
Name : 8-bit Bayer RGRG/GBGB
Size: Discrete 1456x1088
Interval: Discrete 0.020s (49.688 fps)

    Index       : 1
    Type        : Video Capture
    Pixel Format: 'BX24'
    Name        : 32-bit XRGB 8-8-8-8
            Size: Discrete 1456x1088
                    Interval: Discrete 0.020s (49.688 fps)

    Index       : 2
    Type        : Video Capture
    Pixel Format: 'XR24'
    Name        : 32-bit BGRX 8-8-8-8
            Size: Discrete 1456x1088
                    Interval: Discrete 0.020s (49.688 fps)

    Index       : 3
    Type        : Video Capture
    Pixel Format: 'VYUY'
    Name        : VYUY 4:2:2
            Size: Discrete 1456x1088
                    Interval: Discrete 0.020s (49.688 fps)

Hence I know my camera supprts VYUY. However I don’t think (from documentation) that v4l2src supports this format. Does nvarguscamera support it? Also is there any link/document that has this information? I did find this document but I don’t know if its up to date and has all the information.

How do you think I should go about this problem?

Hi alexisguiter,

Unfortunately v4l2src do not support YVUY. However, v4l2src can be patched to extend support to this format and I don’t think it could be difficult to add it. This will requires to download GStreamer and Plugins source code, patch the files, build and install the updated support

Here is reference about how to compile GStreamer for Jetson TX2 and a example patch to add RAW10 support to v4l2src:
https://developer.ridgerun.com/wiki/index.php?title=Compile_gstreamer_on_Jetson_TX1_and_TX2

You can use v4l2-ctl to set the format you want and capture images:

v4l2-ctl -d /dev/video0 --set-fmt-video=width=1456,height=1088,pixelformat=VYUY --set-ctrl bypass_mode=0 --stream-mmap --stream-count=10 --stream-to=test.uyvy

Regarding nvarguscamerasrc, this element is used to capture data passing it through the Jetson ISP. So, only Bayer data could be received by the ISP and here will be converted to YUV.
This will work only If the camera driver was developed with Jeston ISP support. So, if your driver support this, you can use nvarguscamerasrc to capture Bayer data from the sensor and get YUV data ( converted by the ISP).

1 Like

Hi @enrique.ramirez thanks for your help,

Where could I download the patches to support VYUY format?

Hi alexisguiter,

I don’t have a patch for that because I’ve never need that support before. However, you can use the RAW10 support patch as reference to understand what changes are needed to modify pixel formats supported by the GStreamer element.

In that example, RAW8 support was replaced to RAW10 support. You can do a similar thing by replacing UYVY by VYUY.

Regards