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.
Page Index Toggle Pages: 1
framingham with movies (Read 366 times)
framingham with movies
Nov 26th, 2007, 1:18pm
 
hi there,

new to video with processing.

Trying to start something by having the example Framingham reading a .mov rather than capturing a video.
What I get now is just the black background, if I add image(myMovie, myMovie.width, myMovie.height) I get the .mov to load in the screen, but no framing occurs.

Rather than a working code I would like to understand why myMovie.read is not enough to launch the video (while video.read is)

[apologies for the banality of the question]

here's the code:


import processing.video.*;

Movie myMovie;
int column;
int columnCount;
int lastRow;

// Buffer used to move all the pixels up
int[] scoot;


void setup() {
 size(240, 180, P3D);

 // Uses the default video input, see the reference if this causes an error
  myMovie = new Movie(this, "station.mov");
 // Also try with other video sizes
 
 column = 0;
 columnCount = width / myMovie.width;
 int rowCount = height / myMovie.height;
 lastRow = rowCount - 1;
 
 scoot = new int[lastRow*myMovie.height * width];
 background(0);
}


void draw() {
 // By using video.available, only the frame rate need be set inside setup()
    if (myMovie.available())
     myMovie.read();
   
   set(myMovie.width*column, myMovie.height*lastRow, myMovie);
   column++;
   if (column == columnCount) {
     loadPixels();
       
     // Scoot everybody up one row
     arraycopy(pixels, myMovie.height*width, scoot, 0, scoot.length);
     arraycopy(scoot, 0, pixels, 0, scoot.length);

     // Set the moved row to black
     for (int i = scoot.length; i < width*height; i++) {
       pixels[i] = #000000;
     }
     column = 0;
     updatePixels();
   }
 }

Page Index Toggle Pages: 1