Real time extraction of avi frames

I can use some help on the following:

in a program of mine i want to extract a frame of an avi while its running. In a separate thread, this frame is then analysed and the result is shown in a TImage (as a TBitmap).

I've tried using the VFW.pas, along with some code to handle this unit, but i failed to implement it just yet. It seems that sometimes (due to memory shortages?) the VFW doesn't correctly extract the frames from the AVI. Also, i've only extracted frames from an AVI stored on my HDD, and thus, not real-time.

Here is what i want:
How to extract IN REAL TIME the current frame from a running AVI? This avi should be shown together in the same app.

I'd really love some code for this, but if that isn't possible, could you point me to some resources where to find out how it should be done?

Also, if you point me to a component, please make sure its free to use, so no shareware or other commercial license can be allowed.

Thanks in advance!
Evarest
LVL 4
EvarestAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TheRealLokiSenior DeveloperCommented:
there's a writeup on how to do this with delphix double buffering (no vfw capture device required)
Delphi x is DIrect-X for delphi :)
http://delphi.about.com/library/bluc/text/uc092700b.htm
(also http://www.delphipages.com/news/detaildocs.cfm?ID=39 )

hope that helps. The only other resource I have is a file to read avi files manually (as a stream) and I'm not sure that will give you all the info you require
0
EvarestAuthor Commented:
Sometimes, things can be so easy that one starts to search in the wrong direction :-)

In my case the solution was to simply place a TMediaPlayer on a Form and set the Display to a TAnimate component or something similar. Then BitBlt the DC of the TAnimate to a TBitmap (place this in a TTimer) and I get a nice Frame extraction routine without a lot of fuss :-)

I don't use the screen capture, as the solution i now use one requires ~10 lines... Doing it with a screen capture, would be a detour, but it should result in the same...

Problem solved...

Cheers!
Evarest
0
TheRealLokiSenior DeveloperCommented:
looks like he solves his own problem
0
moduloCommented:
PAQed with points refunded (350)

modulo
Community Support Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.