Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def get_available_cameras() -> Tuple[List[int], List[str]]:
indices: List[int] = []
names: List[str] = []
for i in range(10):
cap = cv2.VideoCapture(i)
cap = cv2.VideoCapture(f"/dev/video{i}")
if cap.isOpened():
indices.append(i)
names.append(f"Camera {i}")
Expand Down
3 changes: 2 additions & 1 deletion modules/video_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ def start(self, width: int = 960, height: int = 540, fps: int = 60) -> bool:
self.cap.release()
except Exception:
continue
elif platform.system() == "Linux":
self.cap = cv2.VideoCapture(f"/dev/video{self.device_index}")
else:
# Unix-like systems (Linux/Mac) capture method
self.cap = cv2.VideoCapture(self.device_index)

if not self.cap or not self.cap.isOpened():
Expand Down
Loading