Reputation: 3360
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
Reputation: 1553
There's a somewhat elderly but potentially useful implementation of frame grabbing with a MediaPlayer here:
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