I have been getting the same error. Using a MAC 27" with OX X Yosemite 10.10.5 and iMovie 10.1.1. This is what I believe is happening. I am editing the movie and trying to do some stabilizing of movie clips. My project is a mixture of photos and movie clips. When I finally gave iMovie time to catch up on the editing, which I believe is happening in the background, exported the movie directly to the MAC hard drive, not a portable or YouTube, then it worked. It did take about 18 hours. I used 1080P, High, Better Quality for the export. Also, it seems to help to close iMovie and reopen before you export your project. Hope this helps. Originally, the portable I was exporting to was large enough, but it seemed to work only exporting a file to the MAC Documents.