help: how to Grab System.Drawing.Image from a video

Topics: User Forum
Mar 29, 2007 at 7:43 AM
I need some help to find how to Grab System.Drawing.Image from a video at specified position (seconds).

TIA, Marco
Coordinator
Mar 29, 2007 at 10:05 AM

markfind wrote:
I need some help to find how to Grab System.Drawing.Image from a video at specified position (seconds).

TIA, Marco


Hi Marco,

This can be easily achieved... first off I would suggest you grab the latest source code release and compile it yourself... the last "zipped" release is out of date, I'm awaiting for some additional community contributions before making another official release at this point.

Once you've got it compiled, have a look at the ICallbackParticipant interface, classes implementing this interface can intercept and capture or manipulate information as it's being rendered... in combination with a NullRenderer you can effectively "replay" the video and capture only those frames your interested (at the correct point in time).

We provide an example participant ImagesToDiskParticipant which captures images to disk, you should be able to create your own version which captures the images you want at the appropriate times, at which point you can do whatever you want with them.

Here's the code for the ImagesToDiskParticipant:

http://www.codeplex.com/splicer/SourceControl/FileView.aspx?itemId=121404&changeSetId=16374

...and also the test fixture which demonstrates using it with a null renderer:

http://www.codeplex.com/splicer/SourceControl/FileView.aspx?itemId=126276&changeSetId=16374

Let me know how you get on.

Cheers,

- Alex
Mar 29, 2007 at 12:19 PM
I have tested test code, but execution wait forever _renderResult.AsyncWaitHandle.WaitOne(); on EndRender method, even producing images.