The following code resolved this issue for me: video = cv2.VideoCapture(0,cv2.CAP_DSHOW)
Here is what the above code is Doing:
1. cv2.VideoCapture(0) – This is the default camera. If you have multiple cameras, you can change the value to 1, 2, 3, etc.
2. cv2.CAP_DSHOW – This is the flag that tells OpenCV to use DirectShow.