471,618 Members | 1,487 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,618 software developers and data experts.

Quick DirectShow question

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
Feb 6 '06 #1
2 2203
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Andrew Bullock" <an*********************@ANDntlworldTHIS.com> wrote in
message news:j7******************@newsfe6-win.ntli.net...
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

Feb 6 '06 #2
Nicholas Paldino [.NET/C# MVP] wrote:
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
Feb 6 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.