Skip to content

Commit 6c92d89

Browse files
committed
fixed-issue-75
1 parent e43051f commit 6c92d89

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

face-try.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
# Start video capture
2828
cap = cv2.VideoCapture(0)
2929

30+
#check for external if built-in camera is not working
31+
if not cap.isOpened():
32+
print("[WARNING] Camera index 0 not available, trying index 1.....")
33+
cap.cv2.VideoCapture(1)
34+
3035
if not cap.isOpened():
3136
print("[ERROR] Cannot access webcam.")
3237
sys.exit(1)

0 commit comments

Comments
 (0)