diff --git a/postured/pose_detector.py b/postured/pose_detector.py index 314eae0..7c39da2 100644 --- a/postured/pose_detector.py +++ b/postured/pose_detector.py @@ -205,6 +205,10 @@ def available_cameras() -> list[tuple[int, str]]: for i in range(10): device = f"/dev/video{i}" + # Skip if device doesn't exist + if not os.path.exists(device): + continue + sysfs_device = f"/sys/class/video4linux/video{i}/device" if os.path.islink(sysfs_device): physical_device = os.path.realpath(sysfs_device)