> For the complete documentation index, see [llms.txt](https://auvidea.gitbook.io/csi-camera/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://auvidea.gitbook.io/csi-camera/guide/basic-camera-usage.md).

# Basic camera usage

## 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](https://www.raspberrypi.com/products/camera-module-v2/) camera on a JNX30 Carrierboard using a 15- to 22-Pin adapter .&#x20;

{% hint style="info" %}
&#x20;In case your camera uses a different connector you may want to take a look at our [shop](https://auvidea.eu/product-category/cameras-2/csi-2/) for available camera adapters. &#x20;
{% endhint %}

| ![](/files/3RZErGbemkGDcyZP5GYD) | ![](/files/EY4gGfH4U6u5t9sqZAFV) |
| -------------------------------- | -------------------------------- |

## Camera Capture

{% hint style="warning" %}
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
{% endhint %}

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

{% tabs %}
{% tab title="Streaming" %}
{% code title="stream.sh" overflow="wrap" lineNumbers="true" %}

```bash
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
```

{% endcode %}
{% endtab %}

{% tab title="capture png " %}
{% code title="image\_capture.sh" overflow="wrap" lineNumbers="true" %}

```bash
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 
```

{% endcode %}
{% endtab %}

{% tab title="capture mp4" %}
{% code title="stream\_capture.sh" overflow="wrap" lineNumbers="true" %}

```bash
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
```

{% endcode %}
{% endtab %}
{% endtabs %}
