We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentLibraries,  Tool Development › problem with video capture and oscP5 ...
Page Index Toggle Pages: 1
problem with video capture and oscP5 ... (Read 837 times)
problem with video capture and oscP5 ...
Sep 17th, 2007, 2:38pm
 
hello everybody,

i tried to integrate oscP5 into my video program and suddenly nothing happened anymore. the window stayed grey and there's no error message.
somebody know what is the problem?


______code___________________

import processing.video.*;  

import oscP5.*;
import netP5.*;

OscP5 oscP5;
NetAddress myRemoteLocation;
 
Capture cam;  

PImage img;  
boolean newFrame=true;  
 
// ==================================================  
// setup()  
// ==================================================  
void setup()  
{  
// Size of applet  
size(640, 480);  

    oscP5 = new OscP5(this,12000);
    myRemoteLocation = new NetAddress("127.0.0.1",12000);


cam = new Capture(this, 40*4, 30*4, 15);  
img = new PImage(80,60);  
       
}  
 
// ==================================================  
// captureEvent()  
// ==================================================  
void captureEvent(Capture cam)  
{  
cam.read();  
newFrame = true;  
}  

// ==================================================  
// draw()  
// ==================================================  
void draw()  
{  

if (newFrame)  
{  
newFrame=false;  
     background(255);
     fill(255,255,255,150);
     rect (0,0,width,height);
}  
}  
Re: problem with video capture and oscP5 ...
Reply #1 - Sep 17th, 2007, 3:49pm
 
initialize the cam before initializing oscP5, works  for me.

Code:

void setup()
{
// Size of applet
size(640, 480);
cam = new Capture(this, 40*4, 30*4, 15);
oscP5 = new OscP5(this,12000);
myRemoteLocation = new NetAddress("127.0.0.1",12000);
img = new PImage(80,60);
}


best,
andi
Re: problem with video capture and oscP5 ...
Reply #2 - Sep 17th, 2007, 5:29pm
 
thanks a lot for the tip and also for the library ...
now it works.
Page Index Toggle Pages: 1