Jetson Cameras

  1. Home
  2. Docs
  3. Jetson Cameras
  4. Jetvariety – MIPI Camera Modules for Jetson Nano/Xavier NX
  5. 2. Camera Demonstration

2. Camera Demonstration

1.Hardware connection

The Arducam Project Jetvariety consists of three parts:

  1. The MIPI Camera Module
  2. The camera driver
  3. The Jetvariety adapter board

Therefore, the MIPI camera module alone will not directly work with the Jetson Nano, and the adapter is required. You should connect the MIPI camera module to the adapter, and then the adapter to the MIPI CSI slot of the Jetson Nano.

2.Check and validate the camera connection

Make sure you have installed the camera driver before you proceed.

2.1 Check whether the camera is detected

ls /dev/video*

You should find new video devices from /dev/videoX (X might vary from 0 ~ N).

2.2 Check the video format supported

Install the v4l-utils package:

sudo apt-get install v4l-utils

Determine which format and resolution the current camera supported:

v4l2-ctl --list-formats-ext
v4l2 ctl

3.Run the camera

Some of the video preview software tools like VLC player only supports formats like GRAY, YUV etc., it might not support Bayer format. In this case we provide a python demo script to illustrate how to open and preview our cameras with OpenCV. In the demo code the most important three steps should be followed.


The official SD Card Image provided by Nvidia comes with a Python version of OpenCV version 4.1.1.

  • Designate the VideoCapture apiPreference parameter as CAP_V4L2
  • Disable the RGB conversion
  • Shift the data bit to match with the camera real output bit width and do color conversion when necessary.

3.1 Install v4l2 python module

for Python3.x:

sudo python3  
sudo pip3 install v4l2-fix  


The V4L2 of Python3.x has a known bug that requires a manual fix, and the following error occurs when you import the v4l2 module into Python3.x:

python import v4l2 error

You can refer to this link to fix this bug: v4l2 throws a TypeError when imported in Python 3.5

for Python2.7:

sudo python  
sudo pip install v4l2  


If you want to install pip for both python3.x and python2.7, install python3 pip first, then python2.7 pip, otherwise the pip command will be overwritten by pip3. You can use pip --version and pip3 --version to check if the pip version is correct.

3.2 Download the demo code

git clone  
cd MIPI_Camera/Jetson/Jetvariety/example  

3.3 Check the help message of the parameters

python -d 0  
the parameters of arducam python displayer

3.4 Run the Demo


4.Read the sensor register

Arducam MIPI Camera driver for Jetson Nano support accessing the registers of the camera sensor and driver board by ioctl. Refer to rw_sensor.c and for an example of how to use it.

4.1 help file

rw sensor help

4.2 demo

Read a single register

python -d 0 -r 0x3500

Read multiple registers

python -d 0 -r 0x3500 0x3501 0x3502

Write a single register

python -d 0 -r 0x3500 -v 0x01

Write multiple registers

python -d 0 -r 0x3500 0x3501 -v 0x01 0x02
Was this article helpful to you? Yes No