I am trying to figure out how to only capture a frame to a movie every x.x seconds. Right now, the specific thing I am trying to do is to capture 1 frame every 2/3 of a second. I want the created file to be 30 fps, so that what I end up with is a fast playback of a slow event.
So far everything I have tried with delays or time just locks up processing (or at least apparently does, I'm new). Changing the fps in the new MovieMaker tag just plays back the movie slower, so this I'd want this set to 30. What's the way to do this?
The code below is what I've been starting with, but it doesn't really have to be based on that. This is just a merge of a couple o the example scripts.
Thanks in advance, Ian
Quote:/**
* Getting Started with Capture.
*
* Reading and displaying an image from an attached Capture device.
*/
import processing.video.*;
Capture cam;
MovieMaker mm;
void setup() {
size(640, 480);
// If no device is specified, will just use the default.
cam = new Capture(this, 640, 480);
// To use another device (i.e. if the default device causes an error),
// list all available capture devices to the console to find your camera.
//String[] devices = Capture.list();
//println(devices);
// Change devices[0] to the proper index for your camera.
//cam = new Capture(this, width, height, devices[0]);
// Opens the settings page for this capture device.
//camera.settings();
mm = new MovieMaker(this, width, height, "vhs_lapse.mov", 30, MovieMaker.JPEG, MovieMaker.BEST);
background(0, 0, 0);
}
void draw() {
if (cam.available() == true) {
cam.read();
image(cam, 0, 0);
// The following does the same, and is faster when just drawing the image
// without any additional resizing, transformations, or tint.
//set(160, 100, cam);
mm.addFrame();
if (key == ' ') {
// Finish the movie if space bar is pressed
mm.finish();
// Quit running the sketch once the file is written
exit();
}
}
}