Create a QTMovie
instance, and then query its properties with a -movieAttributes
message.
views:
281answers:
2I need to get the same kind of info that you can get on "get info" when using Finder, more specifically I need the same info that is present on "more info" section, like Duration, Bitrate, Dimension, Codecs, Audio channels, etc.
Do it the same way the Finder does: Spotlight. (Don't let the word “Carbon” in the path scare you off: It's part of Core Services, so it is available in 64-bit.) Just instantiate an MDItem for the file you're interested in.
Another way would be to use Foundation's own wrapper of that framework (which is included on that page), but then you need to do an NSMetadataQuery that searches for items whose kMDItemPath
is the path to the file you're interested in. A lot of needless hassle—using MDItem directly will get you there faster.
A nice bonus is that this works for more than just video and audio files. Image files also have metadata that Finder and your app can show.