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
using still frames from video (Read 745 times)
using still frames from video
Jan 27th, 2010, 11:31pm
 
Hello everybody,
I'm pretty new with processing and looking for a solution to print still images from a video as an array (similar to mosaic) I tried with the following code but I don't understand when using the image() code why it is still a video.
For example if I paint it with the mouse the video is "frozen" as still images, but in this case it is still showing the video.
can anybody explain that?

Quote:
import processing.video.*;
int frameWidth = 640;
int frameHeight = 480;
int numPixels;
int blockSize = 40;
Movie myMovie;

void setup() {
  size(frameWidth,frameHeight,P3D);
  noStroke();
  background(0);
  myMovie = new Movie(this, "newyear.mov");
  myMovie.loop();
  numPixels = width / blockSize;
}
void movieEvent(Movie myMovie) {
  myMovie.read();
}
void draw() {
  for (int j = 0; j < numPixels;j++) {
    for (int i = 0; i < numPixels; i++){
      image(myMovie,i*blockSize, j*blockSize, blockSize, blockSize);
    }
  }
}

That is the code I was trying out...
Thank you in advance....













Re: using still frames from video
Reply #1 - Feb 7th, 2010, 6:24am
 
I'm still working on it Lips Sealed
I figured out how to use the
myMovie.jump(q * myMovie.duration()); function to define the position in the movie that I want to load, but it doesn't seem precise enough.
can I address exactely frame X this way (by float number)? does anybody know about these problems. In my case sometime frame x or frame x+1 or frame x-1 was loaded ????
or is there another way to load one specific frame x in a movie?
Page Index Toggle Pages: 1