I tried with video streaming with gst-launch code as following:
gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,framerate=25/1,width=640,height=480 ! xvimagesink -ev
I get perfect video streaming.
When i try to do it with a python code as following:
import numpy as np
import cv2
cap = cv2.VideoCapture(0)
cap.set(3,640)
cap.set(4,480)
cap.set(5,25)
cap.set(15, 0.1)
while(cap.isOpened()):
ret, frame = cap.read()
print frame
cv2.imshow(‘frame’,frame)
if cv2.waitKey(1) & 0xFF == ord(‘q’):
break
cap.release()
cv2.destroyAllWindows()
I get the following error:
HIGHGUI ERROR: V4L/V4L2: VIDIOC_CROPCAP
along with a very pixel distorted videostream.
What should I do?