Nicke Manarin
Nicke Manarin

Reputation: 3360

Import frames from a video

I'm using MediaPlayer to open a video and DrawingContext.DrawVideo() to get a specific frame from a video source.

The problem is that I can't know if the MediaPlayer is positioned at the right place.

Therad.Sleep(500) is a hack.

Is there another easy way of getting frames from a video source? Or should I start looking for a DirectShow solution?

Upvotes: 2

Views: 156

Answers (1)

goobering
goobering

Reputation: 1553

There's a somewhat elderly but potentially useful implementation of frame grabbing with a MediaPlayer here:

dlaa.me/blog/post/8921665

Here is the simple structure of the media grabber:

LoadVideo();
//Add event handler to the Changed event.
GetFirstFrame();
//Change video Position.
//When the Changed event fires: 
GetCurrentFrame();

Upvotes: 1

Related Questions