Skip to content

Commit

Permalink
Merge pull request #14 from occ-ai/roy.fix_linux_device_enum
Browse files Browse the repository at this point in the history
chore: Refactor get_camera_info_linux() to use glob for device enumer…
  • Loading branch information
royshil authored Jun 30, 2024
2 parents 7e0153b + a10f55b commit b059c44
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion get_camera_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ def get_camera_info_mac():

def get_camera_info_linux():
# Basic method using /dev/video* enumeration
import glob

device_info = glob.glob("/dev/video*")
device_info = [
CameraInfo(f"Camera {i}", f"/dev/{dev}", i, CameraInfo.CameraType.OPENCV)
CameraInfo(f"Camera {i}", dev, i, CameraInfo.CameraType.OPENCV)
for i, dev in enumerate(device_info)
]
return device_info
Expand Down

0 comments on commit b059c44

Please sign in to comment.