Use GrabPixmap to grab the backbuffer before you do a screen flip. You should in most cases be able to then just dump this to a file as raw data - ie the RGBA data of the pixels, using a regular stream and stream.writebytes() or whatever. Do that for each frame, incrementing the number that you append to the filename of each file. Then use some kind of graphics software that can read in a raw data file, tell it the dimensions and color format, and have it convert all the data to images (or straight to a movie/animation). You should be able to eventually end up with a video.
In my case I cheated a bit, did most of it manually.
I made sure my program was running in fullscreen mode, and I simply inserted:
Repeat; Until KeyHit(KEY_SPACE)
at the end of each loop after the Flip. I would then run the program and of course it will wait at each frame for you to press space. I then use the usual screen-grab option, Apple-shift-3 to take a screenshot of the full screen. This saves a file to the desktop in PDF format with the image in it. You have to be sure to delay a little so that it has time to grab and save the whole image before you press the Space bar otherwise you'll end up with choppiness at the bottom of the screen. Then of course once you hear the harddrive stop clicking or whatever, press space to go to the next frame. I did this, repeated for, say, 300 frames. I then used Graphic Converter to take all of those PDF images and convert them into a quicktime movie (.MOV) file, to create a single animation - also scaled the size down to like 640x480. Of course you can then convert it to an AVI if you want using whatever software you can find to do it. There is one app out there that is pretty much free, I forget the name, and it does let you create AVI, DivX, WMV, Mpeg, etc. I used that. VideoConverter? Not sure.
I hope that helps. It'd be great to have a video module in BlitzMax to let you easily add/modify/delete frames to a video file on disk or in memory, including playback and recording.
|