# Processing can't find built in camera

**URL:** <https://discourse.processing.org/t/processing-cant-find-built-in-camera/27544>\
**Category:** Libraries\
**Created:** [February 2, 2021, 2:46pm UTC](https://discourse.processing.org/t/processing-cant-find-built-in-camera/27544 "2021-02-02T14:46:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ELaN](https://avatars.discourse-cdn.com/v4/letter/e/3e96dc/32.png) [@ELaN](https://discourse.processing.org/u/ELaN)\
**Post date:** [February 2, 2021, 2:46pm UTC](https://discourse.processing.org/t/processing-cant-find-built-in-camera/27544/1 "2021-02-02T14:46:19Z")

</div>

I’ve written the following code

\<import processing.video.\*;  
//PImage unicorn;  
Capture unicorn;

void setup(){  
size(640,480);  
unicorn=new Capture (this,640,480);  
unicorn.start();  
background(0);  
}

void captureEvent(Capture video){  
video.read();  
}  
void draw(){  
for(int i=0; i\<100; i++){  
float x=random(width);  
float y=random(height);  
color c=unicorn.get(int(x),int(y));  
fill©;  
noStroke();  
ellipse(x,y,16,16);  
}  
}\>

And I get error ‘‘IllegalStateException: Could not find any devices  
IllegalStateException: Could not find any devices  
IllegalStateException: Could not find any devices  
IllegalStateException: Could not find any devices’’

---

<div class="post-metadata">

**Author:** ![r.jaoui](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/r.jaoui/32/11777_2.png) [@r.jaoui](https://discourse.processing.org/u/r.jaoui)\
**Post date:** [February 2, 2021, 6:48pm UTC](https://discourse.processing.org/t/processing-cant-find-built-in-camera/27544/2 "2021-02-02T18:48:08Z")

</div>

Hello !

First, don’t hesitate to format your code using the `</>` button when writing a message.

Secondly, try running this code (that should tell you available video devices). What is written in console ?

```auto
import processing.video.*;

void setup() {
  size(1280, 720);

  String[] cameras = Capture.list();

  if (cameras.length == 0) {
    println("There are no cameras available for capture.");
    exit();
  }
  else {
    println("Available cameras:");
    for (int i = 0; i < cameras.length; i++) println(cameras[i]);
  }
}

```

---

<div class="post-metadata">

**Author:** ![ELaN](https://avatars.discourse-cdn.com/v4/letter/e/3e96dc/32.png) [@ELaN](https://discourse.processing.org/u/ELaN)\
**Post date:** [February 3, 2021, 6:41am UTC](https://discourse.processing.org/t/processing-cant-find-built-in-camera/27544/3 "2021-02-03T06:41:31Z")

</div>

I ran the code you sent me and I get the ‘‘There are no cameras available for capture.’’. But I don’t understand why cause I have a built in web cam on my laptop.
