Capturing video

Archives Forums/MacOS X Discussion/Capturing video

Koekelas(Posted 2005) [#1]
How can I capture a video of my game in action?


Thanks, Nicolas.


ImaginaryHuman(Posted 2005) [#2]
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.


Koekelas(Posted 2005) [#3]
It's an awful lot of work but it works and that's what counts. Thanks, AngelDaniel.


Nicolas.


Todd(Posted 2005) [#4]
There is an app called Snapz Pro X, which, among other things, allows you to record QuickTime videos of your screen. It might be worth looking into, although I'm not sure how well it does with OpenGL applications (like BlitzMax).

Also, QuickTime Pro can convert numbered images (i.e. ScreenShot01.jpg, ScreenShot02.jpg, etc.) into a QuickTime movie if you've bought QuickTime Pro. Just choose "Open Image Sequence" from the File menu and export it back out as a movie.


Koekelas(Posted 2005) [#5]
Well I used iMovie to make a movie out of the images :).


Nicolas.


TLM(Posted 2005) [#6]
You can use iMovie to do that? Cool, learn something new everyday..


Koekelas(Posted 2005) [#7]
I imported the images into iPhoto so iMovie can see them. Then I fired up iMovie and dragged the images to the time line :).


Nicolas.


KamaShin(Posted 2005) [#8]
Did you know that quicktime can do this with one click??? just use File/Import picture sequence (or something like that, don't knwo for sure, my quicktime is in french) and then choose the first picture of you sequence... pictures have to be in the same folder and sorted by name...
It will even let you choose the frame rate at wich you want to import the pictures...


Koekelas(Posted 2005) [#9]
Isn't this a Pro only feature?


Nicolas.