USB Camera not reading image ERROR (HELP!)

Hello,

I am following the “Getting Started with AI on Jetson Nano” and to test the USB camera I used the jetcam.usb_camera library.

Below is the code and output. I do not understand why I can’t initialize the Go-Pro Camera and read the live feed data.

Any help is appreciated :)!

I tested it and found that I am getting both videos from CSI and Go-Pro
code: !ls -ltrh /dev/video*
Output:
crw-rw----+ 1 root video 81, 0 Feb 3 20:35 /dev/video0 (CSI camera - works)
crw-rw----+ 1 root video 81, 3 Feb 3 20:36 /dev/video1 (Go-Pro Hero 6 using HDMI to USB3.0 capture card)

However, I am unable to see the video / live feed from the Go-Pro. Below is the code from the Nvidia Deep learning course.

Code:
from jetcam.usb_camera import USBCamera

#TODO change capture_device if incorrect for your system
camera = USBCamera(width=224, height=224, capture_width=640, capture_height=480, capture_device=1)

ERROR Output:

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.

Do you know any solution to this? Or even a workaround to see the live feed that is coming from the camera?

Best,
Vasu

Update:

This was the output of G streamer that I also tested. It is not showing the display at all.

dlinano@jetson-nano:~$ gst-launch-1.0 v4l2src device=/dev/video1 ! xvimagesink
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0: Could not initialise Xv output
Additional debug info:
xvimagesink.c(1773): gst_xv_image_sink_open (): /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:
Could not open display (null)Setting pipeline to NULL ...Freeing pipeline ...

You may try adding videoconvert in the middle of pipeline:

gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! xvimagesink

If this doesn’t work out, post the output of:

v4l2-ctl -d /dev/video1 --list-formats-all

(Note that v4l2-ctl is provided by apt package v4l-utils)