BUG: Frame from Raspberry Pi 4B and NVIDIA Jetson Nano B01 looks very different in terms of color

  1. Where did you get the camera module(s)?

Amazon.com

  1. Model number of the product(s)?

IMX519

  1. What hardware/platform were you working on?

Raspberry Pi 4B and NVIDIA Jetson Nano B01. However, I will use NVIDIA Jetson Nano B01 for Computer Vision since Raspberry Pi 4B is very slow.

  1. Instructions you have followed. (link/manual/etc.)

Raspberry Pi 4B:

  1. Install libcamera-still based on 519操作手册说明书 (arducam.com)

NVIDIA Jetson Nano B01:

  1. Install IMX519 driver based on Quick-Start-Guide - Arducam Wiki

  2. Try IMX519 with this ArduCAM/Jetson_IMX519_Focus_Example (github.com)

  3. Problems you were having?

The color is different. The sensor format 2328x1724 does not exist in NVIDIA Jetson Nano B01. I can’t reproduce the frame in NVIDIA Jetson Nano B01 like in Raspberry Pi 4B libcamera-still.

  1. The dmesg log from your hardware?

nvidia@nvidia:~/Arducam-IMX519$ v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'RG10'
	Name        : 10-bit Bayer RGRG/GBGB
		Size: Discrete 4656x3496
			Interval: Discrete 0.100s (10.000 fps)
		Size: Discrete 3840x2160
			Interval: Discrete 0.048s (21.000 fps)
		Size: Discrete 1920x1080
			Interval: Discrete 0.017s (60.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.008s (120.000 fps)

dmesg on gist.github.com

  1. Troubleshooting attempts you’ve made?

I tried to use gstreamer pipeline to resize the image from 3840x2160 to 1280x1280. But the bottom part of the frame become black.

def gstreamer_pipeline(
    # Issue: the sensor format used by Raspberry Pi 4B and NVIDIA Jetson Nano B01 are different
    # in Raspberry Pi 4B, this command
    # $ libcamera-still --width 1280 --height 1280 --mode 1280:1280
    # uses sensor format 2328x1748.
    # However, v4l2-ctl --list-formats-ext do not have such format.
    sensor_id=0,
    capture_width=3840,
    capture_height=2160,
    display_width=640,
    display_height=360,
    framerate=21,
    flip_method=0,
):
    return (
        "nvarguscamerasrc sensor-id=%d ! "
        "video/x-raw(memory:NVMM),width=(int)%d,height=(int)%d,format=(string)NV12,framerate=(fraction)%d/1 ! "
        "nvvidconv flip-method=%d ! "
        "video/x-raw,width=(int)%d,height=(int)%d,format=(string)BGRx ! "
        "videoconvert ! "
        "video/x-raw,format=(string)BGR ! "
        "appsink"
        % (
            sensor_id,
            capture_width,
            capture_height,
            framerate,
            flip_method,
            # capture_width/2 - display_width/2,
            # capture_width/2 + display_width/2,
            # capture_height/2 - display_height/2,
            # capture_height/2 + display_height/2,
            display_width,
            display_height
        )
    )
  1. What help do you need?

I need to make the frame from NVIDIA Jetson Nano B01 identical to frame from Raspberry Pi 4B.

I found the solution regarding the black pixels at the bottom of the frame.

The problem is that the only solution to mimic libcamera-still is to use the 4656x3496 sensor because it has the same aspect ratio as 2348x1748 which is 1,3:1 . Is there a way to use 2348x1748 sensor in NVIDIA Jetson Nano B01?

  1. If the frame_rate is set to the suggested frame rate by $ v4l2-ctl --list-formats-ext, the captured frame will have black pixels at the bottom of the frame.

An example that will have black pixels at the bottom of the frame:

def gstreamer_pipeline(
    capture_width=4656,
    capture_height=3496,
    frame_rate=10,

The solution is to substract the suggested frame rate by 1

def gstreamer_pipeline(
    capture_width=4656,
    capture_height=3496,
    frame_rate=10-1,