I tried to use the open source mencoder (included with the mplayer build for Windows ) and mjpegtools (an executable is available in the DVDAuthor package ) programs to encode movies. I could not get mjpegtools to work with my input stream. The vast majority of the movies created by mencoder (even when in "standard" formats) are not cross-platform (they only play in open source software such as VLC , and they do not play in Windows Media Player nor QuickTime). I found a single format which does work with Windows Media Player: the
mencoder in.avi -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=2000 -o out.avi
The video can also be encoded directly from the output of
glReadPixels  via:
mencoder -demuxer rawvideo -flip -rawvideo w=1024:h=768:format=rgb24:fps=15.0 in.raw -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=2000 -o out.avi
in.raw is a concatenated sequence of raw 1024x768 24-bit RGB frames at 15 frames/sec. For this image size and framerate, the raw video requires roughly 2 GB of space per minute of footage. The created videos do not play in QuickTime; however, they can be played on Mac and Linux with the VLC player.