2

I am using Windows Media Player control in a winforms app, I would like to periodically capture the playing frame into a bitmap and save it locally. Does WMP expose the current playing frame? Surely the WMP librarty should expose the current frame, but I have looked all over for it to no avail...pls help.

p.s. I am looking for a more elegant approach than the hack method of capture the screen and cropping it.

Mikos
  • 8,455
  • 10
  • 41
  • 72
  • They might intentionally now expose this as a way to impose DRM. If you could grab the frame, you could continually advance the video 1 frame at a time, and capture all the frames, effectively copying the video. This is how some of the original DVD copiers worked using framegrabbers. Audio could be captured by recording the sound card output. As you can imagine, these old copiers had lots of problems with the audio and video not syncing up. – Kibbee Apr 12 '11 at 19:47
  • Is there a way of extracting the frame? The Video I am working has no DRM. – Mikos Apr 12 '11 at 20:13
  • I'm unsure as I haven't used it, I was just giving a little history lesson and reason as to why they might just explicitly not include this functionality. Even taking a screen shot sometimes yields odd results when playing a video depending on the type of video card, driver, and what type of rendering method is being used. – Kibbee Apr 12 '11 at 20:38
  • Ok, thanks. There has got to be a way of getting the frame... – Mikos Apr 12 '11 at 22:07

1 Answers1

0

http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/994554ec-219e-4090-9ddf-befd51bd4912

The answer is to use a DrawingVisual, DrawingConext and RenderTargetBitmap. Some discussion of it above.

Sugrue
  • 3,629
  • 5
  • 35
  • 53