reading video frame by frame

chathu

Newcomer
Joined
Jul 24, 2003
Messages
2
can somebody please tell me how to break a video into frames for analysis with directX 9 with C++. I have no previous experiance in using directx .
 
First install the DirectX SDK. Then look at the sample folder at:
C:\DXSDK\Samples\C++\DirectShow

There used to a sample in the Direct3D folder for showing a spinning cube and putting an AVI (as a texture) on each face of the cube. I didn't look at the code, but I assume it had a way to load each frame of the video one frame at a time and get it into a texture object. You can lock a texture and look at the color bits that way.

I'd first take a look at the DirectShow samples and see what you can see.

By the way, if you're not already very good at programming, DirectX may be a bit much to take in.

-Nerseus
 
Thanks for the reply.
Is there any other method that you recommend for reading a video frame by frame for analysis other than directX. I have to use VC++ for this project.
Chathu
 
Is there any other method that you recommend for reading a video frame by frame for analysis other than directX
Well, you posted in the DirectX forum :)

If you know the video type (AVI, MPG, etc.), you can search google to find information about the format, but you'd have to write the decoder yourself.

There are some free decoders available at SourceForge. I've seen some GUI tools that are Open Source that use the Open Source libraries. By looking at the code for either of those, you should be able to find what you're looking for. This isn't going to be an afternoon or even a weekend's worth of looking around and then writing an app to take out each frame though. Manipulating images is a tough business, even with source code provided to you.

-Nerseus
 
Nerseus:
DirectX 9 has a special event for the texture thing:
Visual Basic:
'Loading AudioVideoPlayback.Video
AddHandler videoTexture.TextureReadyToRender, AddressOf Me.RenderIt

Sub RenderIt(ByVal sender As Object, ByVal e As TextureRenderEventArgs)
            'Set our texture so we can render it
            texture = e.Texture
            RenderTexture()
        End Sub
 
Can you work it this a little bit...


So for example: I want to capture frame number 100 or the frame on the time '8,43 seconds'

??

How?
 
Back
Top