Loading...

quicktime-api@lists.apple.com

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: Problems using QTKit to create 24 fps movie Steve Sisak Thu Mar 08 10:01:47 2012

QuickTime uses integers for time.

Check the movie time scale and make sure it's divisible by 24 -- IIRC the default is 600.

Try setting the movie timeScale to 600 and using:

QTTime duration = QTMakeTime(25, 600); /* 25 = 600/24 */

This should give you exactly 24fps

HTH,

-Steve

At 10:13 AM -0500 3/8/12, Marshall Houskeeper wrote:
I am trying to use QTKit to export a 24 fps movie. However, when I open the movie in QuickTime Player or other applications the movie has a frame rate of 25 fps.

Is there a known bug with exporting 24 fps movies using QTKit or am I doing something wrong?

Note: I see the problem in both 10.6.8 and 10.7.3.

Below is a slightly modified version of the createMovie method in the Apple sample program WritableFileDemo that shows the problem:

- (IBAction)createMovie:(id)sender
{
        QTMovie *movie = nil;
        NSImage *image = nil;
        NSDictionary *attrs = nil;
        SInt32 i;



attrs = [NSDictionary dictionaryWithObject:@"jpeg" forKey:QTAddImageCodecType];



NSTimeInterval mFrameInterval = 1.0 / 24.0; // set frame rate to 24 fps
        QTTime duration = QTMakeTimeWithTimeInterval(mFrameInterval);

movie = [[QTMovie alloc] initToWritableFile:@"/tmp/newMovie" error:NULL];



        for ( i = 0; i < 100; i++)
        {
                image = [NSImage imageNamed:@"A"];
[movie addImage:image forDuration:duration withAttributes:attrs];

                image = [NSImage imageNamed:@"B"];
[movie addImage:image forDuration:duration withAttributes:attrs];

                image = [NSImage imageNamed:@"C"];
[movie addImage:image forDuration:duration withAttributes:attrs];
        }



        [movie updateMovieFile];



        [movieView setMovie:movie];
        [sender setEnabled:NO];
}

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      ([EMAIL PROTECTED])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/quicktime-api/sgs-lists%40codewell.com

This email sent to [EMAIL PROTECTED]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      ([EMAIL PROTECTED])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/quicktime-api/alexiscircle%40gmail.com

This email sent to [EMAIL PROTECTED]