[ODE] MPEG library.

David Whittaker david at wowgod.net
Thu Feb 21 20:56:02 2002


Hey everybody.  I noticed someone asking about how to make an MPEG from 
an ODE simulation.  If you're interested in a better solution than screen 
capture, I have created an MSVC dll that captures bitmaps, ppm's, or any 
other type of picture, if you're willing to write a routine that 
separates it out into red, green, and blue components.  It relies heavily 
on Cornell's Dali engine, which is cross-platform, so it probably 
wouldn't take much more than a recompile to get it working under 
Linux/Unix.  The only problem is getting raw pixel output from ODE.  You 
can use glReadPixels for a quick and dirty method, but I've found 
creating a DibSection, rendering into it, and then BitBlt'ing to the 
screen to be much faster on my system.  The only problem with that method 
is that you can't use DrawStuff.  So I pulled the code for DrawSphere and 
stuff into my own application, and created the window on my own.  I don't 
know if Unix has an equivalent to that or not.  Either way, the 
glReadPixels method will work fine, even right alongside of DrawStuff, as 
long as the screen size isn't too big (320x240 max).  It'll just be 
pretty slow.

My class is really easy to use.  You pass the constructor the width, 
height, file name, buffer type (PPM, BMP, or other), and a BYTE pointer 
to the buffer, Then call AddFrame() every time step.  The destructor 
cleans up, or you can use start() and stop() to reset the class for 
another output file.

You can get it from ftp://ftp.wowgod.net/ODE/MPEGout-rel.zip.  This file 
contains a Win32 dll and the header file for your application.  There is 
also an MPEGout-src.zip if that doesn't work for you.  You'll then need 
to go to http://www.cs.cornell.edu/dali/ and get the dali mpeg engine, 
which also requires a couple of other things to be installed.  Please 
note that this is my first attempt at really releasing anything, so go 
easy on me if it doesn't work, download the source, and let me know how I 
could do it better.

Hope it's useful.
------------------------------
David Whittaker, Christian <><
    http://www.wowgod.net
UA BCM:   http://www.uabcm.com