Running Inference Program with a C920 webcam

Ran an inferencing program first with csi://0 everything worked well.

Then I commented out camera = videoSource(“csi://0”) and substituted camera = videoSource(‘/dev/video0’)

note sample code is shown below:

net = detectNet(“ssd-mobilenet-v2”, threshold=0.5)
camera = videoSource(“csi://0”) # ‘/dev/video0’ for V4L2
camera = videoSource(‘/dev/video0’)

#display = videoOutput(“display://0”) # ‘my_video.mp4’ for file
display = videoOutput(“rtsp://@:1234/camera”)# worked at office

The following errors were displayed:

[gstreamer] gstCamera – attempting to create device v4l2:///dev/video0

(python3:7332): GStreamer-CRITICAL **: 10:20:02.590: gst_element_message_full_with_details: assertion ‘GST_IS_ELEMENT (element)’ failed

(python3:7332): GStreamer-CRITICAL **: 10:20:02.591: gst_element_message_full_with_details: assertion ‘GST_IS_ELEMENT (element)’ failed
[gstreamer] gstCamera – found v4l2 device: HD Pro Webcam C920
[gstreamer] v4l2-proplist, device.path=(string)/dev/video1, udev-probed=(boolean)false, device.api=(string)v4l2, v4l2.device.driver=(string)uvcvideo, v4l2.device.card=(string)“HD\ Pro\ Webcam\ C920”, v4l2.device.bus_info=(string)usb-70090000.xusb-3.1, v4l2.device.version=(uint)264701, v4l2.device.capabilities=(uint)2216689665, v4l2.device.device_caps=(uint)69206017;
[gstreamer] gstCamera – could not find v4l2 device /dev/video0
[gstreamer] gstCamera – device discovery failed, but /dev/video0 exists
[gstreamer] support for compressed formats is disabled
[gstreamer] gstCamera – unsupported codec requested (unknown)
[gstreamer] supported decoder codecs are:
[gstreamer] * h264
[gstreamer] * h265
[gstreamer] * vp8
[gstreamer] * vp9
[gstreamer] * mpeg2
[gstreamer] * mpeg4
[gstreamer] * mjpeg
[gstreamer] gstCamera failed to build pipeline string
[gstreamer] gstCamera – failed to create device v4l2:///dev/video0
Traceback (most recent call last):
File “my_detection.py”, line 46, in
camera = videoSource(‘/dev/video0’)
Exception: jetson.utils – failed to create videoSource device

  1. What did I do wrong?
  2. Is it possible of executing inferencing programs (my-detection.py) using 2 cameras using two Pi cameras or one Pi and one webCam.

Thank you for your assistance

Warmly, Bob

Hi,

Could you double-check if the webcam is mounted on the /dev/video0?
Thanks.

run ls /dev/video* command form terminal session response indicated /dev/video0 and dev/video1

Thank is using /dev/video1 works

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