# Capture cam fail / Video library issue

**URL:** https://discourse.processing.org/t/capture-cam-fail-video-library-issue/26506
**Category:** Libraries
**Created:** [December 25, 2020, 4:13am UTC](https://discourse.processing.org/t/capture-cam-fail-video-library-issue/26506 "2020-12-25T04:13:45Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![sprotz9](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@sprotz9](https://discourse.processing.org/u/sprotz9)
#### Post date: [December 25, 2020, 4:13am UTC](https://discourse.processing.org/t/capture-cam-fail-video-library-issue/26506/1 "2020-12-25T04:13:45Z")

</div>

live camera capture works maybe 1 out of every 20 times i click to run the sketch (see simple example code below). otherwise, the feed freezes on a gray screen with spinning wheel and the following error message in the console:

Could not find any devices  
Processing video library using GStreamer 1.16.2  
IllegalStateException: Could not find any devices  
IllegalStateException: Could not find any devices  
IllegalStateException: Could not find any devices  
IllegalStateException: Could not find any devices

processing 3.5.4 x64  
windows 10 x64  
camera works fine in other apps (e.g. Camera, Zoom), drivers are updated

```auto
import processing.video.*;

Capture cam;

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

void draw() {
  if (cam.available()) {
    cam.read();
  }
  image(cam, 0, 0);
}

```

---

<div class="post-metadata">

### Author: ![peripecio](https://avatars.discourse-cdn.com/v4/letter/p/d26b3c/32.png) [@peripecio](https://discourse.processing.org/u/peripecio)
#### Post date: [April 20, 2021, 11:07am UTC](https://discourse.processing.org/t/capture-cam-fail-video-library-issue/26506/2 "2021-04-20T11:07:37Z")

</div>

The same problem happens to me.

When I try to run some Capture examples these messages appear in the console:  
Processing video library using GStreamer 1.16.2  
There are no cameras available for capture.  
WARNING: no real random source present!

Windows 10  
Processing 3.5.4

---

<div class="post-metadata">

### Author: ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)
#### Post date: [April 20, 2021, 11:27am UTC](https://discourse.processing.org/t/capture-cam-fail-video-library-issue/26506/3 "2021-04-20T11:27:04Z")

</div>

Try [Processing can't find the camera - Video Libraries don't work - #13 by neilcsmith](https://discourse.processing.org/t/processing-cant-find-the-camera-video-libraries-dont-work/25128/13)

---

<div class="post-metadata">

### Author: ![peripecio](https://avatars.discourse-cdn.com/v4/letter/p/d26b3c/32.png) [@peripecio](https://discourse.processing.org/u/peripecio)
#### Post date: [April 20, 2021, 5:14pm UTC](https://discourse.processing.org/t/capture-cam-fail-video-library-issue/26506/4 "2021-04-20T17:14:44Z")

</div>

Hi neilcsmith:

That magic works for me!

cam = new Capture(this, “pipeline:autovideosrc”);

Thanks a lot.

---

<div class="post-metadata">

### Author: ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)
#### Post date: [April 17, 2023, 12:55am UTC](https://discourse.processing.org/t/capture-cam-fail-video-library-issue/26506/5 "2023-04-17T00:55:33Z")

</div>

@neilcsmith @peripecio

thank you It was helpful.

---

<div class="post-metadata">

### Author: ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)
#### Post date: [April 17, 2023, 1:04am UTC](https://discourse.processing.org/t/capture-cam-fail-video-library-issue/26506/6 "2023-04-17T01:04:36Z")

</div>

@neilcsmith @peripecio

1. It works well through ‘Processing Tool’.

2. However, ‘application export’ (ex. exe file) / does not work.

Any reason?

> surface.setTitle(“3”);  
> int tries = 0; int limit = 3;  
> while(tries \< limit){  
> try {  
> surface.setTitle(“4-1”);  
> delay(100); cam = new Capture(this, “pipeline:autovideosrc”); delay(100);  
> delay(100); cam.start();
> 
> ```
> } catch(Exception e){
> tries++;
> e.printStackTrace();
> continue;
> } 
> surface.setTitle("4-"+str(tries+1));
> break;
> 
> ```
> 
> }

why  
If I export it as an exe, will it not work?

cam = new Capture(this, “pipeline:autovideosrc”);  
It freezes when I use the ‘Capture’ function above.

1. Execute with ‘processing tool’: It works well.
2. Execute with ‘exe, export’: Does not work.

Do you know why? help.

 ![FF](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/0/2/023161edbfab8066de58a9a772ef77477c1b805d.jpeg)

---

<div class="post-metadata">

### Author: ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)
#### Post date: [April 17, 2023, 8:07am UTC](https://discourse.processing.org/t/capture-cam-fail-video-library-issue/26506/7 "2023-04-17T08:07:11Z")

</div>

> [@GWAK](#):
>
> why  
> If I export it as an exe, will it not work?
> 
> cam = new Capture(this, “pipeline:autovideosrc”);  
> It freezes when I use the ‘Capture’ function above.
> 
> 1. Execute with ‘processing tool’: It works well.
> 2. Execute with ‘exe, export’: Does not work.
> 
> Do you know why? help.

See this answer - [Exporting Sketch With Movie Is Blank - #5 by neilcsmith](https://discourse.processing.org/t/exporting-sketch-with-movie-is-blank/27983/5)

You need to move the GStreamer library around in the exported application as the Video library is looking in the wrong location due to a bug in Processing.

---

<div class="post-metadata">

### Author: ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)
#### Post date: [April 18, 2023, 2:55am UTC](https://discourse.processing.org/t/capture-cam-fail-video-library-issue/26506/8 "2023-04-18T02:55:19Z")

</div>

@neilcsmith

thank you. ~ ^^
