User avatar
jbeale
Posts: 3581
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Nov 09, 2015 7:05 am

billw wrote:Right now there's no per frame record kept. Would you be able to do what you want if for each
motion video there was a corresponding file with a list of frame numbers that had motion detected?
And then you would have an on_motion_end command where you would process the frame
numbers and dispose of the frame number file when done?
Yes, that would work! Is that easy to do? Ideally, that file would also contain the motion vector count and magnitude for each frame number, so my script would be able to make good decisions about how many stills to extract and the best frames for each.

Not that you might do all this, but my program saved a number of data points on each frame (in this case printing elapsed time, rather than frame number):

Code: Select all

if (not log.closed) and ( (lastCP > 0) or (countPixels >= (pixThreshEff))):
          log.write("%4d, %6.3f, %4d, %6.3f, %4.1f,%4.1f, %4.1f, %2d,%2d, %2d,%2d, %5.1f,%5.1f, %d,%s\n" % \
            (countPixels, (1.0*segFrameNumber)/frameRate, avgNovel, tRemain, \
             xcent, ycent, scaleFactor, x0,y0, x1,y1, sSmin,sSmax, expCompensate, daytime))

Sample data from a motion event (video processed at 4 frames per second):
  31,  2.500, 2090,  0.119, 43.4,10.5,  1.0, 35, 8, 50,13,   5.0,182.0, -1,151108_22:34:30.611
  46,  2.750, 3885,  0.118, 40.7,10.5,  1.0, 33, 8, 50,13,   6.0,188.0, -1,151108_22:34:30.872
  55,  3.000, 5960,  0.121, 40.3,10.5,  1.0, 32, 8, 50,13,   6.0,204.0, -1,151108_22:34:31.132
  70,  3.375, 7221,  0.068, 39.5,10.3,  1.0, 30, 8, 50,13,   6.0,243.0, -1,151108_22:34:31.525
  76,  3.625, 7215,  0.063, 39.5,10.3,  1.0, 29, 8, 50,13,   5.0,244.0, -1,151108_22:34:31.786
  76,  3.875, 7469,  0.062, 39.3,10.3,  1.0, 29, 8, 50,13,   5.0,243.0, -1,151108_22:34:32.046
  76,  4.000, 7702,  0.068, 39.1,10.3,  1.0, 29, 8, 50,13,   6.0,243.0, -1,151108_22:34:32.175
  74,  4.250, 7530,  0.067, 39.0,10.3,  1.0, 29, 8, 50,13,   6.0,241.0, -1,151108_22:34:32.434
  72,  4.500, 7368,  0.064, 38.8,10.4,  1.0, 29, 8, 50,13,   6.0,242.0, -1,151108_22:34:32.696
  70,  4.875, 7288,  0.013, 38.8,10.4,  1.0, 29, 8, 50,13,   6.0,243.0, -1,151108_22:34:33.087
  70,  5.125, 6909,  0.003, 38.9,10.3,  1.0, 29, 8, 50,13,   6.0,242.0, -1,151108_22:34:33.350
  69,  5.375, 6766, -0.007, 38.8,10.5,  1.0, 29, 8, 50,13,   6.0,242.0, -1,151108_22:34:33.611
  67,  5.625, 6610, -0.010, 38.8,10.5,  1.0, 29, 8, 50,13,   6.0,241.0, -1,151108_22:34:33.872
  64,  5.875, 6393, -0.010, 39.0,10.5,  1.0, 29, 8, 50,13,   5.0,241.0, -1,151108_22:34:34.132
  62,  6.125, 6138, -0.009, 39.0,10.5,  1.0, 30, 9, 50,13,   6.0,240.0, -1,151108_22:34:34.392
  61,  6.375, 6079, -0.010, 39.2,10.5,  1.0, 30, 8, 50,13,   6.0,241.0, -1,151108_22:34:34.653
  57,  6.625, 6003, -0.009, 39.5,10.5,  1.0, 30, 8, 50,13,   6.0,241.0, -1,151108_22:34:34.913
  55,  6.875, 5805, -0.011, 39.4,10.6,  1.0, 30, 9, 50,13,   6.0,241.0, -1,151108_22:34:35.173
  54,  7.125, 5145, -0.011, 39.3,10.7,  1.0, 30, 9, 49,13,   6.0,237.0, -1,151108_22:34:35.435
  42,  7.375, 4770, -0.011, 38.6,11.2,  1.0, 30, 9, 48,13,   6.0,228.0, -1,151108_22:34:35.694
  24,  7.625, 5954, -0.008, 36.4,12.0,  1.0, 29,10, 46,13,   6.0,203.0, -1,151108_22:34:35.955
  19,  7.875, 5604, -0.013, 35.5,11.9,  1.0, 28,10, 44,13,   6.0,210.0, -1,151108_22:34:36.217
   3,  8.125, 4172, -0.007, 31.9,12.8,  1.0, 27,12, 38,14,   5.0,207.0, -1,151108_22:34:36.476
   0,  8.375,    0, -0.004,  0.0, 0.0,  0.8,  0, 0,  0, 0,   6.0,196.0, -1,151108_22:34:36.740

