Jan 9, 2018 at 5:23pm
Hi,
I developed code below to convert frames bmp to avi, but it does not work.
Could you help me?
AVIFileInit();
hr = AVIFileOpen(&pFile, file_name, OF_WRITE | OF_CREATE, 0);
strhdr.fccType = streamtypeVIDEO;
strhdr.fccHandler = 0;
strhdr.dwScale = 10;
strhdr.dwRate = 1000;
strhdr.dwSuggestedBufferSize = cbImage;
SetRect(&strhdr.rcFrame, 0, 0, newX, newY);
hr = AVIFileCreateStream(pFile, &ps, &strhdr);
opts.fccHandler=mmioFOURCC('D','I','B',' ');
hr = AVIMakeCompressedStream( &psCompressed, ps, &opts, 0);
bitmapheader.biWidth = newX ;
bitmapheader.biHeight = newY;
bitmapheader.biPlanes = 1;
bitmapheader.biBitCount = 24;
bitmapheader.biSizeImage = cbImage;
bitmapheader.biSize = bfSize;
hr = AVIStreamSetFormat(psCompressed, 0, &bitmapheader, headersize);
hr = AVIStreamWrite( psCompressed, 0, 1, ptImg, cbImage, AVIIF_KEYFRAME, 0, 0);
if(psCompressed)
hr = AVIStreamRelease(psCompressed);
if(ps)
hr = AVIStreamRelease(ps);
hr = AVIFileRelease(pFile);
AVIFileExit();