how to build avi file to show clinical data?
-
I have a series of 32 frames of data (all the same size in RGB format) which I would like to show in an AVI format. I don't need any audio, just video. I tried my luck at AVIFileInit() followed by AVIFileOpen(&pfile, name, OF_WRITE | OF_CREATE, NULL); These worked (no error code) and AVIFileCreateStream(pfile, &ps, &strhdr); even worked. When I made my data into a bitmap and tried to insert it with hr = AVIStreamWrite(ps, i, 1, buff, bi.biSizeImage, AVIIF_KEYFRAME, NULL, NULL); my luck ran out. Presumably my strhdr isn't properly defined memset( &strhdr, 0, sizeof(strhdr)); SetRect(&strhdr.rcFrame, 0, 0, (int) bi.biWidth, (int) bi.biHeight); strhdr.fccType = streamtypeVIDEO; strhdr.fccHandler = mmioFOURCC('M','S','V','C'); strhdr.dwScale = 1; strhdr.dwRate = 1; strhdr.dwQuality = -1; // default quality I have no idea what MSVC in fccHandler means, for example. I would like it to work like clock.avi in c:\windows which clicks away at 1 second clicks and it cycles back on itself. Does anyone have any suggestions on a tutorial? Thanks, Ilan
-
I have a series of 32 frames of data (all the same size in RGB format) which I would like to show in an AVI format. I don't need any audio, just video. I tried my luck at AVIFileInit() followed by AVIFileOpen(&pfile, name, OF_WRITE | OF_CREATE, NULL); These worked (no error code) and AVIFileCreateStream(pfile, &ps, &strhdr); even worked. When I made my data into a bitmap and tried to insert it with hr = AVIStreamWrite(ps, i, 1, buff, bi.biSizeImage, AVIIF_KEYFRAME, NULL, NULL); my luck ran out. Presumably my strhdr isn't properly defined memset( &strhdr, 0, sizeof(strhdr)); SetRect(&strhdr.rcFrame, 0, 0, (int) bi.biWidth, (int) bi.biHeight); strhdr.fccType = streamtypeVIDEO; strhdr.fccHandler = mmioFOURCC('M','S','V','C'); strhdr.dwScale = 1; strhdr.dwRate = 1; strhdr.dwQuality = -1; // default quality I have no idea what MSVC in fccHandler means, for example. I would like it to work like clock.avi in c:\windows which clicks away at 1 second clicks and it cycles back on itself. Does anyone have any suggestions on a tutorial? Thanks, Ilan
As usual, searching CodeProject articles is a good place to start - there is an article called "A simple interface to the Video for Windows API for creating AVI movies from individual images" (and here's the link: http://www.codeproject.com/audio/aviutil_.asp[^]) I have no idea how well this article works - it didn't get a great score, but it may give you some tips.