Solved

AVIStreamGetFrameOpen

Posted on 2001-07-01
6
1,439 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Different colored text in ComboBox without Subclassing 8 55
VB.NET how to use the Vertical ScrollBar 5 90
Adapt this command to show who installed 29 106
sum67 challenge 35 93
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

863 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now