The availability of software like Perian and Flip4Mac that make non-Apple video formats available to QuickTime and players like VLC and MPlayer means that many of us have files in formats like Flash and Windows Media Video that Mac OS X's Spotlight metadata subsystem recognizes as 'Movies' but for which it cannot determine video-specific metadata like dimensions, codecs, duration, and bitrate. It is possible to fix this in Leopard by duplicating and modifying a piece of the base OS, but in Snow Leopard it takes a bit more effort.
(This hint is also useful for 10.5 and probably 10.4, but 10.6 adds a special twist.)
Spotlight indexing relies on software components called 'metadata importers' to get format-specific details about various file types, which are packaged as bundles with the extension .mdimporter.
The standard set of these lives in /System/Library/Spotlight, with add-ons installed within application bundles, /Library/Spotlight, or ~/Library/Spotlight.
The key to getting the most detailed metadata into Spotlight is to have an importer that can analyze the file or knows how to get another program to do so and which lists the specific 'Universal Type Identifier' (UTI) for the file's format in its Info.plist file, which is inside its Contents directory, e.g. /System/Library/Spotlight/CoreMedia.mdimporter/Contents/Info.plist. Those files are Apple property lists, usually in XML text format.
In 10.5 the standard QuickTime importer appears to be a simplistic shim that hands any file given to it to QuickTime for analysis, so you can hack in support for additional movie types (assuming you have Perian and Flip4Mac installed) rather easily:
cp -rp /System/Library/Spotlight/QuickTime.mdimporter /Library/Spotlight/MoreMovies.mdimporter
public.movie public.avi com.microsoft.windows-media-wmv com.microsoft.advanced-systems-format org.perian.flash-video com.adobe.flash.video
mdimport -r /Library/Spotlight/MoreMovies.mdimporter
arch -i386 mdimport -g ~/MoreMovies.mdimporter ~/Downloads/*.flv arch -i386 mdimport -g ~/MoreMovies.mdimporter ~/Downloads/*.wmv
Comments (0)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20100912145924845