error
YaBB Newbies
Offline
Posts: 37
Re: Synchronizing generative video + audio
Reply #24 - Aug 23rd , 2007, 5:46am
Hi, I'm working on a generative video+audio type of project and stuck at the point of exporting/saving the sequence as a .mov file. I tried recording the application on a DV cam but the resolution was so low that it was useless. Since my macbook can not handle 30 fps, the regular moviemaker object is useless, as Dave Bollinger says. (the resulting. mov file is much faster and shorter than it should be, because it skips a lot of frames while writing the .mov file but treats the file as 30 fps so all the frames are compressed as if the movie is created in 30 fps - does it makes sense?) So, I've been trying to adapt the code of Dave Bollinger that he posted in this topic because it calculates how many audio samples should correspond to each frame, eliminating the sync problem. However, I'm having some problems. First of all, I am using the minim library, and wondering if this code can actually be adapted to this library. In the 'analyze' section of Mr. Bollinger's code there is something like this: void analyze() { int pos = (int)(frameNumber * chn.sampleRate / framesPerSecond); if (pos >= chn.size) { if (outputType==OUTPUT_TYPE_MOVIE) mm.finishMovie(); exit(); } fft.getSpectrum(chn.samples, pos); } However, I do not know how to change the fft.getSpectrum(chn.samples, pos) so that I can use this 'int pos' with minim's fft.forward(chn.mix). also, when I tried doing vice versa, like adapting my code so that I use ESS rather than minim, I came upon a problem concerning fft.spectrum[] values. Can some tell me what kind of values (between what range) do we recieve from fft.spectrum[] ? Its between -1, 1 in minim, but when I set the limits (using fft.limits()) to -1, 1 in ESS, I don't get the same results. I have to multiply (scale up) these values by at least 1000 to get results closer to minim. However, this 1x1000 ratio is not consistent for every parameter (like size, brightness, colour, etc) either. finally, I get this error when finishing the movie: quicktime.std.StdQTException[QTJava:6.1.5g],-2014=invalidDuration,QT.vers:7138000 at quicktime.std.StdQTException.checkError(StdQTException.java:38) this does not happen when I use Mr. Shiffman's moviemaker example as it is. What do you think may be causing the problem? Sorry for writing such a long problems list but I'm getting lost. Any help would be praised. Thanks. Emre.