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
read lot of video  Question (Read 629 times)
read lot of video  Question
Mar 13th, 2008, 5:17am
 
hi
i have a question,please everybady can help me.
i need play lot of small video,one by one,when i call 1,2,3,4,or 5 video.

so,i put "myMovie[i] = new Movie(this, "i.mov");" into void setup(), but i put lot of,so i seem processing need
to big read they,and make processing to bug,i think processing not to bear.

please talk me,what am i going to do,thanks.
Re: read lot of video  Question
Reply #1 - Mar 13th, 2008, 1:08pm
 
Simple.

how many movies? if it's too many, yes, processing may slow down drastically because of IO overhead... (?)

Code:

import java.util.*;
ArrayList movies = new ArrayList();
public void setup(){
for(int i = 0; i < 10; i++){
movies.add(new Movie(this, i+".mov")); //!!! i+".mov"
}
Movie second = (Movie)movies.get(2);
}
Re: read lot of video  Question
Reply #2 - Mar 13th, 2008, 3:01pm
 
thank for you.
but,i am sorry,i don't very understand.
can i use "import processing.video.*" to displace
"import java.util.*" ??

if i have 3 vedio,i should write:
myMovie1 = (Movie)movies.get(1);
myMovie2 = (Movie)movies.get(2);
myMovie3 = (Movie)movies.get(3);

or not?
i post a try to write code,please help me to see,thank.


//import java.util.*;
import processing.video.*;
Movie myMovie1,myMovie2,myMovie3;
ArrayList movies = new ArrayList();

public void setup(){
 size(640,480);
 frameRate(8);
 for(int i = 0; i < 10; i++){
movies.add(new Movie(this, i+".mov")); //!!! i+".mov"
 }
 myMovie1 = (Movie)movies.get(1);
 myMovie2 = (Movie)movies.get(2);
 myMovie3 = (Movie)movies.get(3);
}

void draw() {
 background(255);
 if(myMovie1.available()) {
   myMovie1.read();
 }
 myMovie1.loop();
 image(myMovie1, 0, 0);
}


Page Index Toggle Pages: 1