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
problems with .mov (Read 419 times)
problems with .mov
Jun 5th, 2008, 5:33pm
 
hello,

i´m having a problem with the playback of my quicktime movies. when i start my movie, i can´t see the whole clip, only certain frames flashing - like 1 or 2 per second. the playbackrate is allright, it´s just that i can´t see the whole thing. i tried different codecs, like cinepak, soerensen etc, but it doesn´t work at all...any ideas? i´m working on a pc...
(it is a program that changes the presets of a midiinterface, depending on the lenght of the movieclip)

the code is below:

import promidi.*;
import processing.video.*;

Movie   myMovie;
MidiIO  midiIO;
MidiOut midiOut;

int initialP;
int secondP;
int currentP;

float movieDuration;

boolean movieRunning;

void setup(){
 size(640,480);
 background(0);
 smooth();

 initialP = 0;
 secondP = 1;

 //get an instance of MidiIO
 midiIO = MidiIO.getInstance(this);

 //print a list with all available devices
 midiIO.printDevices();

 //open an midiout using the third device and the first channel
 midiOut = midiIO.getMidiOut(15,3);
 myMovie = new Movie(this, "video.mov");
 movieDuration = myMovie.duration();

 myMovie.stop();
 movieRunning = false;
}

void keyPressed() {
 if (movieRunning == false){    
   if (keyCode == 32){
     // send programmchange
     midiOut.sendProgramChange(
     new ProgramChange(secondP)
       );
     movieRunning = true;
     myMovie.jump(0);
     myMovie.play();
   }
 }
}

void draw(){
 background(0);
 if (movieRunning == true){    
   image(myMovie, 0, 0);
   if (movieDuration == myMovie.time()){
     movieRunning = false;
     myMovie.stop();
     // send programmchange
     midiOut.sendProgramChange(
     new ProgramChange(initialP)
       );
   }
 }
 else {
   renderStartFrame();  
 }  
}

// Called every time a new frame is available to read
void movieEvent(Movie m) {
 m.read();
}

void renderStartFrame(){
 PImage b;
 b = loadImage("start.jpg");
 image(b, 0, 0);
}

Page Index Toggle Pages: 1