As noted, this dll is very bare-bones. I might come back to it and add a few features to it if it gathers any sort of interest. Any suggestions are of course welcome.
The three functions are as follows:
vcapture_begin( window_handle, filename, fps)
Deletes any file currently occupying filename, creates an avi file in its place and prepares it for recording. The DLL can only record into one file at a time. Pass window_handle() as the first argument, and the video's playback FPS as the third.
When this function is called, the game will pause and the user will be presented with a dialog to select a codec with which the video will be compressed. For some codecs, compression settings can be modified within the dialog. Only codecs installed on the host system will be displayed.
If the user selects Cancel on the dialog, this function returns false (and the following functions will cause your game to hang). Otherwise, the function will return true.
Takes a snapshot of the game, and appends it into the current video file. This can probably be called anywhere outside a Draw event. If the window is minimized, out of focus or outside the desktop area, the frame appended will be incorrect. Bear in mind that this function's speed is dictated by the codec and compression settings used.
Ends all video capture operations and finalises the .avi file. The video's filesize will not be visible until this function is called. Once this function has been called, vcapture_begin can be called again to start a new video file. If your game ends after calling vcapture_frame but before calling this function, the file will fail to save and you'll most likely be left with a memory leak.
A few words of warning:
- I haven't tested, or accounted for, what happens when the functions are called out of the correct sequence. Memory leaks seem likely.
- Never use any codec marked as "uncompressed". They will leave you with a ridiculously large filesize, as large as a hundred megabytes for a couple of seconds of video. Ideally, to make best use of this tool, you should download a popular modern codec such as DivX or XVid.
- Not every codec in the list is guaranteed to work. If some codecs don't save frames into the target file, it's probably not the fault of this dll.