-1
import cv2

cap= cv2.VideoCapture(0)

while True:
    ret,frame= cap.read()
    cv2.imshow('Our live sketch',frame)

    if cv2.waitKey(1)==13:
        break

cap.release()

When I use cv2.VideoCapture(1), the programs shows error but the program works properly if I use cv2.VideoCapture(0)

DYZ
  • 55,249
  • 10
  • 64
  • 93

1 Answers1

2

That's the index of the camera it is used to select different cameras if you have more than one attached. By default 0 is your main one.

Pedro Maia
  • 2,666
  • 1
  • 5
  • 20