> Is there any way to make a movie with "a" number of frames, last x.y
seconds?
> Basically I would like my users to be able to set the amount of time
for their movie to run, create that
> movie for that length of time, and then save it to their computer.
If I am correctly understanding your question, each frame must have a
duration of ( x.y / a). This duration ( in seconds ) must be converted
to the track's time scale.
The closest to a clean example I have is adding text which needs to
have the same duration as other elements in a movie. If I extract the
code for setting the time and adding the sample, the two parts look
like:
// get the time scale for the track where the text is to go
int timeScale = textTrackLeft.getTimeScale();
...........
// I run a loop where I get the duration for each piece of text,
assuming all frames are equal for you
// you could
double duration = ( x.y / a );
int useDuration = (new Double(duration*timeScale)).intValue();
...........
// lots of code to generate the textHndl, ....
...........
// add the text sample to the media - using the duration in
the track time scale computed above
// each frame in your movie would be added this way as a
sample of the duration you have computed
myTextMedia.beginEdits();
myTextMedia.addSample((QTHandleRef)textHndl,
0,textHndl.getSize(), // entire container
useDuration, // duration
textDesc, //
1, // one sample
1); // self-contained
myTextMedia.endEdits();
I hope this example is helpful to you. If I haven't understood the
question correctly, explain further and maybe I'll get it next time
around.