Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Draw video capture over movie background (nee

Help
Anonymous
2012-01-12
2012-12-26

  • Anonymous
    2012-01-12

    Hi there!

    I'm trying to draw a video capture over a video background but i can't play both at the same time… i'm a kind of new to programing so forgive me for these newbe questions..

    here's the code i've got so far:

    import codeanticode.gsvideo.*;

    GSMovie movie;
    GSCapture video;

    void setup() {
      size(640, 480);
     
      //start video capture
      video = new GSCapture(this, 320, 240);
      video.start();
      loadPixels();
     
      // Load and play the video in a loop
      movie = new GSMovie(this, "station.mov");
      movie.loop();
    }

    void movieEvent(GSMovie movie) {
      movie.read();
    }

    void draw() {
      //draw movie
      image(movie, 0, 0, width, height);

      //draw video capture 
      if (video.available()) {
        video.read();   
        video.loadPixels();

        for (int x=0;x<320;x++) {                   
          for (int y=0;y<240;y++) {

            int image_pos=(y*width)+x;
            int video_pos=(video.width - x - 1) + y*video.width;

            pixels = video.pixels;
          }
        }
      }
      updatePixels();
    }

    if someone could help me or tell me what i'm doing wrong i'll be very grateful, i'm stuck with these for some days..
    Cheers..
    João

     
  • Diego Alberti
    Diego Alberti
    2012-01-12

    mmm..
    but what is the problem you have?