PDA

View Full Version : QTKitServer/QuickLook hogging CPU!




cloudyo
Aug 4, 2012, 07:36 AM
Whenever i use Finder to go to a folder with an MKV file in it, the QTKitServer Process starts up hogging the CPU with 50-100%. As long as the folder is open this doesn't change. Even after i close Finder or navigate to another folder the CPU usage remains high for about a minute or two.

This is especially a problem when I'm on battery power. The estimated time remaining goes down to about 3 hours on my rMBP.

I have found out that this process is in charge of creating the thumbnails that are displayed in Finder. It just seems to choke on (some?) MKV files. At first i tried "CMD+J" to uncheck "show icon preview". Unfortunately this didn't do anything.

A Google search led me to this thread (https://discussions.apple.com/thread/4146723?start=0&tstart=0), where a corrupted avi file created the same issue. There it is suggested to delete the video file that is causing the problem. In my case this is not an option because the file isn't corrupt and works perfectly in VLC.

As a quick fix i renamed the "Movie.qlgenerator" file in the /System/Library/QuickLook/ folder. This, however, disables thumbnail creation for all movie files, not just MKVs!

Is there any way to configure the creation of thumbnails in Mountain Lion to just exclude MKV files? Or maybe exclude a folder?



cloudyo
Aug 6, 2012, 05:48 AM
I figured out that Quicklook is only trying to create thumbnails for MKV files because Perian is installed. Without Perian Quicktime/Quicklook wouldn't be able to open MKV files at all.

Now, one Solution would be to uninstall Perian of course. I can't do that however because I need it for "Subler" to work correctly.

And since Perian will soon no longer be supported, I guess I will have to live with this.

wytwolf
Aug 6, 2012, 08:55 AM
why not just use VLC to play mkv's?

haravikk
Aug 6, 2012, 08:58 AM
If you right-click on Movie.qlgenerator you should be able to open its Contents folder and see an Info.plist file. You could try modifying this to exclude .mkv files; unfortunately there's no way to do this directly, but you could modify the LSItemContentTypes part to only include types that aren't .mkv.

You absolutely must backup Movie.qlgenerator before doing this. Anyway, once you've backed it up, open Info.plist in the original plugin within the Quicklook framework; you'll probably need to use XCode, or you could try using plutil on the command-line if you're comfortable with that ("plutil -convert xml1 <path_to_Info.plist>"), since the .plist seems to be in binary format by default.

Find LSItemContentTypes (in XCode look for Document types then Document Content Type UTIs). This is an array of items, with one entry of "public.movie", which basically means "any movie that Quicktime can open".

Remove this and instead add entries for the following UTIs:
com.apple.quicktime-movie
public.avi
public.mpeg
public.mpeg-4
public.3gpp
public.3ggp2

This should restrict the Movie.qlgenerator plugin to only displaying content of those types.

cloudyo
Aug 7, 2012, 02:24 PM
Find LSItemContentTypes (in XCode look for Document types then Document Content Type UTIs). This is an array of items, with one entry of "public.movie", which basically means "any movie that Quicktime can open".

Remove this and instead add entries for the following UTIs:
com.apple.quicktime-movie
public.avi
public.mpeg
public.mpeg-4
public.3gpp
public.3ggp2

This should restrict the Movie.qlgenerator plugin to only displaying content of those types.
Thank you so much! Is there a list of valid content types that i can enter there?

edit: found it: https://developer.apple.com/library/mac/#documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html#//apple_ref/doc/uid/TP40009259-SW1

edit2: Which UTI would include MKVs, other than "public.movie"?

edit3: It looks like public.mpeg-4 is the one that also includes MKVs if their content is MPEG4. BUT the original problem seems to remain even if i remove the mpeg-4 from the List of UTIs. I guess that Quicklook still has to scan the MKVs to find out if their content conforms to any of the other UTIs. I come to this conclusion because without the mpeg-4 UTI the thumbnails of the MKVs remain unchanged, but the CPU usage is still way too high for the "QuickLookSatellite" Process if i open a folder with only MKVs in it.

haravikk
Aug 8, 2012, 05:29 AM
Ack, I thought it was working for me when I posted, but when I reversed the change Quicklook just doesn't seem to want to generate previews for some .mkv files but not others.


Actually, have you tried associating the .mkv file type with another program? Most of mine are associated with QuickTime Player 7 rather than X, since X still doesn't always open them properly. A side effect of this is that it causes them to display as plain documents, and seems to stop Quicklook from showing a preview. Hopefully it also means it won't try to generate the preview either.

Anyway, it might be worth trying the Open with option in get info to see if it will help; just choose QuickTime Player 7 and hit Change All…
That is of course assuming you have QuickTime 7, which I think is on the Snow Leopard install CD; you might be able to download it from somewhere if you need it. I haven't left my system without it since Quicktime X came out since it actually works on multiple monitors properly, has more options and opens more files properly.

Associating with VLC instead might achieve the same thing?


I really need to brush up on UTIs, maybe there's a way to somehow handle exclusions using UTI features, since Quicklook seems to be devoid of any settings.

EDIT: using the mdls utility it seems the content type for .mkv is "org.perian.matroska", which inherits from public.movie, and so is why Quicklook tries to process it. I can't seem to figure out if there is a way to change or somehow invalidate the org.perian.matroska UTI so that Quicklook will no longer see .mkv files as movies, I don't suppose anyone knows how/where Perian defines its custom UTIs?

Menneisyys2
Aug 20, 2012, 08:52 AM
I've just disabled QuickLook entirely as content-dependent icons have never meant anything for me (I've been using Finder in the Detail view with very small icons).

rafaferrs
Oct 15, 2012, 03:44 PM
Hey guys!
After uninstalling QuickTime Player 7, the process stopped hogging the CPU. But I disabled Perian along with it.

gumblecosby
Oct 15, 2012, 05:22 PM
This thread has the solution: http://forums.macrumors.com/showthread.php?t=1463364

It will allow you to keep Perian and Quicktime 7 installed.

pjk89
Oct 30, 2012, 12:00 PM
I just came across this problem when using MakeMKV to package my DVD backups. I also have Perian installed but I tend to use VLC these days, I managed to regain the CPU by opening the info window on one of the files and setting VLC as the default application. The QTKitServer/QuickLook services are still running but occupy considerably less CPU.

mactoday
Mar 25, 2013, 10:54 AM
I figured out that Quicklook is only trying to create thumbnails for MKV files because Perian is installed. Without Perian Quicktime/Quicklook wouldn't be able to open MKV files at all.

Now, one Solution would be to uninstall Perian of course. I can't do that however because I need it for "Subler" to work correctly.

And since Perian will soon no longer be supported, I guess I will have to live with this.
It does the same thing if Perian is not installed, overload CPU.