Picture Server Storing Millions of jpg's!
Michael Hipp
Michael at Hipp.com
Thu Jan 3 06:35:24 PST 2008
Jerry McBride wrote:
> On Wednesday 02 January 2008 05:02:20 pm Shawn wrote:
>> Hi guys,
>>
>> I have a system of IP camera's that are supposed to FTP snapshots upon
>> motion sensing at a number of remote sites. The cameras seem to send
>> far more pictures even when things are static and I've ended up with
>> litterally millions of 10-20K jpg's, not all of which I need to save as
>> it were.
>>
>
> ----snip----
>
> As I understand it, you want to be able to weed through a pile of pictures and
> sort out only the interesting bits?
>
> Here's a piece of bash that I used to "take pictures" via a webcam. When
> motion was detected between any two snapshots. a date branded copy of the
> last picture was put into a holding directory for later use. I have no
> recollection where I got this from... Hell, I may even be the author... :')
>
> What it does is... snaps a picture, quantifies it, snaps another picture,
> quantifies it too, compares last to first, if theres a substantial difference
> between the two pictures then save the last picture for later viewing...
> otherwise just loop while updating the first image with the second one... go
> do it again.
>
> Worked great. I only got snapshots in the save directory when something
> actually moved in the watched area. I used this for years to monitor the
> hallway that lead to the IT offices where I worked. Uhm... for various
> reasons. :')
>
> Since this is bash, it is easily hacked to fit your needs... by having it
> weed/loop through the pictures in your holding directory and saving the ones
> of substantial difference to a different directory. I'll leave the necessary
> hacking to you.
>
> Good luck and have fun.
>
> Caution: Indentation has been compressed out to try to eliminate word wrap.
>
> #!/bin/bash
> #
> #Uses tools from media-video/w3cam, media-libs/jpeg and media-libs/netpbm
You guys should probably stop reinventing the wheel and try Motion. :-)
http://www.lavrsen.dk/twiki/bin/view/Motion/MotionExamples
http://www.linux.com/articles/114118
Michael
More information about the Linux-users
mailing list