Required noob preface: Hi, I'm new to Processing, and I can't figure out how to fix this problem.
I'm trying to capture the input from a webcam, and then playback the recording while continuing to capture input from the webcam, and all I'm getting for the video playback is black.
Thanks for your help!
I'm trying to capture the input from a webcam, and then playback the recording while continuing to capture input from the webcam, and all I'm getting for the video playback is black.
Thanks for your help!
- import processing.video.*;
Capture reader;
MovieMaker writer;
Movie viewer;
char w = 'w';
int v = 0;
int counter = 0;
void setup() {
size( 320, 240, P2D );
reader = new Capture( this, width, height, 30 );
writer = new MovieMaker( this, width, height, "data/" + w + v + ".mov", 30,
MovieMaker.H263, MovieMaker.WORST );
viewer = new Movie( this, "whitespace.mov" );
viewer.loop();
background( 255 );
}
void captureEvent( Capture reader ) {
reader.read();
}
void movieEvent( Movie m ) {
m.read();
}
void draw() {
image( reader, 0, 0, width/2, height/2 );
image( viewer, width/2, height/2, width, height );
println( counter );
counter++;
writer.addFrame();
if ( counter > 300 ) {
writer.finish();
}
if ( counter > 400 ) {
viewer = new Movie( this, w + v + ".mov" );
}
}
1