Solved

AVIStreamGetFrameOpen

Posted on 2001-07-01
6
1,416 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
Comment Utility
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
Comment Utility
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
Comment Utility
What I am saying is, there was nothing with this BITMAPINFOHEADER when i made the AVI API calls from Delphi.

Anyone any clues??


0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 49

Accepted Solution

by:
DanRollins earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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 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.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

772 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

11 Experts available now in Live!

Get 1:1 Help Now