Compiling a Movie From a Series of Still Images

-A quick guide for the CSB Core Lab by Joe Yannielli

-Rev. 8/13/02

 

1.)    When you create your images, be sure to name them in sequence. For example: amino_acids_0001, amino_acids_0002, amino_acids_0003, etc. For any one sequence of related images, the names must be uniform and include place-holding zeroes. For the purpose of this guide, let’s assume I’m making a simple movie about H-bonds using SPOCK. I create image files “hbonds_0001.tif” through “hbonds_0167.tif” for my close-up sequence on hydrogen bonding. Then, I create a complementary sequence labeled “alt_0001.tif” through “alt_0305.tif” to illustrate the bonding from another point of view.

 

2.)    Make sure your image sequences are in jpeg format (.jpg). You’re all set if you generated your images directly into jpeg. If you have your sequences in some other format (i.e. a .tif generated by SPOCK), we will need to convert them to jpeg before we continue. The best way to do this is through ImageMagick's "convert" command, a command line image processing utility. Here’s a little example script which will search a directory for .tif files, convert any it finds into .jpg, and gzip the original .tif file:

 

      #!/bin/csh

      #

      # convert all tifs to jpgs in this directory, then gzip the tifs

      #

      foreach file ( *.tif )

      set basename = `echo $file | cut -d. -f 1`

      convert -quality 100 $file $basename.jpg

      gzip -v $file

      end

 

            To convert our two H-bond sequences, I can navigate to their directory, execute the script, and get the corresponding sequences in jpeg form.

 

3.)    Launch Adobe Premiere 6.0 and create a new project with settings corresponding to your desired animation parameters. Premiere is available on Painter, a Windows PC in the Core Lab. When you open the program, it will automatically display a “New Project Settings” window. My H-bond images were at a resolution of  794 x 682. So, we need to click on “Custom” on the right side of the settings window and set our initial parameters accordingly:

 

a.)    Select “Quicktime” as the editing mode.

b.)    We will select a timebase of 25fps (frames per second) for our movie, but we can change this later if it’s too fast or too slow.

c.)    Click on “Video” in the drop-down window in the upper-left corner. Choose the appropriate framesize based on your original image size. It doesn't have to be the same size, but it should maintain the same proportions as the original images. For our movie, we’ll set the framesize to 794 x 682.

d.)    Make sure the Pixel Aspect Ratio is set to “Square Pixels (1.0)”.

e.)    Make sure the Quality setting is on 100% and the frame rate is 25fps.

f.)      Don’t worry about the other settings for now.

g.)    Hit OK and move on to the project windows.

 

4.)    Import and Align your sequences in Premiere. Now that we have a project, we can import our two animation sequences and put them in the proper order. To do this, go to the menu bar and click on File à Import à File (or press ctrl-I). Next, navigate to the directory where the image sequences are located and click on the first one in the sequence. Check the “Numbered Stills” box on the bottom of the window and click OK. We now have our first sequence lined up in the “Bin” directory in Premiere. Do the same for the other sequences and they will be listed accordingly. Next, we can drag and drop our sequences from the bin directory to the timeline below and arrange them in any order.

 

5.)    Edit the Movie. Premiere has a comprehensive manual (available from the Core library) which details how to do all sorts of fancy things with your movie, from adding a simple fade, to rolling credits and advanced special effects. For the sake of brevity, I will just add our two animations to the timeline with the “hbonds” series first and the “alt” series next to it.

 

6.)    Export the completed movie with your desired compression settings. Once you’re satisfied with the way the movie looks in Premiere, it’s time to export the timeline to a movie file that can be played in a movie player (i.e. Quicktime or WMP) or streamed from a web site. Go to the menu bar and click on File à Export Timeline à Movie. Here we have a compression settings window. Navigate around and make sure all the settings are what you want for your final output. For our H-bonds movie, I will go to the Video pull-down menu and downsize the resolution to 560 x 480. Again, remember to retain the ratio of your original image. It’s always good to keep resolutions as multiples of 16. The codec (short for "encoder/decoder") that you select in the video menu will be based on what you want to do with the movie when it’s finished. Selecting a codec is also largely a matter of personal preference. So, experiment to find which output you prefer. Below is a list of the most popular Quicktime codecs and a brief description of their use:

 

a.)    Sorenson Video 3 – A widely-used, multipurpose codec which can create high-quality video at low bit rates for web streaming, or ultra-high quality movies for presentations. This is a good codec to start with if you are unsure. It should run with ANY common movieplayer.

b.)    Motion JPEG A – This is what’s called a “lossless” codec. It has no compression algorithm, so you get absolutely no quality reduction. The drawback is you get a movie file that is equal to, if not greater than, the aggregate size of all your source images. The files can get into the hundreds of gigabytes in size, so make sure you have enough space before compiling.

c.)    MPEG 1 – This is a proprietary codec developed about 10 years ago for high-quality, low bit rate movies. It is still in use on some streaming media servers.

d.)    MPEG 4 – The most recent in the MPEG series of codecs, this incorporates a number of advanced compression algorithms to provide extremely high resolution graphics over relatively low bandwidth. MPEG 4 is fast becoming the superior alternative to Sorenson on the web and elsewhere. That being said, the free movie file players on your computer might not support this format (e.g., Quicktime Player earlier than version 6).

e.)    On2VP3 – An open source codec that rivals MPEG 4 and Sorenson. It can produce impressive image quality at low resolutions and data rates. However, it relies heavily on post-processing to clean up the image, so higher resolution files can only be played at full frame rate on fast machines.

 

 Once you’ve selected a codec, you’ll need to specify a data rate for your file. This is usually in KB/sec (Kilobytes per second), but may be in kbps (kilobits per second). Remember that there are 8 bits in a byte and 1,024 Kilobytes in a Megabyte. Therefore, you must adjust your data rate properly to assure you get a movie file of the desired size. Use a data rate calculator if, like me, conversion rates give you massive headaches. If you need to stream your movie over the Internet, I would recommend that you keep the data rate between 60-150KB/sec (roughly 491-1,229kbps), and even lower for a target audience with modem connections. For formal presentation purposes, the sky’s the limit. But, remember that higher resolutions and higher data rates require more processing power. Do a few practice encodes with some small test sequences first before you do your final encode. This will help to determine which resolution and data rate is best for your machine. Once you’ve fine-tuned all your settings, encode away!

 

7.)    Troubleshooting. Premier was not designed to be a conversion and compression tool for streaming media or third-party codecs. As a result, it may lag or crash while encoding. This may happen often, due to the fickle nature of Premier and a dozen other variables. To get around this bug, and if you have enough free disk space, export your timeline to Motion JPEG A and open it using Quicktime 6 (also on Painter). You can now use the “export” option under the File menu in Quicktime to compress into your target codec.