# Webcam Recording and Save - gray screen

**URL:** <https://discourse.processing.org/t/webcam-recording-and-save-gray-screen/42712>\
**Category:** Libraries\
**Created:** [September 7, 2023, 12:13pm UTC](https://discourse.processing.org/t/webcam-recording-and-save-gray-screen/42712 "2023-09-07T12:13:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fsdonato](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/fsdonato/32/18621_2.png) [@fsdonato](https://discourse.processing.org/u/fsdonato)\
**Post date:** [September 7, 2023, 12:13pm UTC](https://discourse.processing.org/t/webcam-recording-and-save-gray-screen/42712/1 "2023-09-07T12:13:22Z")

</div>

I am learning to use the “processing.video” library. At first I managed to communicate with Webcam and export the application. In addition I had to create a “Windows64” folder inside the “LIB” folder and put the GStreamer files inside. The application code working is below:

```auto
import processing.video.*;
Capture cam;
void setup() {
  size(640, 480);
  String[] cameras = Capture.list();
  if (cameras.length == 0) {
    println("Não há câmeras disponíveis para captura.");
    exit();
    } 
    else {
    println("Câmeras disponíveis:");
    for (int i = 0; i < cameras.length; i++) {
      println(cameras[i]);
      }
    cam = new Capture(this, 600, 400);
    cam.start();     
    }      
}
void draw() {
  if (cam.available() == true) {
    cam.read();
  }
  image(cam, 0, 0);
}

```

In a second moment I am learning to use the “com.hamoid” library. In Sketch my code guide perfectly, I can watch the webcam and record videos with FFMPEG. But when exporting the application and creating the “Windows64” folder, I’m unable to view the webcam. It is just a gray screen. I am using Windows 10 and Processing 4.3. The code is below:

```auto
import processing.video.*; 
import com.hamoid.*; 
VideoExport videoExport;
Capture cam;
boolean gravando = false;
void setup() {
  size(640, 480);
  frameRate(30);
  String[] cameras = Capture.list();
  cam = new Capture(this, cameras[0]);
  videoExport = new VideoExport(this, "Interativo.mp4");
  cam.start(); 
  videoExport.startMovie();
  println("Pressione r para alternar a gravação");
}
void draw() {  
  if (cam.available() == true) {
    cam.read();
  }
  image(cam, 0, 0);
  if(gravando) {
    videoExport.saveFrame();
  }
}
void keyPressed() {
  if(key == 'r' || key == 'R') {
    gravando =! gravando;
    println("Gravação está: " + (gravando ? "LIGADA" : "DESLIGADA"));
  }
  if (key == 'q') {
    videoExport.endMovie();
    exit();
  }
}

```

Any suggestions where the problem may be?

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

 ![2](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/1/4/14fc933505d65ff408de1a61c5c4cb289054b857.jpeg)

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [September 7, 2023, 2:37pm UTC](https://discourse.processing.org/t/webcam-recording-and-save-gray-screen/42712/2 "2023-09-07T14:37:22Z")

</div>

> [@fsdonato](#):
>
> But when exporting the application and creating the “Windows64” folder, I’m unable to view the webcam. It is just a gray screen.

Hi

Once I face similar issue I think it’s folder path issue try something like this

```auto
videoExport = new VideoExport(this, "/something/like/this.mp4");

```

---

<div class="post-metadata">

**Author:** ![fsdonato](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/fsdonato/32/18621_2.png) [@fsdonato](https://discourse.processing.org/u/fsdonato)\
**Post date:** [September 7, 2023, 8:28pm UTC](https://discourse.processing.org/t/webcam-recording-and-save-gray-screen/42712/3 "2023-09-07T20:28:08Z")

</div>

I tried, but did not solve.  
I used `VideoExport = New VideoExport (this, "/data/interactive.mp4");`  
In Sketch when running the video is saved in a Data folder.  
I exported the application to run with 2 clicks, but I still got the same screen in gray. And the “R Record” and “Q Quit” commands do not work.
