coldarchon
YaBB Newbies
Offline
Posts: 13
how to start capture after video?
Nov 24th , 2008, 9:08pm
ok, I want to play a video and THEN start a capture. but with my code the cam starts immediately and the shown window is just grey. by uncommenting the capture I can see the video. how do I separate the video and the capture? the code should start video1, then show capture1, start video2, then show capture2 and at last show video3: import processing.video.*; Movie Video1, Video2, Video3; Capture Capture1, Capture2; void setup() { size(200, 200); Video1 = new Movie(this, "Video1.mov"); Capture1 = new Capture(this, width, height, 30); Video2 = new Movie(this, "Video2.mov"); Capture2 = new Capture(this, width, height, 30); Video3 = new Movie(this, "Video3.mov"); Video1.play(); float md1 = Video1.duration(); float mt1 = Video1.time(); if(mt1 == md1) {float m1 = millis(); Capture1.read(); if (Capture1.available()){ image(Capture1, 0, 0);} float t1 = m1 + 5.0; while (m1 < t1) { m1 = millis();} if (m1 >= t1) {Video2.play(); float md2 = Video2.duration(); float mt2 = Video2.time(); if(mt2 == md2) {float m2 = millis(); Capture2.read(); if (Capture2.available()){ image(Capture2, 0, 0);} float t2 = m2 + 5.0; while (m2 < t2) { m2 = millis(); if (m2 >= t2) {Video3.play();} }}}}} void draw() { if (Video1.available()){ image(Video1, 0, 0);} if (Video2.available()){ image(Video2, 0, 0);} if (Video3.available()){ image(Video3, 0, 0);} } void movieEvent(Movie m) { if(m == Video1) { Video1.read(); } else if(m == Video2) { Video2.read(); } else if (m == Video3) { Video3.read(); } }