• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
export movie to avi using qtkit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Resource Image vs Image File
  • Next by Date: Re: Progress Indicator Behaviour
  • Previous by thread: [MEET] LA CocoaHeads Meeting on Thursday May 17th at 7:30pm - 9:30pm
  • Next by thread: NSDictionary allocation
  • Index(es):
    • Date
    • Thread