Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Cameratest.py: (does not function)
- import cv2
- print(cv2.__version__)
- width=1280
- height=720
- flip=2
- #camSet='nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM), width=1280, height=720, framerate=30/1,format=NV12 ! nvvidconv flip-method='+str(flip)+' ! video/x-raw, width='+str(width)+', height='+str(height)+', format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink'
- camSet='v4l2src device=/dev/video0 ! video/x-raw, width=1280, height=720, framerate=30/1,format=YUYV442 ! nvvidconv flip-method='+str(flip)+' ! video/x-raw, width='+str(width)+', height='+str(height)+', format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink'
- #camSet ='v4l2src device=/dev/video0 ! video/x-raw,width='+str(width)+',height='+str(height)+',framerate=30/1 ! videoconvert ! appsink'
- #camSet ='v4l2src device=/dev/video0 ! video/x-raw,width='+str(width)+',height='+str(height)+',framerate=30/1 ,format=YUY2 ! videoconvert ! appsink'
- #camSet = 'v4l2src device =dev ! image/jpeg, width=120, height=720 ! jpegparse ! jpegdec ! video/x-raw, format=I420 !appsink max-buffers=1 drop=true'
- cam=cv2.VideoCapture(camSet)
- while True:
- _, frame = cam.read()
- cv2.imshow('myCam',frame)
- cv2.moveWindow('myCam',0,0)
- if cv2.waitKey(1)==ord('q'):
- break
- cam.release()
- cv2.destroyAllWindows()
- 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 <module>
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement