Hello,
I'm trying to read the pixels, i.e. the raw data of an AVI File. How do I do that ?
I am searching for something like GetPixel(x,y,FrameN) ???
Thanks
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-
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
===========================================================
However, I'm not so knowledgable in DIB's, also.
What variable contain the DIB, in the program?
How do I access the specific pixels in the given frame/DIB ?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.