Skip to content

Instantly share code, notes, and snippets.

@reidransom
Created October 28, 2011 03:39
Show Gist options
  • Save reidransom/1321570 to your computer and use it in GitHub Desktop.
Save reidransom/1321570 to your computer and use it in GitHub Desktop.
Convert a video to DV Stream in CLI with QTKit
// compile with:
// $ gcc -o qt2dv -framework Foundation -framework QTKit qt2dv.m
#import <QTKit/QTKit.h>
int main (int argc, char *argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSUserDefaults *args = [NSUserDefaults standardUserDefaults];
QTMovie *movie = [QTMovie movieWithFile:[args stringForKey:@"i"] error:nil];
NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES], QTMovieExport,
[NSNumber numberWithLong:kQTFileTypeDVC],
QTMovieExportType, nil];
[movie writeToFile:[args stringForKey:@"o"] withAttributes:dictionary];
[pool release];
exit(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment