Hello goren,
before you can access a pixel of an AVI frame, you must decrompress it (nearly all AVIs are comressed).
See following example; hope this will help you
-Klaus-
=====================================================
PAVIFILE pAviFile;
PAVISTREAM pVideoStream;
ULONG Result;
ULONG FrameNr;
LONG BytesRead;
static BYTE Buffer[2000000];
AVIFileInit();
Result = AVIFileOpen (&pAviFile, "D:\\TEMP\\SAMPLE.AVI", OF_READ |
OF_SHARE_DENY_WRITE, NULL);
if (Result)
{
... cleanup, display error and return
}
Result = AVIFileGetStream (pAviFile, &pVideoStream, streamtypeVIDEO,
0);
if (Result)
{
... cleanup, display error and return
}
PGETFRAME pGetFrame;
pGetFrame = AVIStreamGetFrameOpen (pVideoStream, NULL);
if (!pGetFrame)
{
... cleanup, display error and return
}
FrameNr = 0; // first frame
LPBITMAPINFO *pBitmapInfo
*pBitmapInfo = (LPBITMAPINFO)AVIStreamGetFrame(pGetFrame, FrameNr);
// NULL on error or no more frames
if (pBitmapInfo)
{
// here you have the complete Frame as a DIB (device independant bitmap)
// the header contains the format, followed by the real pixel data
// process bitmap . . .
}
AVIStreamGetFrameClose (pGetFrame));
... cleanup and return
===========================================================