Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
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 .
  • *Experts*
Posted

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

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

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

  • *Experts*
Posted
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

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

Nerseus:

DirectX 9 has a special event for the texture thing:

'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

.Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...