Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: quicktime - make film last x.y seconds?



On Dec 26, 2006, at 11:29 PM, A O wrote:

> 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.

Henry Martin
Little Planet Learning, Inc.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-java mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-java/email@hidden

This email sent to email@hidden
References: 
 >quicktime - make film last x.y seconds? (From: "A O" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.