Archived

This topic is now archived and is closed to further replies.

getting frames from an AVI/MPEG file

This topic is 5872 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am using the method IBasicVideo::GetCurrentImage to read frames from an AVI file. I have noticed that this method is very slow. When getting a frame from a USB camera (also using the DirectShow interface), I have much faster response time. Is there another alternative ? Sanjeev.

Share this post


Link to post
Share on other sites
Not entirely sure but u could use DirectShow to read video files (using DShow codecs) the same way programs like FlaskMPEG do it. The FlaskMPEG source code is available for download, download it and analyze the source files to see how they did it.

U could also look at the DirectShow sample applications bundled with the DX8 SDK.

Hope this helps

Downloads, D3DXSprite tutorial, New platform game: .-= The ZeroOne Realm =-.

Share this post


Link to post
Share on other sites
The info I found out about FlaskMPEG is that it is a tool for DVDs - used to encode files in MPEG or AVI formats. I can download the source code, that may be interesting. However, I am not sure whether that may answer my original question.

Currently, I am using DirectShow to read video files, in this case specifically AVI files. What bothers me is why is the function IBasicVideo::GetCurrentImage very slow in execution. What is mentioned in MSDN is that this method should be avoided when using DirectDraw acceleration. What other method can one use in that case ?

Share this post


Link to post
Share on other sites
I''ve never done this with video before, but I''m sure you can use the windows Codec System to do decoding. It will be a bit more complex then the simple GetFrame call, since you will have to load a block and decompress the whole block (compression stores stuff in blocks). But once you have a block decoded you can read it frame by frame. You will also have to parse the AVI file header to get the needed information such as compression codec, data start, block size etc.

Yes this is a bit more work, but look at it this way. Once you have the code written into a nice class it''s always there to use later.

-Zims

Share this post


Link to post
Share on other sites