Only this pageAll pages
Powered by GitBook
1 of 5

CSI Camera - Guide

Guide

Loading...

Loading...

Loading...

Loading...

Overview

This page gives a basic overview over the Jetson linux Interface for MIPI CSI-2 devices

Document revisions and changes

Version
Changes

1.0

Internal release

1.1

Release

Disclaimer PDF export Auvidea can take no responsibility for the accuracy or completeness of any information presented in an exported PDF document as the export feature is developed, managed and maintained by GitBook. Those export mechanisms are subject to change without interaction by Auvidea. Please note that Auvidea includes this version table to identify the document and reference changes.

What is CSI?

CSI (Camera Serial Interface) is a specification for the transmission of video data from a camera sensor to a processor or other device. It is commonly used in embedded and mobile systems for a low latency video input.

Basic camera usage

This page provides a basic overview on the fpc/ffc-connection over CSI to the Carrierboard and basic camera streaming

How to connect

Most of carrierboards are using a 22-Pin FPC/FFC connector. The images below are showing the camera connection for the Raspberry PI IMX219 camera on a JNX30 Carrierboard using a 15- to 22-Pin adapter .

In case your camera uses a different connector you may want to take a look at our shop for available camera adapters.

Camera Capture

The following gstreamer pipelines are optimized for the Raspberry PI IMX219 and might not work with a different camera. If you don't know what you are doing, you may speak to your camera supplier for more information

The parameter sensor-id= describes the camera target. This id can be found by using ls /dev/. If the camera correctly plugged in then there should be a device called /dev/videoX, where X is the camera id.

All pipelines listed below are using the NVIDIA accelerated Argus GStreamer-plugins to make use of the NVIDIA Jetson specific hardware components

Common properties

Property
Description

sensor-id

Video device number

width

Requested video width

height

Requested video height

format

Video stream format, this value depends on the camera sensor that is used. You should contact your camera vendor for the value that should be used here

framerate

Defines captured frames for a given time frame (Example: 30/1 would be 30 frames each second -> frames/time)

num-buffers

Amount of frames that should be captured

Capture examples

stream.sh
gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)NV12, framerate=(fraction)30/1' ! nvvidconv ! queue ! xvimagesink
image_capture.sh
gst-launch-1.0 nvarguscamerasrc sensor-id=0 num-buffers=1 ! 'video/x-raw(memory:NVMM), width=(int)4032, height=(int)3040, format=(string)NV12, framerate=(fraction)30/1' ! nvvidconv ! pngenc ! filesink location=capture.png 
stream_capture.sh
gst-launch-1.0 nvarguscamerasrc sensor-id=0 num-buffers=100 ! 'video/x-raw(memory:NVMM), width=(int)4032, height=(int)3040, format=(string)NV12, framerate=(fraction)30/1' ! nvv4l2h264enc ! h264parse ! qtmux ! filesink location=capture_h264.mp4

Questions and Answers

This page covers the frequently asked questions about camera sensor and CSI

  • Q: Is the camera sensor <insert_sensor_name_here> supported by your firmware?

    • A: Our default firmware currently only supports the Raspberry PI IMX219. If you need further support with a different camera, you may want to contact us (support@auvidea.eu)

  • Q: My custom camera does not work on your board?

    • A: You may want to contact your camera vendor, if he already supports our carrierboard with their camera. If not, you may want to contact us (support@auvidea.eu)

  • Q: Why doesn't my IMX219 sensor on your Carrierboard?

    • A: Its required to install a custom firmware on the Jetson to support our carrierboards properly. You can find the downloads for our image on our website

  • Q: I have installed your firmware, but my IMX219 sensor still does not work.

    • A: Please make sure that you have connected the camera properly to your carrierboard. You may want to reach out to us, If the camera still does not work (support@auvidea.eu)

  • Q: How is the CSI-Connector configured on your carrierboard?

    • A: You can find a more detailed description of the CSI-Connectors in the manual on our website of your carrierboard

Camera configuration

