Closed the-xperimentalist closed 6 years ago
Hi @prasoonmayank, could you please tell which versions of Python and OpenCV are you using?
I am using python 2.7 and opencv 3.4.3 Although, now it has suddenly started working. But I am getting a completely blank frame output.
@prasoonmayank the program assumes that the computer where the program is running is equipped with a webcam. Is this the case?
If it is, it will be useful to check that OpenCV is able to read frames from it. Try to execute the following script to check it:
import cv2
cap = cv2.VideoCapture(0)
while(True):
ret, frame = cap.read()
rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2BGRA)
cv2.imshow('frame', rgb)
if cv2.waitKey(1) & 0xFF == ord('q'):
out = cv2.imwrite('capture.jpg', frame)
break
cap.release()
cv2.destroyAllWindows()
@prasoonmayank closing for inactivity. Will re-open if required.
I am getting the error - Unable to capture video. Although, I have the opencv built with FFMPEG support as I checked my opencv build info. Will be great if you could help