billw
Posts: 405
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Nov 09, 2015 5:26 pm

jbeale wrote: Yes, that would work! Is that easy to do? Ideally, that file would also contain the motion vector count and magnitude for each frame number, so my script would be able to make good decisions about how many stills to extract and the best frames for each.
It seems like it should be doable and I'll put it in the todo pipe. Looks like you print time
based on frame number and I could do the same. But besides elapsed time, motion vector
magnitude, count, and x,y, I don't know what those other variables you had are (avgNovel, etc).
If anything else is important to you and the data is available in pikrellcam, you need to define
the variables for me.

Do you have a preference for where the data files are written? They could be in the videos directory
or in the /var/run/pikrellcam tmpfs directory.

User avatar
jbeale
Posts: 3581
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Nov 09, 2015 6:26 pm

billw wrote: It seems like it should be doable and I'll put it in the todo pipe. Looks like you print time
based on frame number and I could do the same. But besides elapsed time, motion vector
magnitude, count, and x,y, I don't know what those other variables you had are (avgNovel, etc).
If anything else is important to you and the data is available in pikrellcam, you need to define
the variables for me.

Do you have a preference for where the data files are written? They could be in the videos directory
or in the /var/run/pikrellcam tmpfs directory.
Thank you very much for considering this! Do not worry about my cryptic verbose output. My program had some debug info like scheduled loop time remaining, and I used a simple "novel pixel" frame-difference algorithm but it's not important, anyway your motion vector approach is much superior both in sensitivity and fewer false-positive detects. I would put the .csv or .txt data file with the same filename except for the extension, in the same directory right alongside the .mp4 videos, but if you have some other preference that's fine too. The text data file size is about 1/1000 the size of the video, so it doesn't matter much. Thanks again!

YvesG
Posts: 46
Joined: Wed Oct 03, 2012 6:54 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Nov 13, 2015 11:02 am

hi @billw, there is a new (basic) pull request https://github.com/billw2/pikrellcam/pull/6
thx
Yves

billw
Posts: 405
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Nov 14, 2015 4:22 am

YvesG wrote:hi @billw, there is a new (basic) pull request https://github.com/billw2/pikrellcam/pull/6
thx
Yves
OK, merged.

To avoid surprises, I want to mention that in a few days when I push the next update one
change will be that the log file will be automatically trimmed to 1000 lines at startup and
new days. The lines number will be configurable (with zero to disable trimming), but let
me know if that initial trim will be a problem for anybody.

Also, I've got archiving and web page archive viewing about done and in case anybody
has already done anything along the lines of spikedrba's archive script posted a few weeks ago,
be aware that the directory structure will be for example

Code: Select all

media/videos
media/stills
media/thumbs
media/archive
media/archive/2015/11/13/videos
media/archive/2015/11/13/thumbs
media/archive/2015/11/13/stills
There is a configurable archive directory archive_dir in pikrellcam.conf which
defaults to media/archive but can be changed so the archive can be on a
different disk. Archive views can be by day, week, or month.

User avatar
jbeale
Posts: 3581
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Nov 14, 2015 4:57 am

Archive function sounds great! I've been using my own ad-hoc solution but I carelessly broke the still thumbnail connection to videos once they moved to the archive directory, so I look forward to the "official" version.


YvesG
Posts: 46
Joined: Wed Oct 03, 2012 6:54 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Nov 14, 2015 10:17 am

Thanks bill, archiving sounds promising

User avatar
jbeale
Posts: 3581
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

3 second gap in a recorded video

Sat Nov 14, 2015 4:54 pm

I had two events which were close in time to each other. The second one has a 3-second gap in it. any way to avoid this?

First event has the on-screen timestamp running from 8:24:54 AM to 8:25:08 AM and the motion is continuous.
Second event has onscreen timestamp from 8:25:15 AM to 8:25:30 am but after the first four seconds of playback, the time readout jumps from :19 to :22 and those three seconds of action are missing in the video. Maybe this is a gap between the contents of the pre-event circular buffer and the post-event video? This normally doesn't happen, just this time I noticed it.

In ~/.pikrellcam/pikrellcam.conf I have:

Code: Select all

motion_confirm_gap 2
motion_event_gap 9
motion_pre_capture 2
motion_post_capture 5
and in /tmp/pikrellcam.log the relevant section is:

Code: Select all

08:24:57 : Video record: /home/pi/pikrellcam/media/videos/motion_2015-11-14_08.24.57_1907.mp4.h264 ...
08:24:57 : event preview save: copy /run/pikrellcam/mjpeg.jpg -> /run/pikrellcam/motion_2015-11-14_08.24.57_1907.jpg
08:24:57 : event preview save: copy /run/pikrellcam/mjpeg.jpg -> /run/pikrellcam/motion_2015-11-14_08.24.57_1907.jpg
08:24:57 : event preview save: copy /run/pikrellcam/mjpeg.jpg -> /run/pikrellcam/motion_2015-11-14_08.24.57_1907.jpg
08:25:00 : event preview save: copy /run/pikrellcam/mjpeg.jpg -> /run/pikrellcam/motion_2015-11-14_08.24.57_1907.jpg
08:25:00 : event preview save: copy /run/pikrellcam/mjpeg.jpg -> /run/pikrellcam/motion_2015-11-14_08.24.57_1907.jpg
08:25:01 : event preview save: copy /run/pikrellcam/mjpeg.jpg -> /run/pikrellcam/motion_2015-11-14_08.24.57_1907.jpg
08:25:01 : event preview save: copy /run/pikrellcam/mjpeg.jpg -> /run/pikrellcam/motion_2015-11-14_08.24.57_1907.jpg
08:25:12 : Video motion record stopped. Header size: 29  h264 file size: 20025594
08:25:12 : execl:[(MP4Box -quiet -fps 24 -add /home/pi/pikrellcam/media/videos/motion_2015-11-14_08.24.57_1907.mp4.h264 /home/pi/pikrellcam/media/videos/motion_2015-11-14_08.24.57_1907.mp4 2> /dev/null && rm /home/pi/pikrellcam/media/videos/motion_2015-11-14_08.24.57_1907.mp4.h264)]
08:25:12 : execl:[/home/pi/pikrellcam/scripts-dist/_thumb /run/pikrellcam/motion_2015-11-14_08.24.57_1907.jpg /home/pi/pikrellcam/media /home/pi/pikrellcam/www/FIFO /tmp/pikrellcam.log 437 261 417 151]
  convert /run/pikrellcam/motion_2015-11-14_08.24.57_1907.jpg -crop 437x437+199+0 -resize 150x150\! /home/pi/pikrellcam/media/thumbs/motion_2015-11-14_08.24.57_1907.th.jpg
08:25:12 : execl:[/home/pi/pikrellcam/scripts/preview-save  /run/pikrellcam/motion_2015-11-14_08.24.57_1907.jpg /home/pi/pikrellcam/media /home/pi/pikrellcam/www/FIFO /tmp/pikrellcam.log 437 261 417 151]
cp /run/pikrellcam/motion_2015-11-14_08.24.57_1907.jpg /home/pi/pikrellcam/media/stills
convert /run/pikrellcam/motion_2015-11-14_08.24.57_1907.jpg -crop 437x437+199+-67 -resize 150x150\! /home/pi/pikrellcam/media/thumbs/motion_2015-11-14_08.24.57_1907.th.jpg
08:25:12 : event_preview_dispose(); removing /run/pikrellcam/motion_2015-11-14_08.24.57_1907.jpg
08:25:18 : Video record: /home/pi/pikrellcam/media/videos/motion_2015-11-14_08.25.18_1908.mp4.h264 ...
08:25:22 : event_motion_end_cmd(); running $C/motion-end $v $P $G
08:25:22 : execl:[/home/pi/pikrellcam/scripts/motion-end /home/pi/pikrellcam/media/videos/motion_2015-11-14_08.24.57_1907.mp4 /home/pi/pikrellcam/www/FIFO /tmp/pikrellcam.log]
08:25:22 : event preview save: copy /run/pikrellcam/mjpeg.jpg -> /run/pikrellcam/motion_2015-11-14_08.25.18_1908.jpg
UPLOADED motion_2015-11-14_08.24.57_1907.jpg
08:25:34 : Video motion record stopped. Header size: 29  h264 file size: 18011742
08:25:34 : execl:[(MP4Box -quiet -fps 24 -add /home/pi/pikrellcam/media/videos/motion_2015-11-14_08.25.18_1908.mp4.h264 /home/pi/pikrellcam/media/videos/motion_2015-11-14_08.25.18_1908.mp4 2> /dev/null && rm /home/pi/pikrellcam/media/videos/motion_2015-11-14_08.25.18_1908.mp4.h264)]
08:25:34 : execl:[/home/pi/pikrellcam/scripts-dist/_thumb /run/pikrellcam/motion_2015-11-14_08.25.18_1908.jpg /home/pi/pikrellcam/media /home/pi/pikrellcam/www/FIFO /tmp/pikrellcam.log 74 100 231 199]
  convert /run/pikrellcam/motion_2015-11-14_08.25.18_1908.jpg -crop 100x100+181+149 -resize 150x150\! /home/pi/pikrellcam/media/thumbs/motion_2015-11-14_08.25.18_1908.th.jpg
08:25:34 : execl:[/home/pi/pikrellcam/scripts/preview-save  /run/pikrellcam/motion_2015-11-14_08.25.18_1908.jpg /home/pi/pikrellcam/media /home/pi/pikrellcam/www/FIFO /tmp/pikrellcam.log 74 100 231 199]
cp /run/pikrellcam/motion_2015-11-14_08.25.18_1908.jpg /home/pi/pikrellcam/media/stills
convert /run/pikrellcam/motion_2015-11-14_08.25.18_1908.jpg -crop 100x100+181+149 -resize 150x150\! /home/pi/pikrellcam/media/thumbs/motion_2015-11-14_08.25.18_1908.th.jpg
08:25:34 : event_preview_dispose(); removing /run/pikrellcam/motion_2015-11-14_08.25.18_1908.jpg
08:25:40 : event_motion_end_cmd(); running $C/motion-end $v $P $G
08:25:40 : execl:[/home/pi/pikrellcam/scripts/motion-end /home/pi/pikrellcam/media/videos/motion_2015-11-14_08.25.18_1908.mp4 /home/pi/pikrellcam/www/FIFO /tmp/pikrellcam.log]
UPLOADED motion_2015-11-14_08.25.18_1908.jpg

billw
Posts: 405
Joined: Tue Sep 18, 2012 8:23 pm

Re: 3 second gap in a recorded video

Sat Nov 14, 2015 11:54 pm

jbeale wrote:I had two events which were close in time to each other. The second one has a 3-second gap in it. any way to avoid this?

First event has the on-screen timestamp running from 8:24:54 AM to 8:25:08 AM and the motion is continuous.
Second event has onscreen timestamp from 8:25:15 AM to 8:25:30 am but after the first four seconds of playback, the time readout jumps from :19 to :22 and those three seconds of action are missing in the video. Maybe this is a gap between the contents of the pre-event circular buffer and the post-event video? This normally doesn't happen, just this time I noticed it.
I haven't seen this happen and the only clue I can get from your log is that the 8:25:19 to 8:25:22
gap is really close to the time period when the second video opens a file to write the pre_capture
and the boxing from the 1st video stops. The 2nd video file open happens at the
08:25:18 : Video record: ...
and the 1st video boxing has just ended at the
08:25:22 : event_motion_end_cmd(); ...

So there's the coincidence that is probably significant but what actually happened I'm not sure.
I suppose the circular buffer could have been overrun if the file system writes were delayed
for some reason, but normally that shouldn't happen. I'll keep it in mind and maybe I'll get
some idea.

spikedrba
Posts: 75
Joined: Fri Feb 28, 2014 2:19 am

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Nov 16, 2015 2:05 am

somewhat OT, but I can't think of a better crowd to ask...

I've been using custom lenses for a while (m12) and more or less experiments my way to good results. I am however looking at a fisheye lens and got stuck while trying to figure out how that was gonna work. Two questions (that I've been unable to google):

* how can a fisheye lens, no matter how short the focus length (say 1.2) do 180degs? Looking at the formula to calculate the diag angle a full frame sensor with a 2mm can't do more than 176 deg... how can I 1/4 sensor do 180?

* all the lenses I'm seeing around are designed for 1/3 or even 1/2 sensor, but the picamera has a 1/4 and I can't figure out what kind of implications that has. What does it mean that a lens is designed for 1/3? that the size of the whole is big enough to get a cone of light of that size?

thanks!

Spike

User avatar
jbeale
Posts: 3581
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Nov 16, 2015 3:30 am

all the lenses I'm seeing around are designed for 1/3 or even 1/2 sensor
You are right; I haven't seen much in the M12 lens market designed for a 1/4" sensor. There is no reason it can't be done in theory; it's just there isn't much market because the 1/3" sensor is much more common in board-level cameras taking M12 lenses.

How about this one? Designed for 1/4" sensor, claims 185 degrees HFOV. Effective Focal Length is less than 1 mm, although there is 2 mm clearance from the rear element (back focal distance). I have a different lens (6mm) from Sunex on one of my Pi cameras. They aren't cheap; this one is $49 but Sunex is a quality vendor.

http://www.optics-online.com/OOL/DSL/DSL180.PDF

spikedrba
Posts: 75
Joined: Fri Feb 28, 2014 2:19 am

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Nov 16, 2015 3:46 pm

thanks @jbeale.

I found this page which actually gives a pretty decent explanation (ie in plain terms I can understand) of normal lenses and fisheye lenses:

http://www.bobatkins.com/photography/te ... _view.html

I'm still puzzled by the 200 deg since I'm unclear how light enters the lens from behind the lens... but at least I can see how the 180 one is working and why the warping effect. However something is still amiss with the maths because if you consider the formula I found everywhere:

FOV (equisolid fisheye) = 4 * arcsin (frame size/(focal length * 4))

that would require a full frame sensor to even get close to an angle of 180deg. I don't see how you get that on a 1/4 sensor. If you look at the frame sizes here:

https://en.wikipedia.org/wiki/Image_sen ... _and_sizes

then the area seems 7.68mm, with a lens of 1.2mm focus length (the smallest I could find) that would give you 134.09 which is still far from 180.

any thoughts?

billw
Posts: 405
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Nov 16, 2015 6:32 pm

I've pushed pikrellcam with archiving to git. Maybe it can give some relief for whoever is now looking
at a mile long list of videos on the web page. I'm liking it and I hope everybody can find it useful.

I've merged the video/thumb/still viewing into one new page media-archive.php that handles both
current media and archive viewing. So that replaces the original media.php and thumb.php.

New stuff:
  • media file archiving and archive viewing (archive_dir in pikrellcam.conf)
  • daily automatic log file line length trimming (log_lines in pikrellcam.conf)
  • System panel->Help page. New, so for now only some comments on archiving.
  • /var/run/pikrellcam/state file. Has latest media written and state info.
When a day or file is archived, I try to wait for the files to be moved before reloading
the web page, but sometimes I have trouble with that and I'll have to work on it. So
if you archive a day and the page comes back with the files still shown, just reload the
page. I also think I've stopped the main race in the preview jpeg saves so the clean
mode should work much better now. We'll see if it is completely fixed.

User avatar
jbeale
Posts: 3581
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

history archiving, and fisheye lenses

Mon Nov 16, 2015 8:41 pm

@billw : great news, thank you for this update! I will look forward to trying the new version out.

@spikedrba : There are many different types of lens designs. The equation you are using only describes one kind. The widest-angle circular fisheye lenses have a front element which bulges out in the middle and this type of lens can and does capture rays coming from slightly behind the front plane (that is, beyond 180 degrees). Feel free to buy one and discover for yourself.. if the lens does something the equation doesn't predict, I would say the equation does not match the lens, and you need a different equation :-)

User avatar
jbeale
Posts: 3581
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Nov 17, 2015 2:54 am

The new archive function (and the HELP button) looks great! I assume if I want to delete all files more than a week old to save disk space, I should do something like:

Code: Select all

# crontab file
0 0 * * * find /home/pi/pikrellcam/media/archive -mtime +7 -exec rm {} \;

billw
Posts: 405
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Nov 17, 2015 4:37 am

jbeale wrote:The new archive function (and the HELP button) looks great! I assume if I want to delete all files more than a week old to save disk space, I should do something like:

Code: Select all

# crontab file
0 0 * * * find /home/pi/pikrellcam/media/archive -mtime +7 -exec rm {} \;
Looks reasonable to me. And then maybe to it again to clean out directories:

Code: Select all

find /home/pi/pikrellcam/media/archive -mtime +7 -type d -exec rmdir {} \;
The directory mtimes will depend on when you did the archiving so they may not
clean up the same day their contents do. But eventually things get cleaned up.

EDIT: doing the -type d will try to delete higher level directories that aren't empty,
but then the rmdir will just fail to delete. If you don't mind that I suppose it's still OK.

billw
Posts: 405
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Nov 17, 2015 2:03 pm

There's a bug fix update. If you deleted selected thumbs, the corresponding
video was not getting deleted. So if you have already upgraded to the new archive version,
you need to upgrade again.

User avatar
jbeale
Posts: 3581
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Nov 17, 2015 5:06 pm

The archive feature works nicely- very useful! However the situation where the previous event .mp4 filename sometimes shows on the next event still image, can still happen.

For example, when I have two motion events about 5 seconds apart, I see "motion_2015-11-17_08.27.58_33.mp4" displayed in the middle of the still for the following event, which has filename motion_2015-11-17_08.28.03_34.jpg. It also shows the text at bottom "Motion ON REC (Motion) 0:03 hold 0:04".

Now, on this particular device I still have a short 4 second "hold" time, so I will try to make that longer as I did with the other camera and see if that helps.

billw
Posts: 405
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Nov 18, 2015 3:06 am

jbeale wrote:The archive feature works nicely- very useful! However the situation where the previous event .mp4 filename sometimes shows on the next event still image, can still happen.

For example, when I have two motion events about 5 seconds apart, I see "motion_2015-11-17_08.27.58_33.mp4" displayed in the middle of the still for the following event, which has filename motion_2015-11-17_08.28.03_34.jpg. It also shows the text at bottom "Motion ON REC (Motion) 0:03 hold 0:04".

Now, on this particular device I still have a short 4 second "hold" time, so I will try to make that longer as I did with the other camera and see if that helps.
I think it's still a race, except a different one from the one that should be stopped and I have
an idea about it. I'll try to get something in tomorrow for you to test. If changing the hold time
affects it, let me know, but I suspect it may not make a difference.

tomtgrp
Posts: 41
Joined: Thu Jul 09, 2015 8:35 am

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Nov 18, 2015 9:58 am

Hello,

1. is it possible to add the Values (see at-commands.conf)
$D - current_time dawn sunrise sunset dusk
to
/var/run/pikrellcam/state ?

2. a code snipped suggestion to apply the actual timelapse value to the Time Lapse
Period text field. I 've put it in my custom.php:

Code: Select all

<?php
//period activated daylight series sequence
//15 1 0 1 108
$tl_status_filename="/home/pi/.pikrellcam/timelapse.status";
$fh = fopen($tl_status_filename, 'r');
$tl_period=0;

if($fh)
{
  $input = fgets($fh);
#  echo "tl_status: $input \n";
  $input = fgets($fh);
  fclose($fh);
#  echo "tl_status: $input \n";
  $n = sscanf($input, "%d", $tl_period);
}

?>
  <script type="text/javascript">
..........
    $(document).ready(function(){
..........
      document.getElementById("tl_period").value=<?php echo $tl_period; ?>;
...........

Br Thomas

YvesG
Posts: 46
Joined: Wed Oct 03, 2012 6:54 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Nov 18, 2015 9:53 pm

Just to say thanks @billw new version is very nice with the archiving !!!

billw
Posts: 405
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Nov 19, 2015 12:46 am

tomtgrp wrote:Hello,

1. is it possible to add the Values (see at-commands.conf)
$D - current_time dawn sunrise sunset dusk
to
/var/run/pikrellcam/state ?

2. a code snipped suggestion to apply the actual timelapse value to the Time Lapse
Period text field. I 've put it in my custom.php:
OK, these will be in when I have the next update with the clean preview changes ready.

lassiko
Posts: 10
Joined: Tue May 12, 2015 7:04 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Nov 19, 2015 2:37 pm

Hi,

Not sure if already answered, but how can i take a still from a shell, what is the command?
Thank you!

User avatar
jbeale
Posts: 3581
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

automatic archiving from crontab

Thu Nov 19, 2015 2:45 pm

The below commands work if I execute them directly from the bash prompt as user pi, but they do not work when put into the crontab file. What am I doing wrong?

Code: Select all

# Move yesterday's stills and video to that date's archive folder
0 2 * * * echo "archive_still day `date --date="yesterday" +'%F'`" > /home/pi/pikrellcam/www/FIFO
0 5 * * * echo "archive_video day `date --date="yesterday" +'%F'`" > /home/pi/pikrellcam/www/FIFO
EDIT: looks like I should make it a script and call that; such as a /home/pi/pikrellcam/scripts/do-archive

Code: Select all

#!/bin/bash

# Move yesterday's stills and video to that date's archive folder
echo "archive_still day `date --date="yesterday" +'%F'`" > /home/pi/pikrellcam/www/FIFO
echo "archive_video day `date --date="yesterday" +'%F'`" > /home/pi/pikrellcam/www/FIFO

# delete old files and directories to save storage space
find /home/pi/pikrellcam/media/archive -mtime +7 -exec rm {} \;
find /home/pi/pikrellcam/media/archive -mtime +7 -type d -exec rmdir {} \;

Return to “Camera board”