This Page covers the advanced usage for camera streaming & configurations over the V4l-API

More detailed information about this can be found on the NVIDIA Camera adaption guide & manual pages for the used commands bellow

Introduction

The Video4Linux-API (V4L in short) is the Linux interface that is used to manage the CSI video input from the CSI-Camera. Most of those cameras are using I2C for futher configurations for the camera, which can be changed over the V4L-API in the following ways.

v4l-utils is required in order to execute the following examples properly by using

Install
 test@test-desktop:~$ sudo apt update & sudo apt install v4l-utils

Video4Linux Controls

V4L allows the user to make further configurations on the Camera sensor to alter/improve the video stream settings.

The video device can be found in the /dev/ directory. If the camera correctly plugged in then there should be a device called /dev/videoX, where X is the camera id.

List available controls

Returns a list of available camera controls to change

Syntax: sudo v4l2-ctl --device /dev/videoX -l

test@test-desktop:~$ sudo v4l2-ctl --device /dev/video0 -l

Camera Controls

                     group_hold 0x009a2003 (bool)   : default=0 value=0 flags=execute-on-write
                    sensor_mode 0x009a2008 (int64)  : min=0 max=3 step=1 default=0 value=1 flags=slider
                           gain 0x009a2009 (int64)  : min=16 max=356 step=1 default=16 value=16 flags=slider
                       exposure 0x009a200a (int64)  : min=13 max=683709 step=1 default=2495 value=26011 flags=slider
                     frame_rate 0x009a200b (int64)  : min=2000000 max=60000000 step=1 default=60000000 value=21000000 flags=slider
                    bypass_mode 0x009a2064 (intmenu): min=0 max=1 default=0 value=1
                override_enable 0x009a2065 (intmenu): min=0 max=1 default=0 value=1
                   height_align 0x009a2066 (int)    : min=1 max=16 step=1 default=1 value=1
                     size_align 0x009a2067 (intmenu): min=0 max=2 default=0 value=0
               write_isp_format 0x009a2068 (int)    : min=1 max=1 step=1 default=1 value=1
       sensor_signal_properties 0x009a2069 (u32)    : min=0 max=4294967295 step=1 default=0 [30][18] flags=read-only, has-payload
        sensor_image_properties 0x009a206a (u32)    : min=0 max=4294967295 step=1 default=0 [30][16] flags=read-only, has-payload
      sensor_control_properties 0x009a206b (u32)    : min=0 max=4294967295 step=1 default=0 [30][36] flags=read-only, has-payload
              sensor_dv_timings 0x009a206c (u32)    : min=0 max=4294967295 step=1 default=0 [30][16] flags=read-only, has-payload
               low_latency_mode 0x009a206d (bool)   : default=0 value=0
               preferred_stride 0x009a206e (int)    : min=0 max=65535 step=1 default=0 value=0
                   sensor_modes 0x009a2082 (int)    : min=0 max=30 step=1 default=30 value=3 flags=read-only
test@test-desktop:~$ 

Set control value

For this example we use the exposure controls from the list above

available control output
exposure 0x009a200a (int64)  : min=13 max=683709 step=1 default=2495 value=26011 flags=slider

This control can be changed by using the following command Syntax: sudo v4l2-ctl --device /dev/videoX --set-ctrl=<control>=<value>

set exposure control
test@test-desktop:~$ sudo v4l2-ctl --device /dev/video0 --set-ctrl=exposure=600000

Get control value

For this example we use the exposure controls from the list above.

This control can be read by using the following command Syntax: sudo v4l2-ctl --device /dev/videoX --get-ctrl=<control>

get exposure control
test@test-desktop:~$ sudo v4l2-ctl --device /dev/video0 --get-ctrl=exposure
exposure: 19999

Pleas note that other streaming tools can also intervene and change those settings and might be overwritten or not applied correctly.

Example Stream

The following screenshots are showing the difference between different exposure settings on a Raspberry PI IMX477 camera sensor that is connected via CSI on our JNX30M Carrierboard

default setting
custom setting