# Troubles getting any camera to work

**URL:** <https://forums.developer.nvidia.com/t/troubles-getting-any-camera-to-work/181633>\
**Category:** Jetson Nano\
**Tags:** gstreamer, ubuntu, camera\
**Created:** [June 23, 2021, 9:45am UTC](https://forums.developer.nvidia.com/t/troubles-getting-any-camera-to-work/181633 "2021-06-23T09:45:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pqul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/pqul/32/106378_2.png) [@pqul](https://forums.developer.nvidia.com/u/pqul)\
**Post date:** [June 23, 2021, 9:45am UTC](https://forums.developer.nvidia.com/t/troubles-getting-any-camera-to-work/181633/1 "2021-06-23T09:45:41Z")

</div>

Hello,

I am trying to make a camera work on my Jetson Nano rev B01, running a Jetpack image that I downloaded from [this page](https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-devkit#write) two days ago (I do not know how to find the Jetpack version, sorry).

I have two different cameras:

- A Raspberry Pi Camera Module V2 (CSI)
- A LI-USB30-AR023ZWDR Camera Module from Leopard Imaging (USB 3.0)  
My goal is to use the USB Camera, and I am using the RasPi camera to try having a camera working.

The cameras seems to be recognized:

```nohighlight
$ ls /dev/video*
/dev/video0 /dev/video1
$ v4l2-ctl --list-devices
vi-output, imx219 7-0010 (platform:54080000.vi:0):
        /dev/video0

AR023ZWDR (usb-70090000.xusb-1.3):
        /dev/video1

```

However I have trouble getting them to work. nvgstcapture-1.0 seems to work for the RasPi camera. I can capture images and open them, however, there is no preview. I have attached the output in the file nvgstcapture-csi.txt.

It does not work at all for the USB camera:

```nohighlight
$ nvgstcapture-1.0 --camsrc=0 --cap-dev-node=1
** Message: 17:37:53.127: <main:4670> iterating capture loop ....
ERROR on bus: by /GstPipeline:capture_native_pipeline/GstBin:cap_bin/GstV4l2Src:v4l2src0: Internal data stream error.
debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:capture_native_pipeline/GstBin:cap_bin/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
** Message: 17:37:53.180: <main:4680> Capture completed
** Message: 17:37:53.181: <main:4729> Camera application will now exit

```

I have also attached a dmesg log.

I should note that the USB camera is working on three other computers, on multiple OS (Windows 10, Ubuntu 18 & 20)

I have found multiple forum posts, without success. I never had a camera live preview working.

[dmesg.txt](https://forums.developer.nvidia.com/uploads/short-url/g1wqq9508vZ2MIYohoDpHDwuOX6.txt) (92.7 KB)  
[nvgstcapture-csi.txt](https://forums.developer.nvidia.com/uploads/short-url/7B9lTB3PVLbUUeaOJ6e6hONlWsS.txt) (5.3 KB)

---

<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:** [June 23, 2021, 10:44pm UTC](https://forums.developer.nvidia.com/t/troubles-getting-any-camera-to-work/181633/2 "2021-06-23T22:44:42Z")

</div>

For your RPi v2 IMX219 connected to CSI0, for displaying to X window into GUI, you may just use :

```auto
gst-launch-1.0 -v nvarguscamerasrc ! nvvidconv ! xvimagesink

```

For your USB cam being on /dev/video1, you may try:

```auto
gst-launch-1.0 -v v4l2src device=/dev/video1 ! video/x-raw ! videoconvert ! xvimagesink

```

This might not work depending on your camera. If this doesn’t work, post the output of:

```auto
v4l2-ctl -d1 --list-formats-ext

```

---

<div class="post-metadata">

**Author:** ![pqul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/pqul/32/106378_2.png) [@pqul](https://forums.developer.nvidia.com/u/pqul)\
**Post date:** [June 24, 2021, 7:46am UTC](https://forums.developer.nvidia.com/t/troubles-getting-any-camera-to-work/181633/3 "2021-06-24T07:46:49Z")

</div>

Thank you for helping me!  
The first command for RPi works, thank you very much!

The second one for USB did not, so here is the `--list-formats-ext` output:

```nohighlight
ioctl: VIDIOC_ENUM_FMT
	Index : 0
	Type : Video Capture
	Pixel Format: 'YUYV'
	Name : YUYV 4:2:2
		Size: Discrete 1920x1080
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 2304x1536
			Interval: Discrete 0.045s (22.000 fps)

```

Also, the two cameras seems to be handled differently, e.g. I cannot get `cheese` to try using the RPi camera

---

<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:** [June 24, 2021, 6:02pm UTC](https://forums.developer.nvidia.com/t/troubles-getting-any-camera-to-work/181633/4 "2021-06-24T18:02:28Z")

</div>

Maybe cheese is no longer working on Jetsons (at least in R32.5).

You may try specifying a native mode such as:

```auto
gst-launch-1.0 -v v4l2src device=/dev/video1 ! video/x-raw,format=YUY2,width=1280,height=720,framerate=30/1 ! xvimagesink

# Or
gst-launch-1.0 -v v4l2src device=/dev/video1 io-mode=2 ! video/x-raw,format=YUY2,width=1280,height=720,framerate=30/1 ! xvimagesink

```

If it doesn’t work, you may try [this binary patch](https://forums.developer.nvidia.com/t/jetpack-4-5-nvv4l2h264enc-no-more-one-instance-with-opencv-4-5-2-segmentation-fault/181348/21).

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [June 25, 2021, 3:07am UTC](https://forums.developer.nvidia.com/t/troubles-getting-any-camera-to-work/181633/5 "2021-06-25T03:07:28Z")

</div>

Hi,  
Thank Honey Patouceul for sharing the binary.

It is known that 3rdparty applications such as cheese do not work on Jetpack 4.5.1. Please apply the binary and give it a try.

---

<div class="post-metadata">

**Author:** ![pqul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/pqul/32/106378_2.png) [@pqul](https://forums.developer.nvidia.com/u/pqul)\
**Post date:** [June 25, 2021, 8:01am UTC](https://forums.developer.nvidia.com/t/troubles-getting-any-camera-to-work/181633/6 "2021-06-25T08:01:44Z")

</div>

Thank you again!

Both commands work!

No problem for cheese, I was only using it to test the cameras. Thanks for the information about 3rd party applications!

Have a nice week-end!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [August 24, 2021, 8:02am UTC](https://forums.developer.nvidia.com/t/troubles-getting-any-camera-to-work/181633/7 "2021-08-24T08:02:27Z")

</div>

Closed on August 24, 2021, 8:02am UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
