# Identify camera by name

**URL:** <https://discourse.julialang.org/t/identify-camera-by-name/79830>\
**Category:** General Usage\
**Tags:** videoio, camera\
**Created:** [April 22, 2022, 10:50am UTC](https://discourse.julialang.org/t/identify-camera-by-name/79830 "2022-04-22T10:50:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [April 22, 2022, 10:50am UTC](https://discourse.julialang.org/t/identify-camera-by-name/79830/1 "2022-04-22T10:50:04Z")

</div>

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:

```julia
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`:

```julia
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`).

---

<div class="post-metadata">

**Author:** ![stemann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stemann/32/4030_2.png) [@stemann](https://discourse.julialang.org/u/stemann)\
**Post date:** [May 3, 2022, 10:16am UTC](https://discourse.julialang.org/t/identify-camera-by-name/79830/2 "2022-05-03T10:16:23Z")

</div>

I would suggest to elaborate a bit on the VideoIO camera/IO API: There should be an iterable type, e.g. `VideoIOCameraProvider`, which could return `VideoIOCamera`’s, and there should be functions similar to what has been done for [Teledyne FLIR/PointGrey Spinnaker cameras](https://github.com/samuelpowell/Spinnaker.jl/blob/master/src/CameraList.jl#L86) and [Basler Pylon cameras](https://github.com/IHPSystems/PylonCameras.jl/blob/master/src/PylonCameras.jl#L60) for getting camera vendor name, model name and serial number from a “VideoIOCamera”:

I would also suggest to put the definition of such functions in an interface package, e.g. [GitHub - IHPSystems/Cameras.jl: A Julia interface for cameras](https://github.com/IHPSystems/Cameras.jl) , such that VideoIO/LibAV camera provider and cameras are interchangeable with e.g. Basler cameras, PointGrey/FLIR cameras etc.

I am elaborating on Cameras.jl and PylonCameras.jl at the moment. Planning to add support for NVIDIA Jetson camera API (libargus), [GitHub - IHPSystems/argus\_julia\_wrapper](https://github.com/IHPSystems/argus_julia_wrapper), and Pleora eBUS SDK for [JAI cameras](https://www.jai.com/support-software/ubuntu-x86).
