[Webinar] Learn how to a build a cloud-first strategyRegister Now


Real time extraction of avi frames

Posted on 2004-11-02
Medium Priority
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
  • 2
LVL 17

Expert Comment

ID: 12477679
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 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

Author Comment

ID: 12478813
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

ID: 13341610
looks like he solves his own problem

Accepted Solution

modulo earned 0 total points
ID: 13499223
PAQed with points refunded (350)

Community Support Moderator

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month20 days, 12 hours left to enroll

864 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