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 & HelpVideo Capture,  Movie Playback,  Vision Libraries › framerate problem with shiffman's moviemaker.
Page Index Toggle Pages: 1
framerate problem with shiffman's moviemaker. (Read 1975 times)
framerate problem with shiffman's moviemaker.
Aug 11th, 2007, 5:01pm
 


Hi,

Because of some reason, quicktime movies that I render using Daniel Shiffman's moviemaker library have a framerate issue. Whatever framerate I specify in the setup (and also in the moviemaker object), it seems like the animation has a very high framerate. An animation that has to be around 4 minutes long, is only about a minute long when rendered and is very fast.

I have tried a variety of framerates to see how it changes, but I couldn't find a way to render the movie in its original framerate (and length and speed).

I've checked Shiffman's blog as well, but couldn't find the proper answer there.

Can anyone suggest why this is happening and how it can be solved?

Thanks,

emre.

(ps: I'm using an intel macbook, OSX 10.4.8)



Re: framerate problem with shiffman's moviemaker.
Reply #1 - Aug 11th, 2007, 8:22pm
 
The framerate you specify for the applet is meaningless since it doesn't matter how slow or fast you add frames to the movie, just that you add them.

1 -- are you using the MovieMaker class as part of processing.video?  If not, please switch (Sorry, i have to update my site.)

2 -- does this happen with the example code provided:

http://processing.org/reference/libraries/video/MovieMaker.html

The issue can be due to arguments in the wrong order.  The constant you are using for the codec, for example, could be set to the framerate by accident.

Dan
Re: framerate problem with shiffman's moviemaker.
Reply #2 - Aug 11th, 2007, 11:40pm
 

Hello,

I was not using the Moviemaker class as a part of processing.video. Thanks for letting me know.

However, there is still a problem with the framerate. It does not happen with the example code, and the order of the arguments seem to be correct.

mm = new MovieMaker(this, width, height, "draw.mov", 30, MovieMaker.ANIMATION, MovieMaker.LOSSLESS);

I place this line in the beginning of setup(), and place the next one:

 mm.addFrame();  // Add window's pixels to movie

to the end of draw()

Since the example code is working properly, I assume there is something wrong with my code in general.

Could you suggest anything?

Thanks for the help!

Emre.



Re: framerate problem with shiffman's moviemaker.
Reply #3 - Aug 12th, 2007, 12:28pm
 
A question that might point to the problem.

How are you determining that what you'v created should be 4 minutes long? Are you just letting the sketch run for 4 minutes, then hitting some key to end it, or are you counting 4 minutes worth of frames?

If you're just waiting 4 minutes, it could be that your sketch isn't managing to run at the desired framerate, and so you're not actually making enough frames. If you set moviemaker to 30 FPS, but your sketch is only running at 7 or 8 frames a second whilst creating it, then the final .mov will only be 1/4 of the length you think it should.
Re: framerate problem with shiffman's moviemaker.
Reply #4 - Aug 12th, 2007, 4:14pm
 

That is exactly what I think the problem is. I am just running the sketch as long as the audio file that is played back. (I'm trying to make an audio-visual composition with visuals reacting to the FFT information derived from the audio file, and I'm using Minim library to do that)

How can I go around this? Is it possible to find out the framerate that the sketch is running, so that I can set moviemaker to a proper fps? But then, if my sketch can not run at the desired framerate, this means that it is going to have a lower but variable framerate, which will make it impossible to match the correct framerate using moviemaker.

I have also considered recording the animation to a DV cam, and then digitise it so that I can lay the soundtrack over it using a video editor. But this is also problematic since my macbook is not powerful enough to run the sketch without glitches.

Again, any suggestions?

Thanks a lot for the help,

Emre.




Re: framerate problem with shiffman's moviemaker.
Reply #5 - Aug 12th, 2007, 9:05pm
 
What you need to do is not play the audio, but calculate the FFT/spectrum/whatever for a chunk of the data at a time. I think that this is possible with some of the audio libraries.

What you need to do is work out how much audio corresponds to a frame, and run that many samples through whatever functons you use to react to it. (For what it's worth, most audio tends to be 44,000 samples/second, so that'd be 44,000/30 ~= 1467 samples/frame)
Re: framerate problem with shiffman's moviemaker.
Reply #6 - Aug 12th, 2007, 10:06pm
 
you might want to check out this discussion here.
it works with one of the audio libs available.

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Sound;action=display;num=1174169711
Re: framerate problem with shiffman's moviemaker.
Reply #7 - Aug 16th, 2007, 11:49pm
 


well, its not possible to set the buffer size to 1470, which is 44100 (sampling rate of the audio file)/(30)frames per second, since it has to be a power of two.

I'll try to adapt dave bollinger's code in the topic "Synchronizing generative video + audio" but there are a couple of things that I'm having a hard time understanding. If I can't work that out, I'll go for recording the whole thing to a DV cam and ripping back to .avi from that, hoping to find a fast machine to do that. Anyway, Il' write under that topic from now on.

thanks a lot for the heads up!

emre.
Page Index Toggle Pages: 1