Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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.
 
Share this answer
 
It does not work for mp4 or mov files !!!
 
Share this answer
 
Comments
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900