USB Camera not recognized

Hello,

I am reporting a common struggle faced by novice Jetson Nano developers
To Initial USB Camera interfaced to Jetson Nano
Steps followed
[1]: !ls -ltrh /dev/video*
​Output: crw-rw----+ 1 root video 81, 0 Sep 2 14:53 /dev/video0
[2] $ v4l2-ctl -d /dev/video0 --list-formats-ext
gst-launch-1.0 -v v4l2src device=/dev/video1 ! video/x-raw,framerate=30/1,width=1280,height=720 ! xvimagesink
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

[3] $ gst-launch-1.0 -v v4l2src device=/dev/video1 ! video/x-raw,framerate=30/1,width=1280,height=720 ! xvimagesink
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …


RuntimeError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/jetcam-0.0.0-py3.6.egg/jetcam/usb_camera.py in init(self, *args, **kwargs)
23 if not re:
—> 24 raise RuntimeError(‘Could not read image from camera.’)
25

RuntimeError: Could not read image from camera.

During handling of the above exception, another exception occurred:

RuntimeError Traceback (most recent call last)
in
2
3 #TODO change capture_device if incorrect for your system
----> 4 camera = USBCamera(width=224, height=224, capture_width=640, capture_height=480, capture_device=0)

/usr/local/lib/python3.6/dist-packages/jetcam-0.0.0-py3.6.egg/jetcam/usb_camera.py in init(self, *args, **kwargs)
26 except:
27 raise RuntimeError(
—> 28 ‘Could not initialize camera. Please see error trace.’)
29
30 atexit.register(self.cap.release)

RuntimeError: Could not initialize camera. Please see error trace.

Please let me know which step is missed?
USB Camera is still not functional

Best Regards
Sreepada

Some reason to use video1 even /dev/video0 is there?

Blockquote
gst-launch-1.0 -v v4l2src device=/dev/video1 ! video/x-raw,framerate=30/1,width=1280,height=720 ! xvimagesink
[3] $ gst-launch-1.0 -v v4l2src device=/dev/video1 ! video/x-raw,framerate=30/1,width=1280,height=720 ! xvimagesink

Hi,
Please check Jetson Nano FAQ
Q: I have a USB camera. How can I lauch it on Jetson Nano?
Looks like your format is not set. Please set the exact mode including width,height,format,framerate.

1 Like

Hello Dane,
Thank you for sharing Jetson Nano FAQ
USB Camera is functional.

$ gst-launch-1.0 -v v4l2src device=/dev/video0 ! ‘video/x-raw,format=YUY2,width=1280,height=720,framerate=10/1’ ! xvimagesink -ev

I have following suggestion,

  1. Please share the Jetson Nano FAQs link in Hello Camera URL

It helps novice to quickly follow the procedure

Best Regards
Sreepada

Hello MtHiker,
thank you for the feedback.
I observed that, when USB camera is unplug and connect back the device=/dev/video0 or /dev/video1 was dynamically updated.
I am able to run video now with
$ gst-launch-1.0 -v v4l2src device=/dev/video0 ! ‘video/x-raw,format=YUY2,width=1280,height=720,framerate=10/1’ ! xvimagesink -ev

Hi,
Please try

camera = USBCamera(width=224, height=224, capture_fps=10, capture_width=1280, capture_height=720, capture_device=0)

Hi,

USB Camera is functional with the above command.
Topic can be closed.

Thank you

Best Regards
Sreepada