So I am trying to use my Android phone as a webcam for image processing in Python using OpenCV. I have setup the client on my PC and am able to stream videos from my phone(via USB) without any problem. But the problem is that when I try to use this feed in my code, it gives me an error.
Here is what I am trying to execute.
import numpy as np
import cv2
cap = cv2.VideoCapture(0)
ret, frame = cap.read()
cap.release()
cv2.destroyAllWindows()
So in the above code I am getting the following error:
[ WARN:0] videoio(MSMF): can't grab frame. Error: -2147483638
When I tried to print 'ret' it printed 'False'. I don't know how to fix this error. Please note that I'm trying to stream via USB cable. Thank you.