# Processing with pi4

**URL:** <https://discourse.processing.org/t/processing-with-pi4/14617>\
**Category:** Processing for Pi\
**Created:** [October 11, 2019, 6:07pm UTC](https://discourse.processing.org/t/processing-with-pi4/14617 "2019-10-11T18:07:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![maddyna](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@maddyna](https://discourse.processing.org/u/maddyna)\
**Post date:** [October 11, 2019, 6:07pm UTC](https://discourse.processing.org/t/processing-with-pi4/14617/1 "2019-10-11T18:07:36Z")

</div>

I am trying to use raspberrypi 4 model with processing  
I am using the GLvideo library to capture live footage using a v2 camera module of raspberry pi.  
While trying to run the sample code I am not being able to get the video I am always getting a black blank window  
please help  
my code is:

```auto
import gohai.glvideo.*;
GLCapture video;

void setup() {
  size(320, 240, P2D);

  String[] devices = GLCapture.list();
  println("Devices:");
  printArray(devices);
  if (0 < devices.length) {
    String[] configs = GLCapture.configs(devices[0]);
    println("Configs:");
    printArray(configs);
  }

  // this will use the first recognized camera by default
  video = new GLCapture(this);

  // you could be more specific also, e.g.
  //video = new GLCapture(this, devices[0]);
  //video = new GLCapture(this, devices[0], 640, 480, 25);
  //video = new GLCapture(this, devices[0], configs[0]);

  video.start();
}

void draw() {
  background(0);
  if (video.available()) {
    video.read();
  }
  image(video, 0, 0, width, height);
}

```

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [October 11, 2019, 7:29pm UTC](https://discourse.processing.org/t/processing-with-pi4/14617/2 "2019-10-11T19:29:21Z")

</div>

please format your code with pasting into  
`</> Preformatted text` button from editor menu

---

<div class="post-metadata">

**Author:** ![maddyna](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@maddyna](https://discourse.processing.org/u/maddyna)\
**Post date:** [October 12, 2019, 12:35am UTC](https://discourse.processing.org/t/processing-with-pi4/14617/3 "2019-10-12T00:35:42Z")

</div>

problems with aspberry pi 4 and camera v2 model

```auto
import gohai.glvideo.*;
GLCapture video;

void setup() {
size(320, 240, P2D);

String[] devices = GLCapture.list();
println(“Devices:”);
printArray(devices);
if (0 < devices.length) {
String[] configs = GLCapture.configs(devices[0]);
println(“Configs:”);
printArray(configs);
}

// this will use the first recognized camera by default
video = new GLCapture(this);

// you could be more specific also, e.g.
//video = new GLCapture(this, devices[0]);
//video = new GLCapture(this, devices[0], 640, 480, 25);
//video = new GLCapture(this, devices[0], configs[0]);

video.start();
}

void draw() {
background(0);
if (video.available()) {
video.read();
}
image(video, 0, 0, width, height);
}

```

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [October 12, 2019, 1:27am UTC](https://discourse.processing.org/t/processing-with-pi4/14617/4 "2019-10-12T01:27:34Z")

</div>

-a- you should have repaired your top post  
-b- and you should have pasted good formated code into the  
`</>`  
NOT  
`"`  
button

so try again edit the first one and delete the last one

* * *

i try here the  
SimpleCapture example from the library and it works.

 ![RPI_camera_simplecaptureexample](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/ab898692441b5ba9578db1b09bdef721aa0df747.png)

BUT  
-a- i use  
Raspbian GNU/Linux 10  
DEBIAN buster  
Linux version 4.19.75-v7+  
Raspberry Pi 3 Model B Plus Rev 1.3

-b- Processing 3.5.3

-c- raspberry pi camera rev 1.3 only  
and enabled the camera in `sudo raspi-config`

?when you start the sketch, you get a device list?

-d- GL Video 1.3 Gottfried Haider Hardware accelerated video on the Raspberry Pi & Linux  
but with a own compiled add on so not only camera  
now also video works.
