1
I have run into an issue where I find the same video file to have different values for the kMDItemkind
Spotlight metadata depending on the drive it resides on (same machine, of course), which makes Spotlight searches on the file “Kind” fail. To compound the issue, the value on the external drive is in some cases incorrect and inconsistent with the document type hierarchy provided by the application it comes from.
- On the internal drive,
- for a Matroska video file (
mkv
file extension),mdls
listskMDItemKind
as “Video Media”. This is correct, as it is the default player’s for this file type (MPlayerX) “one size fits all” video type. - for a QuickTime MPEG4 file from the iTunes Store (
m4v
extension),mdls
listskMDItemKind
as “Apple MPEG-4-Film”. Again, this is correct, as it is the default player’s for this file type (QuickTimeX) matching video media type.
- for a Matroska video file (
- On my external FireWire drive,
- for the same Matroska file,
mdls
listskMDItemKind
as “Movie-DivX”. This is obviously incorrect, but it is also incorrect even for iFlicks, which provides this value, as iFlicks’ document type hierarchy does not bindmkv
to this type – it binds it to “Video-Matroska”. - for the same MPEG4 file,
mdls
listskMDItemKind
as “Video-MPEG4”. This is technically correct, but again, it is a value provided by iFlicks, which is neither the default player for this file type, nor the assigned player in Finder.
- for the same Matroska file,
- On both drives, the Finder “Get Info” window shows the correct file kind (i.e. “Video Media” / “Apple MPEG-4-Film”), but, consistently with the
kMDItemKind
values, Spotlight searches on this kind only return a result on the internal drive.
Diffing the output of mdls
on the respective files shows that besides this difference, the only other keys differing are the kMDItemFSOwnerGroupID
and kMDItemFSOwnerGroupID
ones, which are set to 99 (_unknown
) on the external drive, and to my user and group IDs in the internal one (note that despite what this suggests, actual file ownership and permissions are identical).
Both drives are formatted as Mac OS Extended Journaled, but the issue is identical when I copy the file in question on a FAT32 formatted USB key. Copying, duplicating or moving files around on the drive does not change this phenomenon, only transferring from internal to external and vice-versa does.
Finally, re-indexing the external drive (using sudo mdutil -E "/Volumes/My Book"
, first, then the hard way, by turning indexing off first, deleting .Spotlight-V100
, doing the above and re-enabling indexing) does not make a difference. The time stamp of the metadata changes, but the values remain the same.
How do I get Spotlight to store the correct value for kMDItemKind
of my video files, as defined by the respective default players, on the external drive?
Running OS X 10.7.4 (issue present in 10.7.3 already), German. Other installed media apps (besides MPlayerX and iFlicks): Subler, MediaInfo, Perian