I was using my cam through opencv and suddenly after restarting I ran my code it shows below error:
[ WARN:0] global /io/opencv/modules/videoio/src/cap_v4l.c
I got the same error. Try changing 0 to -1
cap = cv2.VideoCapture(-1)
This solved the issue.