08 June 2011

Playing FLV videos in Keynote

If you've ever wanted to download an online video* to use in a Keynote presentation, you might have found, like me, that often it doesn't work.
* YouTube, Vimeo and other video websites don't 'stream' their content to your computer directly; as that grey progress bar fills up, the video is actually downloading to a temporary file on your computer's hard drive (the file is deleted when you close your browser tab), in a hidden folder several levels deep. And the file type is usually disguised and needs to be renamed with a .flv extension before it can be played.
Downloaded FLV videos can be played using QuickTime 7 with the Perian component, but embed them into a Keynote presentation and they often won't play like other video files. (This is annoying because if a file is compatible with QuickTime, you'd expect it to work with other software that uses QuickTime functionality to play media - which is just about everything on a Mac.) Sometimes the video can't be converted by QuickTime into an alternative format; the sound comes out fine but the video is just white from beginning to end.

Try to save a FLV as a regular QuickTime MOV and you often get this message.

(I managed to successfully convert some FLV files into QuickTime MOV using VLC, a popular video player with some comprehensive features. In order to match the excellent picture quality of the FLV file, the quality settings in the export had to be set rather high. My best attempts were to export with the ProRes 422 LT codec, resulting in an enormous 745 Mb file converted from the 45 Mb original FLV. Anything less looked awful with horrendous compression artifacts. I guess this shows how good the FLV codec is.)
Instead, open the FLV in QuickTime, choose to Save As and create a reference video*. Embed this reference video into Keynote, and voila, the video plays fine. And without the need to create a huge transcoded file.
* A reference file is a bit like a shortcut you have on your desktop or dock. It doesn't contain the video itself, but merely points to the original video file. This is why the reference file is tiny in size.
With the original video open, choose File > Save As to create a reference file.

Make sure to keep the original FLV file, and in the same location, so that the link to the reference file doesn't break and scupper your video. Always use a practice run through your presentation to make sure the videos play correctly, and of course to hone your delivery to stun your audience.

I've got no idea why this method works fine, but embedding the original FLV file fails; in theory they should perform the same, since it's the same media that is being played in the presentation slide. Perhaps Keynote has a problem with playing certain QuickTime-compatible file types, despite its close integration with QuickTime.

Edit: Above trick was using Keynote '09 (version 5.0.3) and QuickTime Pro 7.7.