This article describes a simple interface to the Video for Windows API for creating AVI movies from individual images. The idea for this code comes from a Microsoft sample that was very unfriendly to use. With that in mind, I created this code to easily create an AVI from individual images.
The steps are:
START_AVI("foo.avi"); // you must include the .avi extention.
ADD_FRAME_FROM_DIB_TO_AVI(yourDIB, "DIB", 30); // the dib is passed in as a HANDLE which can be obtained by loading the image with a Image library. (I used
CxImage which is available on this site). Put this call in a
for loop to add all the images you want to the AVI.
STOP_AVI(); //this closes the avi and video.