export movie to avi using qtkit
export movie to avi using qtkit
- Subject: export movie to avi using qtkit
- From: Morgan Hibbert <email@hidden>
- Date: Mon, 14 May 2007 16:23:31 -0700
I am trying to open up a movie and then export it to a raw avi. I need
to do it without a user input.
OSErr err2 =noErr;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
QTAtomContainer exportSettings = NULL;
SCSpatialSettings spatialSetting;
ComponentInstance sc = NULL;
sc =
OpenDefaultComponent(StandardCompressionType,StandardCompressionSubType);
spatialSetting.codecType = kWindowsRawCodecType;
spatialSetting.codec = nil;
spatialSetting.depth = 0;
spatialSetting.spatialQuality = codecHighQuality;
err2 = SCSetInfo(sc, scSpatialSettingsType, &spatialSetting);
err2 = SCGetSettingsAsAtomContainer(sc, &exportSettings);
QTMovie *movie = [QTMovie
movieWithFile:@"/Users/onekway/matlabwork/whacked.avi" error:nil];
NSDictionary *dictionary = [NSDictionary
dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES],
QTMovieExport,
[NSNumber
numberWithLong:kQTFileTypeAVI], QTMovieExportType,
[NSData
dataWithBytes:*exportSettings length:GetHandleSize(exportSettings)],
QTMovieExportSettings, nil];
BOOL out = [movie
writeToFile:@"/Users/onekway/matlabwork/whacked2.avi"
withAttributes:dictionary];
[pool release];
the variable out returns "NO". When I comment out the NSData line in the
dictionary, the code works, but the default codec is not what I want.
I can not see where the error is here. I would like to be able to select
the codec I want and perhaps control other output settings. Any help is
greatly appreciated.
morgan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden