icat and raspberry pi motion camera photos

Started by Alan Clifford, October 31, 2021, 05:44:39 PM

Previous topic - Next topic

Alan Clifford

There is a question at the end for Phil please

My Pi cams start an event when motion is detected and stops the event after 60 seconds without motion.  Photos are saved into a directory for each event.

To simulate the situation after a month, I copied the photos from a working Pi to my spare Pi.  I was a bit shocked as there were 47000 photos in 1500 directories.  The first run of icat took rather a long time as "convert" takes about two seconds per photo.  This would not happen on the working Pi as I'd just let the photos build up.

I added a directory of 13 photos and icat took 2 minutes 15 seconds.   A third run with 438 photos added took about 17 minutes (the motion dectection sometimes is confused by shadows and sunlight so, at 1 - 3 photos per second, they build up).  A run without adding anything takes about 1 minute 20 seconds.

Here it is, if my test Pi is switched on: http://idaeus.clifford.ac/motionicat/2021-10-01--09-33-24--2104/index.html

Question to Phil.  It will be possible for a new directory of photos to be added before an icat run is finished.  So there would potentially be two or more instances of icat running.  Would this cause problems?  Would they be fighting to write, for instance, list.html.temp?  I've already got code in my current scripts I could reuse to prevent this happening if it would be a problem.

Phil Harvey

You shouldn't run concurrent versions of icat on the same directory.  In my current version of icat you can limit it to only processing specified directories with the --only option, which may help, but then you still need to get the processed directory indexed in the html page of the parent, so eventually you need to run it on the parent directory too.

Anyway, I have updated the icat release to my current version in case this is useful to you.  This new version also has the advantage that it supports using left/right cursor keys for moving backward/forward through the images.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Alan Clifford

Thanks Phil.

I'll have to have a think about the --only.

In any case, the 1.3 minutes to run without converting photos is a vast improvement on my current setup.