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
MovieMaker library (Read 2148 times)
MovieMaker library
May 18th, 2006, 6:10pm
 
Hello all, I've created a little quicktime movie maker library. . .   Needs some testers so let me know what breaks:

http://www.shiffman.net/2006/05/18/moviemaker/
Re: MovieMaker library
Reply #1 - May 18th, 2006, 9:03pm
 
Just tried it on windows, seems to work fine.

The only possible issue is that after mm.finishMovie(); the sketch just hangs, I assume because the mm.addFrame() can't run right anymore. Might be an idea to get this to throw an exception or something if it's called after the movie is finished.
Re: MovieMaker library
Reply #2 - May 18th, 2006, 11:46pm
 
Strange, this shouldn't happen b/c a boolean variable is set to false which stops the code inside addFrame from happening after finishMovie (even if it is called again.)  What version of processing are you using?  I'll see if I can replicate the error when I get on a windows machine. . .
Re: MovieMaker library
Reply #3 - May 19th, 2006, 12:34am
 
I stuck a couple of printlns in to see where exactly it was stopping, and it looks like it's actually mm.finishMovie(); that's not ending.

The .mov file is created, and plays fine in Quicktime however.

Edit: Processing-0115 and Quicktime 7.1 in case it's important.
Re: MovieMaker library
Reply #4 - May 19th, 2006, 1:13am
 
Yup, for some reason on Windows, QTSession.close() hangs. . .Odd.  Just posted a new version that doesn't call that method.  Probably not such a good idea to skip that step, but it seems to work now. . .will investigate further soon.
Re: MovieMaker library
Reply #5 - May 19th, 2006, 9:53pm
 
Found a small thing I just thought i'd point out.
Love the effort, and thanks for sharing the source

Code:

// This gives a wrong path in windows, c:\bla/movie.mov
String path = parent.sketchPath + "/" + filename;
// This should give the right path, c:\bla\movie.mov
String path = parent.sketchPath + "\\" + filename;


-seltar
Re: MovieMaker library
Reply #6 - May 19th, 2006, 11:33pm
 
use the sketchPath() method instead of the variable, which will fix the path issue..

better yet, if it's to find the save location, use savePath(filename) which will do the same as savePath but create the necessary subfolders inside the sketch folder for saving the file (rather than crashing when someone asks to save to a subfolder).
Re: MovieMaker library
Reply #7 - May 23rd, 2006, 12:35am
 
I think I've found a bug in the source.

The "rate" variable is actually the frame delay I think, so 30 isn't 30 frames a second, it appears to be 30 milliseconds delay until next frame, so giving a speed of 33FPS (1000/30), nicely masking the problem Wink

If you increase the number, the playback goes slower, and vice-versa.

So line 194 needs to change from:
Code:
videoMedia.addSample(imageHandle, 0, cfInfo.getDataSize(), rate, imgDesc, 1, syncSample ? 0 : StdQTConstants.mediaSampleNotSync); 



to (assuming it needs to be an int delay):
Code:
videoMedia.addSample(imageHandle, 0, cfInfo.getDataSize(), 1000/rate, imgDesc, 1, syncSample ? 0 : StdQTConstants.mediaSampleNotSync); 

Re: MovieMaker library
Reply #8 - May 23rd, 2006, 9:07pm
 
Ah, thanks for this correction.  I've updated the library, it now uses savePath(filename) as well as has JohnG's rate correction.  It also allows the user to specify a keyframe rate (which previously defaulted to 15).

I also tried having it automatically "finish" the movie upon disposal of the applet, but doesn't seem to work consistently.  Hopefully this didn't break it on windows. . .

I suppose I need to make a nice page with documentation, that's next. . .

new version is here:
http://www.shiffman.net/p5/moviemaker/moviemaker.zip

source included. . .

Dan
Page Index Toggle Pages: 1