Click here to Skip to main content
13,043,654 members (50,102 online)
Rate this:
Please Sign up or sign in to vote.
See more:
My appolgies, I have tried Googling & Bling this for the past few days and have come across so many ideas many of which may be outdated. It is doing my head in! Before I set off on one of them - MediaDet, AForge etc I would appreciate a sounding of what is the current easiest WPF way to ...

I would like to be able to process a video file frame by frame and do motion detection by processing and comparing consecutive frames. The processing I am OK with as I currently get a series of Jpegs from my Camera and it works, but I need to be able to take a vid file (MOV) in to allow further off line development and tuning.

I would prefer to stay in the WPF framework (I'm not good with interop etc) and prefer not to use third party libraries to avoid longer term dependancies. In an ideal world I would just like to feed the file to a WPF MediaElement or MediaPlayer and be able to snatch the bitmap on some Frame updated event - but I cannot see a way of doing that. Alternatively my test clips (MOV) are short so pre-process into a series of Jpegs - but again how to read the frames?

Any thoughts - please be gentle ... I'm not an expert and know little of Video, GraphBuilders etc!!

Many thanks.
Alan Smith.
Posted 23-Jun-10 7:55am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I haven't actually built WPF apps on 4.0 that deal with media but I did in the 3.5 bits. Actually, I worked in this space for a year and a half, and unfortunately, you're not going to be able to do it without creating your own graph (and a bunch of back-and-forth with DirectShow) or using a third party library to get you started.

Here's one[^] that looks promising for what you're trying to do (and is written by an active blogger). The project has current posts on CodePlex.

This is just a technicality, but a pure WPF solution is not possible. WPF is really more about the display, not file I/O and image processing. You can use it to render the current state of you innards while chugging through your frames, but stand-alone WPF can't do this one.

Good luck mate.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

It does not work for mp4 or mov files !!!
Christian Graus 12-Aug-11 18:11pm
This is not an answer, don't push answer to add random comments. mp4 and mov files work with directX, so long as you install a codec. If you don't, then the system cannot read them.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 12 Aug 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100