Jump to content
JoeCooper

I am working on a video clip motion detection software

Recommended Posts

Hi,

 

I am currently working on some software which allows you to load video files, and it will scan through each file for motion. The idea is that it will save time if you happen to need to look through large amounts of video to find an event.

 

I have previously had to go through hours of footage to find evidence for police of an unknown person causing damage to neighbors cars, but without knowing when it happened, and nothing to narrow the time down with. I couldn't find a software to do this automatically, so I ended up going through at x8 speed, which still took a long time.

 

The software I am working on uses an open soured .NET library called AForge.net which makes the processing for motion much easier, and it is very easy to fine tune.

 

Here is the software in action:

img?i=TbovEz

 

Right now you can load multiple files of just about any video format (mp4, mpg, avi, mov...), and it will scan through each one and measure the amount of motion, and the amount of events that took place (based on a threshold). It shows a preview, which does slow down the processing if enabled. Ultimately, the program will have the ability for you to mask off area's to ignore, or mark area's to scan. I also am working on an automatic baseline where you will upload a short clip of sample video that you know doesn't have any motion of interest, and it will automatically create the threshold of motion vs non-motion. I may also add the ability for it to automatically mask off area's of constant movement.

 

I also plan to add motion start / stop times to each clip to make it more useful in pinpointing the motion, and even an automatic video clip exporter which will export video files of the motion.

 

Please let me know if something like this would be useful to you. I would be interested in any suggestions and feedback.

 

Thanks

 

Joe

Share this post


Link to post
Share on other sites

AForge is a neet library, i've implemented the very same motion detection feature that you have, based on AForge for video handling (this is c++ now though). Have you messed with the other libraries, AI? That is what i am planning down the road, glyp recog etc.

Share this post


Link to post
Share on other sites

@joecooper

 

Hi Joe as a digital forensic expert, I am interested in your software for video analysis.

Have you commercialised it or is there a trial copy I could potentially see?

 

Thanks,

Donald

Share this post


Link to post
Share on other sites

Hi,

 

Sorry for the late reply, I didn't see any email notifications.

 

I haven't done much work with any other library's. When I started this project I found AForge to do everything I had needed it to do. The tricky part is getting it to work with different formats. I've actually got it running quite well on all major formats. I have been testing it on some footage from a vivotek IP camera however random files won't open when others will. No problems playing in VLC. Other than that, it does work well.

 

Going to be doing some more work on it tonight.

 

@chigo58 It's not commercialised, and I don't currently have a version to trial. I would like to get a stable version and will release it as an Alpha version, with single threading for now. I will keep this updated as people are interested.

Share this post


Link to post
Share on other sites

Well it is coming along nicely, and I don't seem to have problems loading any other videos other than the ones from this particular vivotek camera, which makes me think the issue is just with that camera (as we have had other problems with it too). One way around this is to use FFMPEG to convert the videos into mp4 format then it works fine. Possibly something to add in future to 'fix' difficult files.

 

One hurdle I need to overcome now is that there is quite a lot of processing and statistic gathering on every frame which slows down the overall processing time. a 1080p video is now slightly under real time which is not ideal. Multi-threaded processing would help this as currently it's only using 20% of my 8 core. I will also have a look at skipping frames, and seeing how this will work. As 1 in 5 frames means 5 times faster processing. Possibly a good option to add for the user to decide if they have months of footage to run though. Which then begs the functionality of auto-saving progress! Much to add!

 

I will aim to package up the application in the next few days and add a link here to test. Obviously it shouldn't be relied upon for now.

 

Thanks

 

Joe

Share this post


Link to post
Share on other sites

I don't know a whole lot about CCTV systems, but could someone help me answer this:

 

How long are the video clips that CCTV systems record on to DVR? Are they minutes / hours or even days long?

 

This is to help me work out the best way to do multi-threading on this application, whether to have each thread work on separate files, or to have each file split up and worked on by multiple threads.

 

Thanks

 

Joe

Share this post


Link to post
Share on other sites

How long are the video clips that CCTV systems record on to DVR? Are they minutes / hours or even days long?

Joe

 

hi Joe

In most cases they are set on motion only .. so most clips go from 5 seconds before the motion until 5 seconds after the motion stops.. so from 10 seconds to couple of minutes withj some longer if subject is in frame for a longer time

Mark

Share this post


Link to post
Share on other sites

How long are the video clips that CCTV systems record on to DVR? Are they minutes / hours or even days long?

Joe

 

hi Joe

In most cases they are set on motion only .. so most clips go from 5 seconds before the motion until 5 seconds after the motion stops.. so from 10 seconds to couple of minutes withj some longer if subject is in frame for a longer time

Mark

 

Well the main aim of this software is to find motion from cctv systems that don't have motion detection, or for those that are not enabled, and are set to record continuously.

Share this post


Link to post
Share on other sites

Just a quick update on the progress... (I'm getting excited about this!)

 

- Added multi threading, so now it uses more threads based on the number of cores the CPU has. It will use 75% of total core count, e.g. it will use 6 threads for an 8 core CPU.

- Changed the interface slightly and added a tool bar on the left.

- Actually have removed the motion threshold option altogether! I thought of a better way to visualize the data! (See screenshots)

 

Some parts of the interface in this screenshot are no longer used, and I have just been too lazy to remove them yet.

img?i=yVaSvP

 

This is a test graph, the actual end report will have more information here and will have a full report on all of the videos in one page, and a video player to match up with the motion detection areas.

img?i=PlmmCo

 

Let me know what you think!

Share this post


Link to post
Share on other sites

Very nearly there. Spent the entire weekend on this, as well as having to pay another coder to code a big part I had gotten stuck on!

 

It's working nicely, and now it's possible to view a video clip and see a motion graph together to find the motion. I have some lovely ideas for the application to work out what is normal background motion (tree's etc) and what is an out of the ordinary event (someone walking passed etc.).

 

I have a version for testing, although currently you will need to close down the application and start it again to start processing again, until I work out how to stop / start the threads correctly.

 

The best thing about this is it is able to process lower- resolution CCTV footage at around 2000fps (on my 8 core AMD CPU anyway). Larger 1080p videos are somewhat slower.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×