Solved

AVIStreamGetFrameOpen

Posted on 2001-07-01
6
1,477 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maven archtype selection in eclipse 1 58
Execute multiple curl cmds with sleep and send output to file 10 115
wordappend challenge 8 225
Path of Workbook 3 87
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…
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. …
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

730 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