From 32700737fa2a0cfb5bfbe3de59f0c7c60ab2e595 Mon Sep 17 00:00:00 2001 From: Vadim Peretokin Date: Fri, 30 Jan 2026 13:33:14 +0100 Subject: [PATCH] Skip non-existent video devices in camera enumeration --- postured/pose_detector.py | 4 ++++ 1 file changed, 4 insertions(+) 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)