Reputation: 1063
I have written an academic simulation software. The simulation results are stored in a 2D memory array of 1byte values (mapped to 256 colors).
I need to write a class which reads the array in determined intervals and creates a video file out of it. The format is not important (as long as it is popular).
Is there a C++ wrapper class (over windows APIs) or library which can easily do this for me?
Upvotes: 3
Views: 6781
Reputation: 8735
A simple solution is to use the "Video for Windows API". This set of functions is built into Windows and allows you to create AVI files with various video codecs from a series of bitmaps. You can optionally record audio with it as well. Here is a link to a sample project which demonstrates how to use it:
http://www.codeproject.com/Articles/4169/A-simple-interface-to-the-Video-for-Windows-API-fo
The functions are very high level and don't require a wrapper to use them. At the simplest level you will be calling:
AVIFileOpen();
AVIFileCreateStream();
AVIStreamWriteData(); // repeat for each frame
AVIStreamRelease();
AVIFileRelease();
You can pass each frame as a DIB (device independent bitmap) to the stream and it will create video from your individual frames.
The API documentation is here:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd756804(v=vs.85).aspx
Upvotes: 4