Reputation: 120324
What's the simplest way to get the original size (width & height) of a video with Objective-C in Mac OS X 10.7?
Upvotes: 1
Views: 321
Reputation: 9543
Assuming the movie is something readable by QuickTime -- and if it isn't you're probably out of luck anyway -- something like this should do the trick, I think:
QTMovie* movie = [QTMovie movieWithFile:movieFileName error:nil];
NSSize size = [(NSValue*)[movie attributeForKey:QTMovieNaturalSizeAttribute] sizeValue];
(NB: untested, no error checking, etc.)
Upvotes: 2