Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

AVIStreamGetFrameOpen Problem

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
No replies to this topic

#1 Lyev   Members   

118
Like
0Likes
Like

Posted 19 May 2012 - 03:58 AM

First of all I learnt how to do this from http://nehe.gamedev....n_opengl/23001/
AVIStreamGetFrameOpen is always returning NULL. I checked to see if I could open the AVI file in windows media player and that worked, so that means it can't be a codec problem, right? I'm not too sure. All the variables have valid values before the call to AVIStreamGetFrameOpen
Here's my code:

if (AVIStreamOpenFromFile(&avi, file, streamtypeVIDEO, 0, OF_READ, NULL) != 0)
  return;
AVIStreamInfo (avi, &info, sizeof(info));
w = info.rcFrame.right - info.rcFrame.left;
h = info.rcFrame.bottom - info.rcFrame.top;
lastframe = AVIStreamLength (avi);
mpf = AVIStreamSampleToTime (avi, lastframe) / lastframe;
header.biSize = sizeof (BITMAPINFOHEADER);	
header.biPlanes = 1;		 
header.biBitCount = 24;		 
header.biWidth = BITMAP_WIDTH;		 
header.biHeight = BITMAP_HEIGHT;		 
header.biCompression = BI_RGB;	  
bitmap = CreateDIBSection (hdc, (BITMAPINFO*)(&header), DIB_RGB_COLORS, (void**)(&data), NULL, NULL);
SelectObject (hdc, bitmap);
pgf = AVIStreamGetFrameOpen (avi, NULL);
if (!pgf)
  return;

Edited by Lyev, 19 May 2012 - 03:59 AM.





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.