# List of cameras available but none accessible

**URL:** <https://discourse.processing.org/t/list-of-cameras-available-but-none-accessible/41721>\
**Category:** Libraries\
**Created:** [April 14, 2023, 12:34pm UTC](https://discourse.processing.org/t/list-of-cameras-available-but-none-accessible/41721 "2023-04-14T12:34:06Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [April 16, 2023, 1:11pm UTC](https://discourse.processing.org/t/list-of-cameras-available-but-none-accessible/41721/3 "2023-04-16T13:11:13Z")

</div>

Hello @loom,

> [@loom](#):
>
> ```auto
> if (cam.available() == true) {
> cam.read();
> }
> else {
> println("no cameras available"); 
> }
> 
> ```

See:

> **[available() / Libraries](https://processing.org/reference/libraries/video/Capture_available_.html)**
>
> Returns "true" when a new frame from the device is available to read.

The camera frame rate is slower than _draw()_ and your print statement will print when it is not available.

This print statement would better reflect the condition:  
` println("new frame from the device is NOT available to read.");`

This will help to visualize when a frame is not available and show a red background between updated cam frames:

```auto
void draw() 
  {
  background(255, 0, 0); // Try with and without this line
  if (cam.available() == true) 
    {
    cam.read();
    image(cam, 0, 0, width, height); // Try with this here or below
    }
  //image(cam, 0, 0, width, height); // Try with this here or below 
  }

```

Keep in mind that image() is displaying the last frame that was captured and only updated when a new one is available.

This may be of interest:

> **[captureEvent() / Libraries](https://processing.org/reference/libraries/video/captureEvent_.html)**
>
> This event function is run when a new camera frame is available. Use the read() method to capture this frame. If there is more than one capture device in the program, captureEvent() is c…

Another related topic:

> [@Processing can't find the camera - Video Libraries don't work](https://discourse.processing.org/t/processing-cant-find-the-camera-video-libraries-dont-work/25128/13):
>
> I think you want to try removing all the capture list stuff and just use - cam = new Capture(this, "pipeline:autovideosrc");

It helps to resolve problems if you share which Processing version, Video library and operating system you are using.

I am using:

- Processing 4.2
- Video Library for Processing 2.2.2
- Windows 10

This shows up in the console with your code (else printl() removed):

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/1/b/1b8083df17294326d01c37b10f3d790780899cca.png)

`:)`

---

_[View the full topic](https://discourse.processing.org/t/list-of-cameras-available-but-none-accessible/41721)._
