Using cv2 in Python. Version 4.1.1.
ls -ltrh /dev/video*
lists:
crw-rw----+ 1 root video 81, 1 Mar 12 14:19 /dev/video1
crw-rw----+ 1 root video 81, 2 Mar 12 14:19 /dev/video2
When I try:
cap = cv2.VideoCapture(1)
I get:
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (933) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
Also cv2.VideoCapture("/dev/video1")
results in
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (1757) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module source reported: Could not read from resource.
Doing the exact same with the same webcam on my x86 rig works fine without warning. I can’t seem to pull frames from my webcam at all on the Jetson Nano. If I open Ubuntu’s “Cheese Webcam Booth” software, I can see the video stream working properly.
Any ideas? Are there any dependencies I’m overlooking?
Edit:
gst-launch-1.0 -v v4l2src device=/dev/video1 --gst-debug-level=2
gives me:
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)800, height=(int)600, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)15/1, colorimetry=(string)bt709, interlace-mode=(string)progressive
0:00:00.161727559 11483 0x5581712ca0 WARN v4l2bufferpool gstv4l2bufferpool.c:790:gst_v4l2_buffer_pool_start:<v4l2src0:pool:src> Uncertain or not enough buffers, enabling copy threshold
0:00:00.983176348 11483 0x5581712ca0 WARN basesrc gstbasesrc.c:3055:gst_base_src_loop:<v4l2src0> error: Internal data stream error.
0:00:00.983219215 11483 0x5581712ca0 WARN basesrc gstbasesrc.c:3055:gst_base_src_loop:<v4l2src0> error: streaming stopped, reason not-linked (-1)
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-linked (-1)
Execution ended after 0:00:00.858706121