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 & HelpSyntax Questions › Can not write to mov...
Page Index Toggle Pages: 1
Can not write to mov... (Read 423 times)
Can not write to mov...
Sep 11th, 2008, 5:23pm
 
I use 0135 and 0148 PC version.
Both failed to write a mov movie file..
Can some one please help me looking the code?  big thank!
-----------
import processing.video.*;

Movie myMovie;
MovieMaker mm;  // Declare MovieMaker object
PImage imgx;

void setup() {  
 size(640, 480, P3D);  
 background(0);  // Load and play the video in a loop  
 frameRate(30);
 myMovie = new Movie(this, "station.mov");
 myMovie.loop();  
 mm = new MovieMaker(this, width, height, "drawing1.mov",20, MovieMaker.H263, MovieMaker.HIGH);
 println(myMovie.width);
 imgx = new PImage(160, 120);
}

//void movieEvent(Movie myMovie) {  
 //myMovie.read();
 //imgx.copy(myMovie, 0, 0, myMovie.width, myMovie.height, 0, 0, myMovie.width, myMovie.height);
//}

void draw() {  
 if(myMovie.available()) {
   myMovie.read();
   imgx.copy(myMovie, 0, 0, myMovie.width, myMovie.height, 0, 0, imgx.width, imgx.height);
 }
 imgx.updatePixels();
 tint(255, 80);  
 image(imgx, mouseX-myMovie.width/2, mouseY-myMovie.height/2);  
 mm.addFrame();  // Add window's pixels to movie

}

void keyPressed() {  
 if (key == ' ') {
   mm.finish();  // Finish the movie if space bar is pressed!  
 }

}
Re: Can not write to mov...
Reply #1 - Sep 12th, 2008, 2:46pm
 
As often in "this doesn't work" messages, we lack a bit of information.
I will suppose that by "PC" you mean some Windows computer. It might be interesting to know if that's XP, Vista or something else.
I suppose you have installed QuickTime per instructions of the library.
Now, what doesn't work Do you see the movie displayed or not at all Do you have a file created Empty file or big unreadable file
And so on. I don't see an obvious error in your code, but I might miss something.
I have played a bit with movie export (see my Test of MovieMaker video type thread) but not with movie play.
Re: Can not write to mov...
Reply #2 - Sep 13th, 2008, 3:47am
 
Much thank to you...
this code is based on the examples come with 0148 on a XP sp3 computer.
YesI have installed QuickTime.
as for " per instructions of the library",
I have read the "howto.txt", it does not instruct me about what version of Quicktime.
hm.....

The "doesn't work" is after I hit [run], the [display window] becomes fulled of grey color. I have checked the [show sketch folder] and not finding any movie files. I am aware that video files are usually larger files (like 20 or 30 MB or up if recording for a few seconds) and the video file that's generated by [movie maker] has a ".m" inatead of ".mov" or ".mpg" like it usually appears in video editing world (ie. premiere, vegas ...).
Re: Can not write to mov...
Reply #3 - Sep 13th, 2008, 10:33am
 
OK, thanks for the details.
QT version: http://processing.org/reference/libraries/video/index.html writes: "QuickTime 6 is no longer recommended, use QuickTime 7 instead."

You write the sketch window remains gray, that probably means the video isn't played. You have to ensure the video file is found, I believe it must be in a data folder under the sketch's folder, but for testing purpose (not good for distribution and Web usage!), you can specify an absolute path (eg. "E:/Docs/Movies/sample.mov").

The movie is, by default, written in the same directory as the sketch. In my attempts, sometime the movie maker failed but I has an exception displayed in the result pane.

I would separate the two goals, to join them later: one sketch to play a movie, another to test the movie creation (eg. try my little test sketch).
Page Index Toggle Pages: 1