Access the camera with Gstreamer
You can refer to the following doc to access the cameras with Gstreamer:
Arducam Displayer Tools
Install the driver
Step1. Download automatic installation script
Step2. Install the driver
Enter y to reboot your device.
How to use 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.
1. install the v4l2 python module
for python 3.x:
After you type the following command and press【Enter】, it will take several minutes to finish downloading.
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:
You can refer to this link to fix this bug:
2. Download the demo code
3. Check whether the camera is detected
4. Check the video format supported
5. Display images in real time
If accessing Jetson via remote software (e.g., MobaXterm), the following command (executed only once) is required to display the image.
Enter program directory:
Run the demo:
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 rw_sensor.py for an example of how to use it.
- rw_sensor.py help file
- rw_sensor.py demo
Read a single register
Read multiple registers
python rw_sensor.py -d 0 -r 0x3500 0x3501 0x3502
Write multiple registers
Display in VLC
Some cameras support using VLC to capture images. But please notice that some formats will not be supported by VLC.
Please first check if your camera formats can be supported.
# input the command to check the camera formats sudo apt-get install -y v4l-utils v4l2-ctl --list-formats-ext
Open VLC media player
Display the image
【Video device name】→ select "/dev/video0"→ click 【Play】.
Adjust exposure, gain, and frame rate
Press Ctrl+E, drag the sliders at "Exposure", "Gain" and "Frame_rate" to make adjustments under the "v4l2 control" tab.
Access Global Shutter Camera using external trigger snapshot mode