Real time extraction of avi frames

Posted on 2004-11-02
Last Modified: 2010-04-05
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!
Question by:Evarest
    LVL 17

    Expert Comment

    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 :)
    (also )

    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
    LVL 4

    Author Comment

    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...

    LVL 17

    Expert Comment

    looks like he solves his own problem

    Accepted Solution

    PAQed with points refunded (350)

    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
    Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video discusses moving either the default database or any database to a new volume.

    779 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

    19 Experts available now in Live!

    Get 1:1 Help Now