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.
IndexProgramming Questions & HelpVideo Capture,  Movie Playback,  Vision Libraries › Saving movies one after the other & incrementa
Page Index Toggle Pages: 1
Saving movies one after the other & incrementa (Read 275 times)
Saving movies one after the other & incrementa
Feb 4th, 2009, 3:15pm
 
Hi !

I am working on an arduino/processing project, and I need to capture movies one after the other.

Here is a bit of code (not working because of: nomvideo = "video"+i".mov";) ...



import processing.video.*;
Capture myCapture;
MovieMaker video; // Declare MovieMaker object
int i;
String nomvideo;

void setup() {

i=0;
size(500, 400);
frameRate(10);
nomvideo = "video"+i".mov";
video = new MovieMaker(this, width, height, nomvideo,
10, MovieMaker.VIDEO, MovieMaker.MEDIUM);
myCapture = new Capture(this, width, height, 30);

}
(...)



As you can see, what I wish to do is being able to capture a first video called "video0", then, a second one called "video1", etc. by incrementing the name by 1 everytime a new video is being captured.

If you have any suggestions, that would be great!!

Thanks for your help,

Jofrenchies
Re: Saving movies one after the other & increm
Reply #1 - Feb 16th, 2009, 12:15pm
 
Hi!

I am not shure on what you want to do but a simple solution to increment is to use the "++" function.

ex:

int i = 0;

void draw()
{
  println(i);
  i++;
}

This will output 0,1,2,3...n...n+1...etc! Always incrementing by one unit, however, if You desire to increment with a given interval You can always use "i+=interval"; as the following example:

int i = 0;

void draw()
{
  println(i);
  i+=2;
}

Which will output 0,2,4,6...n...n+2...etc!

Hope it was usefull!
Page Index Toggle Pages: 1