1

I am developing C# desktop application and referring this link to Play video file http://www.codeproject.com/Articles/2632/DirectShow-MediaPlayer-in-C , now from this playing video file ,when I click on this panel (shown in above link ) how to capture Images from playing video file,I searched but I found all examples showing capturing Images from some device(for eg.webcam,etc..) ,In my case Its not device it's file which I am browsing from Directory and Playing ,as I am new to this Video capturing Please direct me how I can do this

Roman R.
  • 68,205
  • 6
  • 94
  • 158
Durga
  • 1,283
  • 9
  • 28
  • 54

3 Answers3

2

"Capture" normally refers to image acquisition when you obtain the image from external source. You want to take a copy of currently displayed video frame instead. There are several ways to do it and when it comes to playback when video is being visualized, the video renderers typically offer GetCurrentImage method which returns a copy of currently displayed video frame, possibly even converted to RGB.

Method syntax slightly differs between video renderer versions.

See previous topics on achieving this:

Community
  • 1
  • 1
Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • I searched a lot and referred above links ,but all of them show capturing frame from device. can you please direct me to some code that captures images from ,playing video file that is selected from directory ,I am not understanding How do i capture frame on click event – Durga Oct 20 '13 at 14:33
  • The first link above captures video from presentation component. It does not matter whether the source is a device, or a file - the copy of the currently displayed frame comes from visualization component which is the same/similar. – Roman R. Oct 20 '13 at 14:54
  • Can You Please tell In first link Where I will get `IBaseFilter` `IEnumFilters` class code ,because I am getting error as missing namespace for this,hence I am not able to understand what exactly these does,Or am i missing some library or dll to include here ? – Durga Oct 20 '13 at 15:07
  • It's [DirectShow.NET](http://sourceforge.net/projects/directshownet/files/): one folder is the library itself and the other is sample pack I referred to in the answer above. – Roman R. Oct 20 '13 at 16:59
0

You need a filter which captures screen and sends the video down the stream.

In the DirectShow Library there is a sample filter called PushSource and inside there is PushSourceDesktop.

At Codeplex there are Examples like this (Click me) or Information (Click me) about Filters.

0

You can also use a "SampleGrabber" DirectShow filter: just place it in the filter chain between your source filter and render filter.

More info about SampleGrabber: see MSDN

dymanoid
  • 14,771
  • 4
  • 36
  • 64