global cap_v4l.cpp:984 open VIDEOIO(V4L2): can't find camera device

65 Views Asked by At

I am using OpenCV for face recognition but while uploading on server pythonanywhere I encounter the error global cap_v4l.cpp:984 open VIDEOIO(V4L2): can't find camera device

def live_face_match():
    cap = cv2.VideoCapture(0)

    while True:
        ret, frame = cap.read()
        cv2.imshow('Camera Feed', frame)

        if cv2.waitKey(1) & 0xFF == ord('q'):
            break

    cap.release()
    cv2.destroyAllWindows()
1

There are 1 best solutions below

0
Glenn On

There is not camera device on the PythonAnywhere servers and, if there was, it would be showing you a video of the data-centre where the servers are housed.