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.
IndexProgramming Questions & HelpVideo Capture,  Movie Playback,  Vision Libraries › recording one movie while playing another
Page Index Toggle Pages: 1
recording one movie while playing another (Read 331 times)
recording one movie while playing another
Apr 2nd, 2008, 10:23am
 
hi guys

i'm trying to make a program wich records a movie from a webcam into one file, then plays that file on half the screen (the other half is still the webcam) while recording a movie to a second file. and so on.
now i've got a nullpointer exception which i don't know where it's coming from and before i had problems with the movie files...

can someone help me, or give me a clew?


int counter=0;
int l=0;
import processing.video.*;
int i=0;
MovieMaker[] mm;
Movie movie0;
Capture cam;
String[] n;

void setup() {
 size(320, 240);
 mm=new MovieMaker[10];
 String[] n={"1.mov","2.mov","3.mov","4.mov","5.mov","6.mov","7.mov","8.mov","9.mov","10.m
ov"};

 for(int i=0;i<=9;i++){
   mm[i] = new MovieMaker(this, width, height, n[i],30,MovieMaker.JPEG, MovieMaker.HIGH);
  }

 cam = new Capture(this,width,height);
 background(204);
}

void mousePressed(){
 mm[counter].finish();
 counter=counter+1;
 movie0=new Movie(this,n[counter]);
 if(counter==10){
   counter=0;
  }
}

void draw() {

 cam.read();
 image(cam,0,0,width,height);
 mm[counter].addFrame();
 
 if(counter>0){
   image(movie0,0,0,width,height);
  }
}

void movieEvent(Movie movie0){
  movie0.read();
}

 
Page Index Toggle Pages: 1