How do I keep QTKitServer (QuickLook Helper) CPU usage from exploding out of control? OR How do I disable QuickLook entirely?

I've been watching lots of .MKVs lately, opened from the Finder. In Column View, when you single-click any file, QuickLook will load a viewable thumbnail into the next column over. This causes noticeable and repeated momentary hangs in Finder responsiveness.

I have a feeling this is related to a non-Apple-kosher file-type like Matroska Video giving QuickLook some problems.

Has anyone had experience with this problem, OR have a way to disable QuickLook entirely? I ask because I would rather have my OS always be responsive than have CPU time eaten so that a useless thumbnail can be loaded that I never use.


Solution 1:

Open Terminal, type:

sudo nano /System/Library/Sandbox/Profiles/com.apple.qtkitserver.sb

This will open the nano editor with the rules file. Scroll right to the bottom of this file and enter:

(deny file-read* (regex #"^.*\.mkv$"))

After this do Ctrl-O and then Ctrl-X to save and exit the application.

Reference: http://forums.macrumors.com/showthread.php?t=1463364

Solution 2:

A quick fix would be removing Movie.qlgenerator from /System/Library/QuickLook/ folder. This will disable thumbnail creation for all movie files, not just MKVs.

A better fix (if you know what you're doing) would be to restrict the Movie.qlgenerator plugin to only displaying content of certain video formats:

Right-click on Movie.qlgenerator - you should be able to open its Contents folder and see its 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 is 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

(or the UTIs for the movie types you would like to keep the previews for)

Solution 3:

For OS X 10.8.5, the method below works well enough for me to stop looking for a better solution. The file modification has survived reboots, but it might need to be reset after Apple updates.

  1. Edit this sandbox profile as an admin:

    /usr/share/sandbox/quicklook-satellite.sb
    
  2. Add the file type deny rules at the end and save:

    (deny file-read* (regex #"^.*\.wmv$"))
    (deny file-read* (regex #"^.*\.mkv$"))
    
    (...and any other files or Quick LooK plugins you are having problems with...)
    
  3. Kill all running Quick Look processes using Activity Monitor or command line:

    "Quick Look Helper", "qtkitmoviesvalidator", "QuickLookSatellite", etc....
    
  4. Now seeing the problematic files in Finder will trigger a "QTKitServer..." process, but it should not take up any CPU resource or launch the file-type-specific Quick Look plugin.

One downside of this method is that access-denied kernel logs are generated whenever the blocked files appear in Finder. If you are bothered by these logs, configure asl or syslog to get rid of them.