6

I have a surveillance .avi video file that includes mostly still (unchanging) frames. However, certain objects (and people) enter the field of view and exit within short period of time. I need to extract those frames.

The entire video lasts very long (24+ hours) which prevents me from replaying realtime. Is there a Perl module that can parse the file by frames? With that I suppose I can quickly transform the frames to some histogram and compare the neighboring frames to find significant changes. This webpage spells out the general approach but I couldn't find either the script (keyframe.pl) or the modules used (granted that is for .mpeg files).

If the direct module to parse .avi does not exist, I can convert the video to .mpeg (or any other form), then please just direct me to some other module that can parse the file?

Thx!

Justin
  • 1,881
  • 4
  • 20
  • 40
Zhang18
  • 4,800
  • 10
  • 50
  • 67
  • 3
    Perl is probably the wrong tool for the job here. C + ffmpeg is probably the way to go. –  May 26 '12 at 03:14
  • 1
    [Motion detection](http://stackoverflow.com/search?q=motion+detection) is a solved problem. Just use opencv and its Perl bindings, no need to reinvent the wheel. – daxim May 26 '12 at 11:24

1 Answers1

2

I vote for the original comments, although I'm a Perl person, it's wrong for this. I'd just add that for surveillance and movement, there are two well-known tools: http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome motion and zoneminder: http://www.zoneminder.com/ that work in the area of detection. motion is built on top of ffmpeg, I'm not sure whether it can process files though.

Hugh Barnard
  • 352
  • 2
  • 12