Click here to Skip to main content
15,878,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi!

I am trying to get an image from an avi file. This was my idea of how to implement it:

C#
manager = new AviManager(AviPath, true);
                stream = manager.GetVideoStream();
                stream.GetFrameOpen();

                stream.ExportBitmap(stream.FirstFrame, @"C:\test.bmp");


Sadly I always get an error in the GetFrameOpen() line. All it says is "Exception in VideoStreamGetFrameOpen!" without an inner exception or anything else.

I tried to just remove the line but then I'll get the error in the ExportBitmap line of type NulReferenceException.

The problem might be that my video is pretty small and has weird values:

CountBitsPerPixel 24,
CountFrames 1275,
FirstFrame 0,
FrameRate 15,
FrameSize 5184,
Height 1728,
Palette null,
Width 1

Does anybody see my mistake?
Thanks in advance!

What I have tried:

C#
manager = new AviManager(AviPath, true);
                stream = manager.GetVideoStream();
                stream.GetFrameOpen();

                stream.ExportBitmap(stream.FirstFrame, @"C:\test.bmp");
Posted
Comments
phil.o 7-Jun-16 5:56am    
Where does the AviManager class come from?
Member 12569506 7-Jun-16 5:59am    
It's from a lib I found here:

http://www.codeproject.com/Articles/7388/A-Simple-C-Wrapper-for-the-AviFile-Library
George Jonsson 7-Jun-16 6:13am    
The obvious answer would be that you should post your question in the Comments and Discussions section of the article. However, it doesn't seem like the the author has been active recently.
You should try it there anyway, chances are slim that anyone here wants to debug the code for you.
Or you could debug the code yourself. Looks like there is a link for downloading the source code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900