With each project, iMovie imports videos, images, and audio into an iMovie Library.imovielibrary
. I want my originals in a separate folder, along with other originals that I didn't import into iMovie and others for which I use other tools such as ffmpeg
, but I still want to keep the ability to edit and export projects. At the moment I have videos in two places and the iMovie library is a bloated 300 GB in a 1 TB drive.
How can I avoid duplicating video or other files in an iMovie library and save disk space?
Best Answer
First a disclaimer: As you can see from miguelmorin's answer, some people have created various scripts to replace the duplicate images and videos in the iMovies library with hard links or symlinks. Before going any further, I would avoid hard links. Symlinks seem to work fine with iMovie, and hard links can have weird side effects, for instance Time Machine may back them up as separate files.
In my case, I used rdfind, which is an existing utility for cleaning up duplicate files and isn't specific to iMovie or even macOS.
Install rdfind
Do a dry run
e.g.
-minsize
is used to avoid touching any files that aren't image or video files. Adjust it as needed.~/Pictures/
with the location(s) of the original image/video files. You can list as many directories as you want, but~/Movies/
should be last because rdfind expects the locations of the original files to be listed first.Update: YMMV but it looks like iMovie 10 puts all of the original images and videos in
Original Media
directories under ~/Movies/iMovie Librarie.imovielibrary. This will go through those directories only and run rdfind on them, in which case-minsize
shouldn't be needed (as above, replace~/Pictures/
as needed):Create the symlinks
Once you're happy with the output of the command from the dry run, remove
-dryrun true
to replace the duplicate files with symlinks, e.g.Or:
Pros:
Cons:
-minsize
or by only running rdfind on theOriginal Media
directories)