Quick DirectShow question

A

Andrew Bullock

Hi,

I'm trying to use direct show to grab arbitrary frames from a DV .avi.

I'm using the PlayWnd code from this example:
http://www.codeproject.com/cs/media/directshownet.asp

Currently an IGraphBuiler is cast to an IVideoWindow, which is passed
the Handle of a picturebox to display the video in.

How can I grab the video directly into a bitmap object?


Thanks

Andrew
 
N

Nicholas Paldino [.NET/C# MVP]

Andrew,

I don't like this example, personally. I think you would be better
using the ISampleGrabber interface and hooking into the video stream. For
AVI files, these samples ^should^ be in Bitmap format.

There is a library called DirectShow.NET, which has a good number of the
interfaces for DirectShow defined in a .NET assembly. You can use these to
access the render graph and insert your filter.

Here is a link to a good example of how to do this:

http://www.a2ii.com/tech/directx/tutorialDS6.htm

Hope this helps.
 
A

Andrew Bullock

Nicholas said:
Andrew,

I don't like this example, personally. I think you would be better
using the ISampleGrabber interface and hooking into the video stream. For
AVI files, these samples ^should^ be in Bitmap format.

There is a library called DirectShow.NET, which has a good number of the
interfaces for DirectShow defined in a .NET assembly. You can use these to
access the render graph and insert your filter.

Here is a link to a good example of how to do this:

http://www.a2ii.com/tech/directx/tutorialDS6.htm

Hope this helps.


Hi,

I need to be able to move through the video frame by frame.
IMediaPosition only lets me do it by time, which isnt accurate enough as
i'm only provided with an average frame time by the IBasicVideo :(

Isn't there a (efficient/quick) way to do what i'm trying to do?

Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top