Extracting Frames from an EM Movie

One of our users returned from Oak Ridge National Lab (ORNL) with some movies that were recorded using one of their microscopes and a liquid cell specimen holder. This person needed to extract a few individual frames from the movies, and wasn't having much luck with the software available in their lab, and the EMC was asked for help.

There are many, many ways to deal with such a problem and they all depend on having some sort of movie manipulating software available. Unfortunately, we were not able to open these movies using ImageJ (a common, freeware program capable of dealing with many image and movie formats) or Windows Movie Maker. On the other hand, these movies did play properly using tools like Windows Media Player and mplayer.mplayer logo

We were able to extract all the frames from these movies as individual JPEG images using the following mplayer command:

$ mplayer -vo jpeg -frames 12000 movieFile.avi
NOTE: these movies had slightly less than 12,000 frames each, but specifying too many frames does not cause mplayer any problems

A similar command that would extract 100 movie frames to individual GIF animation images starting at a position near (but probably not exactly at) 5 min and 30 s into the movie looks like:

$ mplayer -vo gif89a -frames 100 -ss 00:05:30 movieFile.avi

Other common output file options are -vo png (for PNG output files), -vo pnm (for PNM output files) and -vo tga (for Targa output files).

mplayer is an extremely complicated and powerful program available for use on Windows, Macs and linux machines, and users of the EMC who are likely to deal with movies should consider installing it and learning to use it well.