A simple interface to the Video for Windows API for creating AVI movies from individual images






3.54/5 (18 votes)
May 20, 2003

217303

4280
A simple interface to the Video for Windows API for creating AVI movies from individual images.
Introduction
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:
include "aviUtil.h"
.- Call
START_AVI("foo.avi"); // you must include the .avi extention
. - Call
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 usedCxImage
which is available on this site). Put this call in awhile
orfor
loop to add all the images you want to the AVI. - Call
STOP_AVI(); //this closes the avi and video
.