Solved

AVIStreamGetFrameOpen

Posted on 2001-07-01
6
1,492 Views
Last Modified: 2013-11-20
Hi,

I got a problem with AVIStreamGetFrameOpen, it keeps failing returning a null pointer.  The problem occurs only when I specify the bitmapinfoheader which i want to!

Code Fragment:


BITMAPINFOHEADER wanted;

wanted.biBitCount = 8;
wanted.biClrImportant = 0;
wanted.biClrUsed = 0;
wanted.biCompression = BI_RGB;
wanted.biPlanes = 1;
wanted.biSize = 40;    
wanted.biXPelsPerMeter = 0;
wanted.biYPelsPerMeter = 0;
wanted.biHeight = 300;
wanted.biWidth = 300;    
wanted.biSizeImage = (((wanted.biWidth * 3) + 3) & 
                      0xFFFC) * wanted.biHeight;  

getFrame = AVIStreamGetFrameOpen(avi, &wanted);
ASSERT (getFrame != NULL);
0
Comment
Question by:RichJackson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 2

Expert Comment

by:GloriousRain
ID: 6243618
Hi,
As your code shows:
...
biCompression = BI_RGB
...
"The problem
occurs only when I specify the bitmapinfoheader which i want to!
"->to any RGB format, the function returns NULL.
0
 

Author Comment

by:RichJackson
ID: 6244379
Why would it do that?

It should return a pointer to a get frame object.

I tried BI_BITFIELDS and BI_RLE8

In Delphi making the equivalent API calls works!




0
 

Author Comment

by:RichJackson
ID: 6246508
What I am saying is, there was nothing with this BITMAPINFOHEADER when i made the AVI API calls from Delphi.

Anyone any clues??


0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 49

Accepted Solution

by:
DanRollins earned 100 total points
ID: 6246865
From MSDN:

If the system cannot find a decompressor that can decompress the stream to the given format, or to any RGB format, the function returns NULL.

Therefore, ... Try

   getFrame = AVIStreamGetFrameOpen(avi, 0);
or
   getFrame = AVIStreamGetFrameOpen(avi, AVIGETFRAMEF_BESTDISPLAYFMT);
 
-- Dan
0
 

Author Comment

by:RichJackson
ID: 6268391
Cheers Dan, My mistake.  I was asking for the CODEC to give me a different sized image, to what it was.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 6300861
Hi RichJackson,
I'm sure that you feel it was a kind thing to award me some points even thought my answer did not solve your problem.

But I'm here to inform you that a C grade in response to a comment is considered an insult.  I see that you tend to give out a lot of C's, so I'd like to remind you to please read the EE grading guildelines:
 
  http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp#3

If you cannot get a complete answer, you should post additional comments ansking for clarifications or delete the question.

Thanks,

-- Dan
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question