Hello,
I would like to create an avi-file from a sequence of images. The images are stored as "cppBITMAP2.bmp" (during the loop the image gets updated). In this loop I want to create a video from these images.
What I have tried:
I found this:
A simple interface to the Video for Windows API for creating AVI movies from individual images
Here, I tried to use the code without MFC from the comments but it did not work.
I copied the relevant part of my code (at least I think it is the relevant part) which uses the aviUtil.h file from the comment of the link):
SetDIBitsToDevice(_backbuffer,x,y,width,height, 0, 0, 0, (UINT)height,
data, &bmi, DIB_RGB_COLORS);
vbitmap = CreateDIBitmap(_backbuffer, &bmi.bmiHeader, CBM_INIT, data,
&bmi, DIB_RGB_COLORS);
PBITMAPINFO bbitmap = CreateBitmapInfoStruct(this->_window, this-
>_backbitmap);
CreateBMPFile(this->_window, "cppBITMAP2.bmp", bbitmap, this -
>_backbitmap, this->_backbuffer);
lpbi = (LPBITMAPINFOHEADER)GlobalLock("cppBITMAP2.bmp");
ADD_FRAME_FROM_DIB_TO_AVI(lpbi, data, "DBI", 10);
Here, I get an access violation error and the created avi-File is empty. The lines for the bitmap creation work well. Did I call the
ADD_FRAME_FROM_DIB_TO_AVI
function wrong?
I am completely new to c++ and would be really grateful for your help.