[FIX] High cpu usage from Finder/QTKitServer when you open a folder with mkv files

Discussion in 'OS X Mountain Lion (10.8)' started by phobox, Oct 6, 2012.

  1. macrumors member

    Dec 25, 2007
    Hi all

    As some of you may have noticed, if you have installed Perian and have a folder full of mkv files, Finder and QTKitServer will go a bit crazy when you open this folder. This is because they are trying to create thumbnail images for the movies automatically and most of the time fail on mkv files or broken avi files, thus causing the high cpu/disk thrashing (often even after you've closed the folder).

    There is a fix for this, but I must warn you not to do any of this if you arent comfortable modifying system files. I have tested it on my own system with good results however.

    OSX has a sandbox layer in which almost all processes run, including system processes. This sandbox has rules and by modifying those rules, we can change how things work. In this case we are changing the rules so that QTKitServer will not be able to touch mkv files. Note that this may also have the side effect of you not being able to open mkv files in QuickTime anymore, in which case just use VLC or some other movie player instead.

    If you are ready to proceed, do the following:

    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.

    The effect will be immediate and you should have no more issue with thumbnail generation going crazy in a folder with mkv's. It will not affect any other video or audio files.

    Again if you arent comfortable in terminal or with modifying system files, I would suggest not doing this yourself. For everybody else, I hope this helps :)
  2. gumblecosby, Oct 10, 2012
    Last edited: Oct 10, 2012

    macrumors 6502

    Jun 22, 2010
    Absolutely brilliant. This fixed the problem immediately. I can see sandbox daemon run in Activity Monitor for a second and stop now when I open a folder with an MKV file so it works perfectly. Thank you.

    Where did you discover the appropriate documentation on Sandbox profiles?

    FLV files were causing problems too. I entered this to fix it:

    (deny file-read* (regex #"^.*\.flv$"))
  3. macrumors member

    Dec 13, 2006
    Moscow, Russia
    Cool, I have done the same for avi and finally I could breath :) Thanks, dude!
    but in general Apple is sucks with this preview.
  4. yto, Dec 3, 2012
    Last edited: Dec 3, 2012

    macrumors newbie

    Mar 22, 2012
  5. macrumors member

    Dec 13, 2006
    Moscow, Russia
    I've done everything that you wrote but this solution didn't help. I run 10.7.5 with all last updates.
    How to permanently disable this QTKitServer QuickLook Helper? Looks like folks in Apple don't see a huge problem because they reported that it's not a bug that mine CPU overloaded by their ****** software. Jobs was **** allover Flash but their own software overload CPU over 100%. I suppose folks in Apple feels like everyone only should use their mp4 with h.264.
  6. macrumors regular

    Dec 8, 2009
    Nice tip, but from time to time seems that the file itself resets and the rows i add
    (deny file-read* (regex #"^.*\.mkv$"))
    (deny file-read* (regex #"^.*\.avi$"))

    Can it be set as read only?
  7. macrumors regular

    Dec 8, 2009

Share This Page