Camera Not Working in hello/camera, Tried everything on forums

Hi, everyone. I started the Getting started with AI with Jetson Nano and everything was fine until the jupyter notebook. I tried everything available on other forums, FAQ, stackoverflow, but cannot make it work.

This is the error that i got

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.

When i execute: !ls -ltrh /dev/video*
I got: crw-rw---- 1 root video 81, 0 Jan 30 21:37 /dev/video0

When I execute this commands:
$ sudo apt install v4l-utils
$ v4l2-ctl -d /dev/video0 --list-formats-ext

It prompts:
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘MJPG’ (compressed)
Name : Motion-JPEG
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 640x360
Interval: Discrete 0.033s (30.000 fps)

    Index       : 1
    Type        : Video Capture
    Pixel Format: 'YUYV'
    Name        : YUYV 4:2:2
            Size: Discrete 640x360
                    Interval: Discrete 0.033s (30.000 fps)

    Index       : 2
    Type        : Video Capture
    Pixel Format: 'H264' (compressed)
    Name        : H.264
            Size: Discrete 1920x1080
                    Interval: Discrete 0.033s (30.000 fps)
            Size: Discrete 1280x720
                    Interval: Discrete 0.033s (30.000 fps)
            Size: Discrete 640x360
                    Interval: Discrete 0.033s (30.000 fps)

And I have tried changing 0 to 1 , in /dev/videoN. I have tried the FAQ and it shows in a maximaze screen the camera but i the error keeps showing in the jupyter notebook in usb_camera.ipynb.

What can I do?

hello marcelo.jara,

may I know which JetPack release you’re using? you could check $ cat /etc/nv_tegra_release for confirmation.
it looks you’re using USB camera. it’s only v4l2src able to access it. for example, please try with this gst pipeline for testing USB camera stream.
$ gst-launch-1.0 -v v4l2src device=/dev/video1 ! video/x-raw,framerate=30/1,width=640,height=480 ! xvimagesink

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