The CoreMedia Framework
At the heart of macOS’s multimedia capabilities lies the CoreMedia framework. Whether you are scrubbing through a 4K timeline in Final Cut Pro, watching an encoded stream in Safari, or simply previewing an MP4 file by tapping the spacebar (Quick Look), CoreMedia is the low-level engine handling the real-time decoding of the audio and video tracks.
Because video decoding is highly taxing on the CPU and GPU, CoreMedia aggressively caches frame data and streaming manifests into hidden system directories. If you regularly work with massive video files, or if a specific video stream crashes and corrupts the manifest, this cache can become a serious problem. Symptoms of a corrupted CoreMedia cache include video files playing only audio with a black screen, Final Cut Pro dropping frames during simple playback, or Quick Look freezing entirely when selecting a video file.
To restore smooth video playback across the operating system, you must forcefully purge the CoreMedia cache using the Terminal.
Locating the Cache Directory
CoreMedia is a system-level framework, meaning its caches are not stored in your standard user folder. They are sequestered in the Darwin kernel’s secure temporary directories, which are dynamically generated upon boot.
The cache is located within the com.apple.coremedia folders deep inside the /var/folders/ path.
Purging the Cache via Terminal
Because these directories are protected by system permissions, you must use the Terminal with elevated administrator privileges.
- Quit any applications currently utilizing video (Safari, QuickTime, Final Cut Pro, Premiere).
- Open the Terminal application.
- Execute the following command to forcefully remove the cache files:
sudo rm -rf /private/var/folders/*/*/*/com.apple.coremedia*
Press Enter, type your Mac’s administrator password (the characters will remain invisible), and press Enter again.
Warning: The rm -rf command permanently deletes files. The wildcard asterisks (*) are used to target the dynamically generated folder names unique to your specific macOS installation. Ensure you type the path exactly as written to avoid deleting unrelated system files.
Restarting the Media Daemons
Deleting the cache files from the SSD is only the first step. The background daemons responsible for video decoding (specifically coreaudiod and vtdecoderxpcservice) are still running in RAM and may still be attempting to access the corrupted data structures.
You must forcefully terminate these processes to force a clean restart.
sudo killall coreaudiod
sudo killall VTDecoderXPCService
When you kill the Core Audio daemon, your Mac’s speakers might make a brief popping sound, and any currently playing audio will instantly stop. This is perfectly normal. macOS’s launchd system will automatically respawn fresh instances of both daemons within milliseconds.
The Final Step
While the daemons have restarted, it is highly recommended to perform a full system reboot to ensure the CoreMedia framework cleanly regenerates its entire directory structure on the hard drive. Upon reboot, attempt to preview the video file that was previously causing issues; the playback should now be smooth and artifact-free.