tcamtegrasrc¶
Overview¶
The tcamtegrasrc element captures raw image data from The Imaging Source MIPI cameras. This is in contrast to accessing the cameras via NVidia’s nvarguscamerasrc element, which provides images that were processed by the ISP on the Jetson platform.
Using the raw data can be useful for certain image processing tasks, where the unaltered image data is preferred. It also allows more control of the image processing algorithms the image data passed through.
tcamtegrasrc fully integrates with tiscamera from version 0.14 onwards, making The Imaging Source MIPI cameras accessible through the tiscamera SDK. The tiscamera-dutils package is required.
tcamtegrasrc allows camera configuration through tiscamera’s TcamProp interface.
Using the tcamtegrasrc GStreamer Element¶
Launching the following pipeline shows a live image from the first MIPI avaialble camera:
gst-launch-1.0 tcamtegrasrc ! tcamdutils ! videoconvert ! ximagesink
Enumerating Available Cameras¶
tcamtegrasrc implements a GstDeviceProvider, which allows the connected cameras to be enumerated through GStreamer’s device monitor framework.
The easiest was to see the connected devices is to call the gst-device-monitor-1.0 program:
gst-device-monitor-1.0 -f tcam
It has to be started with the -f parameter to give the enumeration process some time; the tcam parameter filters the output to show only tcam-related devices. For example, the output might look like this:
Probing devices...
No devices found!
Monitoring devices, waiting for devices to be removed or new devices to be added...
Device found:
name : tcam-DFM37CX290ML-02120467-tegra
class : Source/Video/Device/tcam
caps : video/x-bayer, format=(string)rggb16, width=(int)1948, height=(int)1096, framerate=(fraction)[ 2/1, 60/1 ];
video/x-bayer, format=(string)rggb16, width=(int)1948, height=(int)1096, framerate=(fraction)[ 2/1, 60/1 ];
video/x-bayer, format=(string)rggb16, width=(int)1920, height=(int)1080, framerate=(fraction)[ 2/1, 60/1 ];
video/x-bayer, format=(string)rggb16, width=(int)1920, height=(int)1080, framerate=(fraction)[ 2/1, 60/1 ];
video/x-bayer, format=(string)rggb16, width=(int)1280, height=(int)720, framerate=(fraction)[ 2/1, 90/1 ];
video/x-bayer, format=(string)rggb16, width=(int)1280, height=(int)720, framerate=(fraction)[ 2/1, 90/1 ];
video/x-bayer, format=(string)rggb16, width=(int)960, height=(int)540, framerate=(fraction)[ 2/1, 119/1 ];
video/x-bayer, format=(string)rggb16, width=(int)960, height=(int)540, framerate=(fraction)[ 2/1, 119/1 ];
video/x-bayer, format=(string)rggb16, width=(int)640, height=(int)480, framerate=(fraction)[ 2/1, 133/1 ];
video/x-bayer, format=(string)rggb16, width=(int)640, height=(int)480, framerate=(fraction)[ 2/1, 133/1 ];
properties:
serial = 02120467
model = "DFM\ 37CX290-ML"
type = tegra
gst-launch-1.0 tcamtegrasrc serial=02120467 ! ...
In this example, one DFM 37CX290-ML camera was detected with the serial number 02120467.
Selecting a Specific Camera¶
The cameras are uniquely identified by their serial number. The camera can be selected through the serial property of the tcamtegrasrc element:
gst-launch-1.0 tcamtegrasrc serial=02120467 ! tcamdutils ! videoconvert ! ximagesink
tcamtegrasrc Element Properties¶
- serial : Serial of the camera
- flags: readable, writable String. Default: “”
- do-timestamp : Apply current stream time to buffers
- flags: readable, writable Boolean. Default: true
- num-buffers : Number of buffers to output before sending EOS (-1 = unlimited)
- flags: readable, writable Integer. Range: -1 - 2147483647 Default: -1
- tcam-properties : In GST_STATE_NULL, sets the initial values for tcam-property 1.0 properties.In GST_STATE_READY, sets the current properties of the device, or reads the current state of all propertiesNames and types are the ones found in the tcam-property 1.0 interface.(Usage e.g.: ‘gst-launch-1.0 tcamtegrasrc tcam-properties=tcam,ExposureAuto=Off,ExposureTime=33333 ! …’)
- flags: readable, writable Boxed pointer of type “GstStructure”
Supported Caps¶
The available caps are generated from the formats that the driver, and depend on the platform, sensor model and sensor type. The following list describes some commonly example formats:
Property | Comment |
---|---|
video/x-bayer, format=rggb16 | 16-bit Bayer (RG) |
video/x-bayer, format=rggb12 | 12-bit Bayer (RG) |
video/x-bayer, format=rggb10 | 10-bit Bayer (RG) |
video/x-raw, format=GRAY16_LE | 16-bit Monochrome |
video/x-raw, format=GRAY12 | 12-bit Monochrome |
video/x-raw, format=GRAY10 | 10-bit Monochrome |
video/x-raw, format=pwl-rggb12 | 12-bit PWL-compressed Bayer (RG) |
video/x-raw, format=pwl-rggb16H12 | 12-bit PWL-compressed Bayer (RG) (MSB) |
All formats can be handed to tcamdutils or tcamdutils-cuda for further processing, e.g. conversion to BGRx.
tcamdutils is provided by the package tiscamera-dutils. tcamdutils-cuda is provided by the package tcamdutils-cuda.
Camera Configuration via tcamprop Interface¶
The list of camera properties configurable through the tcamprop interface depends on the connected camera hardware. For a detailed description of the properties available for each camera model, please refer to the theimagingsource-drivers documentation.
The following list gives an overview of the names and types of properties that are supported by most cameras:
Property | Type | Unit |
---|---|---|
ExposureTime | double | us |
Gain | double | dB |
BlackLevel | double | |
OffsetX | Integer | Pixels |
OffsetY | Integer | Pixels |
OffsetAutoCenter | Boolean |
tcamtegrasrc itself also provides automatic controls for ExposureTime and Gain, in case the camera does not provide them by itself:
Property | Type | Unit/Values |
---|---|---|
GainAuto | Enumeration | Continuous, Off |
GainAutoLowerLimit | double | dB |
GainAutoUpperLimit | double | dB |
ExposureAuto | Enumeration | Continuous, Off |
ExposureAutoLowerLimit | double | us |
ExposureAutoUpperLimit | double | us |
ExposureAutoUpperLimitAuto | Boolean | |
ExposureAutoReference | Integer |
For color cameras, white balance auto controls are provided. However, the image contents is not changed; the coefficients have to be applied by an image transformation element, for example tcamdutils.
Property | Type | Unit/Values |
---|---|---|
BalanceWhiteAuto | Enumeration | Continuous, Once, Off |
BalanceWhiteRed | double | |
BalanceWhiteGreen | double | |
BalanceWhiteBlue | double |
The automatic functions can be configured to only sample data from a specified region of the image:
Property | Type | Unit/Values |
---|---|---|
AutoFunctionsROIEnable | Boolean | |
AutoFunctionsROIPreset | Enumeration | Full Sensor, Custom Rectangle, Center 50%, Center 25%, Bottom Half, Top Half |
AutoFunctionsROILeft | Integer | |
AutoFunctionsROITop | Integer | |
AutoFunctionsROIWidth | Integer | |
AutoFunctionsROIHeight | Integer |
Troubleshooting¶
To get extended debug output, start the GStreamer pipeline with the GST_DEBUG variable defined:
GST_DEBUG=tcamtegrasrc:5 gst-launch-1.0 tcamtegrasrc ! tcamdutils ! videoconvert ! ximagesink
This launches the pipeline with the debug level for tcamtegrasrc set to 5 (debug). Multiple status messages will be printed to the console, potentially giving hints to what is not working correctly.
Additionally, the kernel log might provide information:
dmesg