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
timelapsed camera (Read 1176 times)
timelapsed camera
Jul 12th, 2005, 1:24pm
 
im a newbie to processing and i was wondering how you could make a timelapsed camera thing-a-mading - you know one that captures 2 frames every 15 minutes or so. filming things that grow for instance?
Re: timelapsed camera
Reply #1 - Jul 12th, 2005, 9:28pm
 
It would be fairly straightforward.  Have a timer in your processing sketch that triggers a saveFrame every 7.5 minutes (or whatever duration you want).  After you have all the frames, you can easily piece them together using something like Quicktime Pro.
Re: timelapsed camera
Reply #2 - Jul 13th, 2005, 3:07am
 
straight forward you say!
could you perhaps give me an example of how the code would look like
(like I said im totally new to this)
Re: timelapsed camera
Reply #3 - Jul 13th, 2005, 3:31am
 
try this.  havent tested with camera (left it at the office).

Code:

import processing.video.*;
Camera camera;

// how many seconds between each saveFrame
int timeDelay;

// total number of saved images
int imageCounter;

void setup(){
size(800,600,P2D);

// set the program to run at a framerate of once per second
framerate(1);

// new camera object, 800x600 resolution
camera = new Camera(this, 800, 600);

// 10 second delay between each saveFrame
timeDelay = 10;
}


void draw(){
if (second()%timeDelay == 0){
background(0);
camera.read();
image(camera, 0, 0);
saveFrame("screenGrabs/frames####.tif");

println("saving image " + imageCounter + " :: " + (imageCounter * timeDelay) + " seconds");
imageCounter ++;
}
}
Re: timelapsed camera
Reply #4 - Jul 13th, 2005, 2:29pm
 
i think it works!

so now the only thing i need to know is where does the images get saved?
can i specify a folder on my desktop where they all get send to?
Re: timelapsed camera
Reply #5 - Jul 13th, 2005, 3:02pm
 
Check the reference for 'saveFrame'.  Explains what you need right there.
Re: timelapsed camera
Reply #6 - Jul 13th, 2005, 5:47pm
 
thanks!
by the way your ripples thing looks sweet
love those gameboy synthz
Re: timelapsed camera
Reply #7 - Jul 13th, 2005, 5:54pm
 
oh, by the way, 'camera' should be 'capture', and 'Camera' should be 'Capture'.  I get those mixed up sometimes.
Re: timelapsed camera
Reply #8 - Jul 13th, 2005, 5:56pm
 
yeah I figured it out!
now to filming things that grow!
i guess  it should take about a week or so;-)
Re: timelapsed camera
Reply #9 - Aug 17th, 2005, 9:44am
 
Cool, remember to post the videoes here when they're done Smiley

-seltar
Re: timelapsed camera
Reply #10 - Feb 24th, 2006, 8:45pm
 
ive created a slightly modified version of the code here for a project, but im stuck.  what ive got:

Code:

import processing.video.*;
Capture camera;

// how many seconds between each saveFrame
int timeDelay;
// total number of saved images
int imageCounter;

void setup(){

size(320,240);


framerate(12);


camera = new Capture(this, 320, 240, 12);

// set timeDelay to zero initially
timeDelay = 0;
}


void draw(){
camera.read();
image(camera, 0, 0);
//println (timeDelay);
timeDelay = (timeDelay + 1); //just incrementing timeDelay because its
if (timeDelay == 75){ //the simplest timer i could come up with.
background(0);
camera.read();
image(camera, 0, 0);
saveFrame("screenGrabs/frames####.tif");
println("saving image " + imageCounter + " :: " + (imageCounter * timeDelay) + " seconds");
imageCounter ++;
timeDelay = 0; //resetting timeDelay to 0 for the next picture time.
}
}


so this is just a modified version of what flight404 had posted.  what i am stuck on is getting it to load the pictures its saving as background images for the movie.  so what would happen if this were all working as intended is that it would be capturing an image ~7 seconds and saving it to disc.  all the while a live stream is playing, adding a layer mask or alpha mask to create interesting blending effects between the video and still image.  i dont think i explained that very well.  any help would be appreciated.
Page Index Toggle Pages: 1