# How to connect camera to Jetson?

**URL:** <https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635>\
**Category:** Jetson Xavier NX\
**Tags:** camera\
**Created:** [September 17, 2020, 12:33pm UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635 "2020-09-17T12:33:24Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![duner](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@duner](https://forums.developer.nvidia.com/u/duner)\
**Post date:** [September 17, 2020, 12:33pm UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/1 "2020-09-17T12:33:24Z")

</div>

I have a Jetson Xavier NX and an IMX219-83 8MP 3D Stereo Camera Module. I have connected the camera to the Jetson with the provided FFC cable. I am not sure how to actually see the cameras output. I have posted on the forms for the cameras website as well ([How to connect camera to Jetson? - Hardware Products for AIoT Applications - Seeed Forum](https://forum.seeedstudio.com/t/how-to-connect-camera-to-jetson/254216)). I have plugged the camera in with the FFC cable, into each of the two slots on the jetson. The light on the camera turns on, so it is receiving power, but I do not know how to actually get the camera output. Ideally, id get the camera output through openCV (Python 3), but right now id settle for literally anything. The camera is compatible with Jetson products according to the manufactures site ([https://www.seeedstudio.com/IMX219-83-Stereo-Camera-8MP-Binocular-Camera-Module-Depth-Vision-Applicable-for-Jetson-Nano-p-4610.html](https://www.seeedstudio.com/IMX219-83-Stereo-Camera-8MP-Binocular-Camera-Module-Depth-Vision-Applicable-for-Jetson-Nano-p-4610.html)), I just do not know what code to write or what app to run to get the output.

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [September 18, 2020, 2:19am UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/3 "2020-09-18T02:19:31Z")

</div>

hello duner,

please refer to documentation, you may have some [Approaches for Validating and Testing the V4L2 Driver](https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3243/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fjetson_xavier_camera_soft_archi.html%23wwpID0E0YB0HA).  
thanks

---

<div class="post-metadata">

**Author:** ![duner](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@duner](https://forums.developer.nvidia.com/u/duner)\
**Post date:** [September 18, 2020, 11:28am UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/4 "2020-09-18T11:28:04Z")

</div>

So that section refers to a “Multimedia User Guide” that I do not see on the provided link [https://developer.nvidia.com/embedded/downloads](https://developer.nvidia.com/embedded/downloads). I tried filtering for it, no results. Is it definitely on that page?

Also, so what I got from that page was that there may be a driver I need but do not have? Is there any way to know which driver I need to get besides just contacting the maker of the camera?

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [September 18, 2020, 12:07pm UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/5 "2020-09-18T12:07:24Z")

</div>

hello duner,

it’s [L4T Multimedia API Reference](https://developer.nvidia.com/embedded/downloads#?search=L4T%20Multimedia%20API%20Reference) you’re looking for.  
there’re also some sample applications you may refer to.  
thanks

---

<div class="post-metadata">

**Author:** ![duner](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@duner](https://forums.developer.nvidia.com/u/duner)\
**Post date:** [September 18, 2020, 1:04pm UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/6 "2020-09-18T13:04:42Z")

</div>

Ok so I went to [Jetson Linux API Reference: Building and Running | NVIDIA Docs](https://docs.nvidia.com/jetson/l4t-multimedia/mmapi_build.html) and went to the sample apps. It seems like I need Jetpack, which I was not sure if I had but looking at [this doc](https://developer.download.nvidia.com/assets/embedded/secure/jetson/Xavier%20NX/Jetson_Xavier_NX_Developer_Kit_User_Guide.pdf?FEkO4b45bouFWTZgRGGiZ_qHalsZhg6VpFjETjtUMw4H470UbO3eH_vkfT1CIxDsMMzcVF4Eejfs0uBSOSnNjcUNsX2ii6LR0JCQhgLZ0ihuTZat0ECfWbnkOeUYgwN7aSQGn-7vuiSkfuJA78aPz64bXOd-uTSaKYdHHF1VNzOQhQM2ljw3npROTW31JlaBD-a59VH2) it seems like if I have all the samples, I should have Jetpack, I have the samples, so I’m assuming I have Jetpack (if there is another way to verify this please let me know).

So I followed steps 1-3 just fine, but then trying to follow the instructions on 12\_camera\_v4l2\_cuda I run into some issues. It seems like I do not have the files necessary. It says the paths are relative to "ll\_samples/samples "? Is that supposed to be "/ll\_samples/samples "? Or where specifically is that directory?

---

<div class="post-metadata">

**Author:** ![duner](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@duner](https://forums.developer.nvidia.com/u/duner)\
**Post date:** [September 18, 2020, 2:09pm UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/7 "2020-09-18T14:09:57Z")

</div>

Update: I did nothing differently, and installed nothing, but now I can at least see /dev/video0 and /dev/video1 (somehow), which is great. I tried getting their output with VLC, nothing… So the devices are definitely connected, I just get no data from them.

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [September 21, 2020, 2:13am UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/8 "2020-09-21T02:13:59Z")

</div>

hello duner,

1. you may install JetPack public release image with [NVIDIA SDK Manager](https://developer.nvidia.com/nvidia-sdk-manager).  
there’s options to install multimedia APIs, you should found it as below path; you should also check README files for instructions.  
i.e. `/usr/src/jetson_multimedia_api/`

2. if you seem `/dev/video0` and `/dev/video1` device nodes, it means video device were registered. you may enable applications to access the sensor stream. please gather logs if you had failures.  
i.e. `$ dmesg > klog.txt`

---

<div class="post-metadata">

**Author:** ![duner](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@duner](https://forums.developer.nvidia.com/u/duner)\
**Post date:** [September 21, 2020, 2:25pm UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/9 "2020-09-21T14:25:26Z")

</div>

So I installed jetpack with an SD card, but I do not have the folder you mentioned… Does the SDK manager install anything different than just using an SD card to install it? I have no other files on the jetson, so I really don’t mine reflashing it, wiping the SD card, whatever is easiest to make sure I have the drivers it seems I might need.

What am I looking for in the output of dmesg specifically?

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [September 22, 2020, 2:06am UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/10 "2020-09-22T02:06:37Z")

</div>

hello duner,

please note that you should select multimedia components while install JetPack release with SDKmanager.  
here’re commands you may tried to use `apt-get` to access the MMAPI package without reflashing the board.  
for example,

```auto
$ sudo apt-get update
$ sudo apt-get install nvidia-l4t-jetson-multimedia-api

```

---

<div class="post-metadata">

**Author:** ![duner](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@duner](https://forums.developer.nvidia.com/u/duner)\
**Post date:** [September 22, 2020, 6:25pm UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/11 "2020-09-22T18:25:12Z")

</div>

I have the multimedia components, but I ran that command anyway to make sure. Still cannot access the camera though. Running any of the examples off of /dev/video0 or /dev/video1 does not show any output.

---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [September 22, 2020, 7:23pm UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/12 "2020-09-22T19:23:46Z")

</div>

You would first check if a driver is handling your camera. Depending on your HW, this might need a specific driver (that may be a kernel module or embedded into a kernel image) and a specific device tree.  
As @JerryChang mentioned, you would get kernel boot messages into file klog.txt and check if a driver and which one controls your cameras. You would post it here as an upload.

If cameras are controlled, you should see video nodes in /dev:

```auto
ls /dev/video*

```

If you can see these for each camera, you would try to access these with V4L API:

```auto
# Need to do that only once
sudo apt install v4l-utils

# These would show some info 
v4l2-ctl -d/dev/video0 --list-formats-ext
v4l2-ctl -d/dev/video0 --all

```

---

<div class="post-metadata">

**Author:** ![duner](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@duner](https://forums.developer.nvidia.com/u/duner)\
**Post date:** [September 23, 2020, 11:48am UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/13 "2020-09-23T11:48:34Z")

</div>

Ok so im able to see them in /dev/video0, and get info with v412-ctl, I’m still not sure why I cannot seem to get their input… It says it is using tegra-video as a driver, so I guess I have the driver? I just cannot get any camera input? Or if I can I do not know the right command.

---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [September 23, 2020, 11:51am UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/14 "2020-09-23T11:51:56Z")

</div>

Please post the output of

```auto
v4l2-ctl -d/dev/video0 --list-formats-ext

```

so that I could propose a command for camera 0.

---

<div class="post-metadata">

**Author:** ![duner](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@duner](https://forums.developer.nvidia.com/u/duner)\
**Post date:** [September 23, 2020, 11:56am UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/15 "2020-09-23T11:56:51Z")

</div>

ioctl: VIDIOC\_ENUM\_FMT  
Index : 0  
Type : Video Capture  
Pixel Format: ‘RG10’  
Name : 10-bit Bayer RGRG/GBGB  
Size: Discrete 3264x2464  
Interval: Discrete 0.048s (21.000 fps)  
Size: Discrete 3264x1848  
Interval: Discrete 0.036s (28.000 fps)  
Size: Discrete 1920x1080  
Interval: Discrete 0.033s (30.000 fps)  
Size: Discrete 1280x720  
Interval: Discrete 0.017s (60.000 fps)  
Size: Discrete 1280x720  
Interval: Discrete 0.017s (60.000 fps)

---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [September 23, 2020, 12:08pm UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/16 "2020-09-23T12:08:39Z")

</div>

So you may try a gstreamer pipeline with nvarguscamerasrc. Assuming you are locally logged into Jeston with a GUI :

```auto
gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! nvvidconv ! xvimagesink 

```

You may select the resolution of framerate (pick one from available ones listed above) with such caps:

```auto
gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, framerate=30/1' ! nvvidconv ! xvimagesink 

```

From opencv, you would create a videoCapture with gstreamer API. The pipeline reads camera and converts into BGR for opencv:

```auto
cap = cv2.videoCapture('nvarguscamerasrc sensor_mode=0 ! video/x-raw(memory:NVMM), format=NV12 ! nvvidconv ! video/x-raw, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink', cv2.CAP_GSTREAMER)

```

---

<div class="post-metadata">

**Author:** ![duner](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@duner](https://forums.developer.nvidia.com/u/duner)\
**Post date:** [September 23, 2020, 12:28pm UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/17 "2020-09-23T12:28:39Z")

</div>

First of all thank you so much for helping.

So when I run either the first command or the second (with any resolution and frame rate combo listed) a window does pop up, but it just looks like someone took a screenshot of the part of the desktop its taking up and put that into a new window, the camera output does not show.

The openCV code hangs indefinitely.

---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [September 23, 2020, 6:32pm UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/18 "2020-09-23T18:32:56Z")

</div>

Don’t waste time with opencv before you are able to display your camera stream.

It seems that no frame has been read.  
For further help, please post the kernel boot messages. Generate file klog.txt with command:

```auto
dmesg > klog.txt

```

and upload it into your next post (in edit window, there is an icon with up arrow). It may help to find out what is wrong.

Also post the output of failing commands, it may give some clues.

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [September 24, 2020, 2:09am UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/19 "2020-09-24T02:09:16Z")

</div>

hello duner,

besides testing with gstreamer commands @Honey_Patouceul shared in [post #16](https://forums.developer.nvidia.com/t/154635/16).  
could you please also access camera stream with v4l2 standard controls.  
for example

```auto
$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=3264,height=2464,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100

```

if you still had difficult to access camera stream, you may also gather kernel messages for reference,  
thanks

---

<div class="post-metadata">

**Author:** ![nadeemm](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nadeemm/32/367020_2.png) [@nadeemm](https://forums.developer.nvidia.com/u/nadeemm)\
**Post date:** [October 18, 2021, 6:43pm UTC](https://forums.developer.nvidia.com/t/how-to-connect-camera-to-jetson/154635/21 "2021-10-18T18:43:15Z")

</div>


