Bug 1454 : openGL with video capture gives OutOfMemoryError
Last modified: 2010-02-03 04:53




Status:
RESOLVED
Resolution:
WONTFIX -
Priority:
P2
Severity:
normal

 

Reporter:
suhdongsoo
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2010-02-03 02:54
I need to analyze camera input and I also need openGL rendering.

So I did the below, and it works for about 30 seconds, and then crashes giving
"OutOfMemoryError".

It says I may need to increase memory in the preference, but it's already 1512MB.

I know from this forum that openGL and capture can cause problems when they're together,
but people say putting Capture.list() before size(), or showing in present mode will cure the
problem. I could see those actions correct the situation from 'doesn't work at all' to 'works for
short period', but it seems this kind of memory error has not been mentioned.

My system is a very strong new one with Windows 7(32bit), and the processing is 1.0.9.
So I believe it has enough memory to do this, because it's just a 320*240 video.


import processing.opengl.*;
import processing.video.*;

Capture cam;

int vWidth=320;
int vHeight=240;

void setup() {
size(vWidth,vHeight,OPENGL);
cam=new Capture(this,vWidth,vHeight,Capture.list()[1],15);
}

void draw() {
image(cam,0,0);
}

void captureEvent(Capture myCapture) {
myCapture.read();
}
Additional Comment #1 From fry 2010-02-03 04:53
we'll soon be replacing the video library with a version of andres
colubri's gsvideo. i recommend switching to that (along with his glgraphics
library) to do opengl and video work. it'll be significantly faster and
that's where processing is headed as well.