Thursday, November 22, 2007

iPhoto bug: export video produces video-free file

This post has been rewritten to clean it up.

11/22/07: I learn the hard way that if you use iPhoto '08 (7.1.1)' s "export as current" function on a video file, it exports a video-free stub. So instead of a 40MB file containing 30 seconds of video, you get a 650KB file with 0 seconds of video and a JPEG thumnail of a frame.

The bug causes me to lose 3 unique and irreplaceable family video clips because I often edit on my laptop, then export the "current" images and videos to my server where they get imported into my primary iPhoto Library.

Others experience the same bug. It's trivial to replicate, I even demonstrated it to an Apple store employee on their machines. I also posted it to Macintouch.

Here's on Apple Discussion Thread:
Apple - Support - Discussions - Export AVI from iPhoto destroys video, ...:

I have a 34MB AVI file in iPhoto 7.1 produced in a Canon SD 1000 camera. If I export it as 'current' or 'jpeg' it produces a 56K file. This consists of only the thumbnail, the video data is gone.

(If you're exporting a set of images it's easy to specify JPEG and include a video. Prior versions of iPhoto ignored the 'JPEG' value where it didn't make sense and exported the video.)

If I drag and drop to the video from iPhoto to the desktop it produces a 34MB file on the desktop. I checked another video I recently exported. It was also truncated to 60K...
Update 11/27/07: In another Apple Discussion thread, I hypothesize about the origin of the bug:
... "export as original" works as always, as does drag and drop to the desktop.

The bug is in "export as current". I suspect it's a conceptual error that may be tricky to correct.

What does "current" mean for a video that has no edited version? If you were to ask 1000 users, I think 1000 would say "current" means the most recently edited version of the video.

I suspect (don't have iPhoto at hand right now to test) that when iPhoto '08 works with a video it creates some kind of thumbnail representation that lives in the edited/modified internal folder.

I further hypothesize that the programmer wrote the "current" code in iPhoto '08 so it looks first in the "edited/modified" folder and, if it doesn't find anything, goes to the "original" folder.

That works for images, but, fails for video. The algorithm ends up pulling out the thumbnail stub and exporting that.

Ironically, I wonder if the current behavior was a fix for a bug I'd reported in prior versions of iPhoto -- namely that under certain conditions iPhoto would confused between the "current" and "modified" status of an image. That bug was fixed in iPhoto '08, but my hunch is the fix introduced a much more severe bug...
Another possibility is that the bug was introduced as a side-effect of introducing iMovie '08 (iClip really). iMovie is supposed to be able to use iPhoto as a video repository; maybe there was supposed to some versioning behavior introduced in iPhoto '08 to match iMovie '08 and it was pulled prior to release -- leaving some detritus behind.

Update 11/27/07b: I add the following to the Discussion thread. It appears my hypothesis is correct. No denying this one's a nasty bug:
... Check out any "original" folder with a video in it. In the companion modified folder you will find the thumbnail files. They are JPG files with the video prefix -- for example: MVI_0099.jpg (136kb).

When you choose "export as current" iPhoto exports MVI_0099.AVI, also at 136KB. Only now the extension is AVI instead of JPG. However, the extension is incorrect!

In fact iPhoto has exported a JPG with an AVI extension. If you change the extension to JPG then the icon switches to a JPG icon. Open it in preview, it's a JPEG.

So, to summarize: When you choose "export as current" for a video iPhoto looks in the "Modified" folder, finds a JPG file (the thumbnail), then exports the JPG and changes the extension to AVI so it appears in the Finder to be a video file...
10/11/2009: I tested this with iPhoto 2009. If you "export original" you get a video file. If you export current you get a worthless JPG thumbnail - just as in 2007. If you drag and drop you export the video; I think that may be different from 2007.

If you edit in QuickTime and save the video, it replaces the original (destructive edit). Export behaviors are as above.

If I had any faith in Apple this would be amazing, but incompetence is not rare in today's Apple.


Tess said...

Thanks for all the info. This problem was baffling me! I didn't realize something was wrong with the avi file until YouTube, Google Video, and Flickr all rejected the upload because of "unsupported file format". Hopefully "export original" will solve the problem.

Pooka said...

you can write a shell script that reads iphoto library and copies any found avi files somewhere :>

Mauro said...

Same problem as me.
The strange thing is that I never clicked on the export button. I just backed photos up on external drive.

After some overwriting, they are gone anyway in the external HD too.

why some videos are disappeared and some videos are just not? and why there is such a replication of data in directory as "Data", "Original", "Modified" even if a video is never modified :S

Thank you anyway, you were very helpful

Nathan said...

thank you!! the fact that it comes out with a file extension of .avi was really messing me up. Very annoying bug!

jonno said...

Is there a fix for this I am using iphoto 2011 and the same thing is happening.

jonno said...

Is this problem sorted out cause i am using ilife 2011 and the problem remains. I am lucky i have only started doing it this way.

JGF said...

I think the fix is not to use iPhoto. This last release, iPhoto 11, is among the worst software updates of the past five years.

jonno said...

Like i said I am glad i tried one of my videos before i was devestated 2 years down the track.

Makes me want to go back to Picasa.