Log in

View Full Version : Detecting motion-only to compose time lapse video


laserfan
17th January 2013, 14:29
I have set-up a still camera which is taking jpg pictures every 2 seconds on a building construction project, which has generated many thousands of stills that I can import to VirtualDub and output as "accelerated video" and even re-encode using x264 to Blu-ray disc. It's very cool indeed, but...

There are a good number of occasions where nothing much is happening in the frame, and while I can remove those pics by hand it's a time-consuming process for sure.

Does anyone know of a way to have Avisynth compare frames for motion such that I can discard those "quiet" images where nothing is happening? I've searched here and found some pretty sophisticated image processing (e.g. PlanetCrop) so wonder if anyone has invented this wheel already?

If no easier way is apparent, I think I will try AviDemux or VideoReDo and edit the video afterwards (vs. discarding pics up-front). Might be easier than discarding individual jpgs up-front.

Pomegranate
17th January 2013, 14:48
You could try one of those listed here : http://avisynth.org/mediawiki/External_filters#Duplicate_Frame_Detectors

StainlessS
17th January 2013, 18:40
Just a little idea of where this might be useful, security cameras where you want just the interesting bits
and omit the masses of static frames that are of no interest but you might want to raise the condition above 0.1 as
used above to avoid false alarms.
See here:
http://forum.doom9.org/showthread.php?p=1539459#post1539459

Also see posts #14 & #16 a few posts later.

EDIT: Almost same script but modified to use FrameSelect() Plugin rather than Prune().
http://forum.doom9.org/showthread.php?p=1607578#post1607578

EDIT: Give me an hour or two and I'll knock up a script to compare frames with the previously output frame
rather than the previous frame to avoid the possibility of someone slowly creeping across the building site
and defeating the previous script.

StainlessS
17th January 2013, 23:55
Bit more than an hour or two, but here it is:
http://forum.doom9.org/showthread.php?p=1611514#post1611514

Say if not working correctly.

laserfan
18th January 2013, 02:13
Wow great stuff, I will take a look; thanks you guys.

:)