Using VideoIO.jl
, can I somehow get the “factory name” of the available cameras?
I’d like to be able to select a specific camera. This should work across all platforms (so I can’t make a USB rule or similar).
Here, I list the available functioning devices:
good_camera(device) = try
cam = opencamera(device)
read(cam)
close(cam)
return true
catch ex
return false
end
function list_cameras()
cameras = copy(VideoIO.CAMERA_DEVICES)
filter!(good_camera, cameras)
end
but I’d rather get similar data to when using v4l2-ctl --list-devices
:
shell> v4l2-ctl --list-devices
C270 HD WEBCAM (usb-0000:01:00.0-3):
/dev/video2
/dev/video3
/dev/media1
C922 Pro Stream Webcam (usb-0000:43:00.3-4):
/dev/video0
/dev/video1
/dev/media0
and be able to select, say, C270 HD WEBCAM
(which in this case is in /dev/video2
).