How to capture movie
For CS4451B and CS6491
prepared
by Mitch Parry
<parry@cc.gatech.edu>
Here are some suggestions for how to create movie files from your
graphics program.
SGI
If you are programming in C or C++ on a UNIX machine, you can use the dmedia
and moviefile libraries.
These libraries only
run on SGI machines (SGI lab in CoC).
To
help you do this, you can cut-and-paste the code in
movie.c
into your OpenGL program.
At the bottom of the
file there is a sample main program.
Before
you draw anything, call createMovie().
Every
time you update the framebuffer with a new image, call addMovieFrame().
When the animation is over, call endMovie().
You will have to modify the code in movie.c to fit
with your program.
For example the variable
‘win’ does not exist.
It’s really a placeholder
for attributes of your window (width and height).
The
code is well commented and requires that you add the libraries “-ldmedia
–lmoviefile” to your Makefile.
This code generates
VERY big movie files.
Once you create one,
you will want to compress it with “mediaconvert”.
You
can view a movie with “mediaplayer”
Other Operating Systems
If you don’t have access to the SGI cluster, or aren’t too keen on
UNIX, you can cut-and-paste
movie-win.c
into your OpenGL program.
This code will write
the contents of the frame buffer to a specified image filename in PPM
format.
You will need to make small changes
to the code to make it fit with your program.
Windows
The next step is converting the PPM files to JPG (PPMs are VERY big).
If you are using windows, you can download
Image Converter .EXE 2.0.36 for free from
http://download.com.com/3000-2192-10133489.html?tag=lst-0-5
.
You can use it to convert a folder full of
PPM files into JPG files.
To combine your JPG
images into an AVI movie file you can download Slide Show Movie Maker free
from
http://download.com.com/3000-2194-8471301.html?tag=lst-0-3
.
Other Programming Languages
The code in
movie-win.c
uses the GL function glReadPixels().
There is
surely a comparable command in other graphics APIs.
The rest you’ll need to translate to the programming language of
your choice.
If you have trouble finding image
converters or movie makers, you can always scoot over to a windows machine
and follow the above advice for making movies from a series of images.