(The pastebins include both the code and error messages.)
I’m trying to use this program (Cameratest.py: (does not function)import cv2print(cv2.__version__)width= - Pastebin.com) for V4l2src. This is done with a Jetson Xavier NX connected to an Orbbec Astra Embedded S which will be programmed in Python 3 and Kivy.
Error code:
/home/nyp/.virtualenvs/py3cv4/bin/python /home/nyp/.virtualenvs/py3cv4/untitled/cameratest.py
4.1.2
[ WARN:0] global /home/nyp/opencv/modules/videoio/src/cap_gstreamer.cpp (711) open OpenCV | GStreamer warning: Error opening bin: could not link v4l2src0 to nvvconv0, neither element can handle caps video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)30/1, format=(string)YUYV442
[ WARN:0] global /home/nyp/opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
[ERROR:0] global /home/nyp/opencv/modules/videoio/src/cap.cpp (116) open VIDEOIO(CV_IMAGES): raised OpenCV exception:
OpenCV(4.1.2) /home/nyp/opencv/modules/videoio/src/cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can’t find starting number (in the name of file): v4l2src device=/dev/video0 ! video/x-raw, width=1280, height=720, framerate=30/1,format=YUYV442 ! nvvidconv flip-method=2 ! video/x-raw, width=1280, height=720, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink in function ‘icvExtractPattern’
Traceback (most recent call last):
File “/home/nyp/.virtualenvs/py3cv4/untitled/cameratest.py”, line 14, in
cv2.imshow(‘myCam’,frame)
cv2.error: OpenCV(4.1.2) /home/nyp/opencv/modules/highgui/src/window.cpp:376: error: (-215:Assertion failed) size.width>0 && size.height>0 in function ‘imshow’
Process finished with exit code 1