By Soleil Lapierre
There are several tools available for converting image sequences to video files, including mpeg2encode, ppmtompeg, mencoder and Cinelerra. This page presents a walkthrough showing how to convert a sequence of jpeg images to an mpeg video in Cinelerra. Cinelerra is more than just an encoder though, and you may find it useful for other tasks such as adding sound and titles to your video.
For more information about Cinelerra, please refer to the Cinelerra home page and online documentation.
Start up Cinelerra by typing cinelerra & in your shell. Before loading any files, you should go through the options menus and set your preferences, as some of them affect the way images will be loaded.
Here is the Cinelerra main window:
And the contents of the Settings menu:
First, select format from the Settings menu to get this dialog:
Here, I've left the audio settings alone because I won't be saving any sound in my video (disabling sound is done later). I've set the video for ten frames per second to correspond with the time-spacing of my images, and I've set the frame size and aspect ratio to match my images. For your videos you should use a higher resolution and frame rate.
Apply your changes and close this dialog.
Next, open the Preferences dialog from the Settings menu:
This dialog has multiple panels, selected via the drop box in the upper left. The above image shows the Interface panel, and the image below shows the Playback panel. The other three (Recording, About and Performance) are not relevant to our situation in this course.
The above two images show my preference settings, but it's not terribly important to match these. Use what you prefer. I find that setting "play every frame" is helpful on slow systems to verify that the images play in the right sequence, but it will likely cause the audio to play improperly or not at all.
Here is the File menu contents:
Before running Cinelerra, I've used the 2D fog simulation program that I'm using in my thesis project to render a sequence of 256x256 jpeg images. The files are all names image_NNNN.jpg where NNNN is a sequential frame number. In your case, you will use the images you rendered using Maya, POVray or whatever software you chose.
NOTE: Cinelerra can load JPEG, TGA, PNG and TIFF images. There are tradeoffs here:
The bottom line is, test Cinelerra with a short sequence of images before deciding which format to render your full animation to. Also, be prepared to run out of disk space; you can use /tmp temporarily to hold your images, but please remove them before you log out.
Back to the tutorial. Select the Load Files option in the File menu to get this dialog:
Here I've already selected my images by clicking on the last one and then shift-clicking on the first one. Note the "Insertion Strategy" setting. This option has a big effect on what happens when you click OK, and if you're already editing some video you could lose your work by choosing the wrong strategy. Read the manual and experiment.
After clicking OK, your main window should show your frames on the video timeline:
You may have to adjust the display controls at the lower left corner of the window to get the frames to show up like this.
In this example I'm not doing any fancy editing of the video timeline. I've just loaded my image sequence, and now I want to render it to a video file using the resolution and frame rate I specified earlier. So select Render from the File menu to bring up this dialog:
Type in your output filename, select a video format, set the insertion strategy (you can use this to incrementally append to existing video files, but here I'm creating a new one), and select whether you want audio and video saved. I've turned off audio because I don't have a soundtrack.
By clicking the wrench icon next to the video checkbox, you get a dialog that lets you set the compression details for your chosen video format. Here is the dialog for mpeg:
I turned on "Fixed Bitrate", "Denoise" and "Progressive Frames", and increased the bitrate to preserve more detail. You don't have to choose the same format I did, so long as what you choose will play on the lab computers and the computer you use for your demo.
After setting your compression preferences, close the Video Compression dialog. This will bring you back to the Render dialog. Just hit OK to start generating your video, and you're done.
Here is the short video clip I generated during this example: foo2.mpg. For some reason it won't play in Xanim, probably because of the encoding settings I chose, but it does play in mplayer and some other players as well. Again, do a short test of your planned production pipeline before it's too late to change it. If I had been rendering a long movie and counting on Xanim to play it here, I would be out of luck!
Copyright © 2003 Soleil Lapierre
Last updated May 16, 2003.