boomlikethat
Posts: 85
Joined: Sun Aug 03, 2014 10:32 pm

Re: PiKrellCam: wish list

Tue Jul 28, 2015 5:50 pm

@billw,

You and jbeale have really done amazing things with this, and as I use this, I see a few things that might be helpful.

I do get a lot of hits each day, which is fine, and the thumbs help with that (especially the way jbeale recently set it up). But clicking on each filename to see the video/image can be a tad tough when I have 80-100 hits.

I would like to request the ability to navigate to the "next" or "previous" video/image, (if you think they are viable to the community, and when you have the time). I'm thinking next/previous by date/time, and perhaps buttons before or after the delete and download buttons.

Again, thanks for all the hard work, this will be my "goto" from now on.

Cadorago
Posts: 1
Joined: Wed May 21, 2014 10:02 am

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Jul 29, 2015 2:17 pm

Hi all,
I'm trying to set 2592 × 1944 15fps video mode, but it doesn't work...

I have set:
video_width 2592
video_height 1944
video_fps 14
video_mp4box_fps 14
mjpeg_divider 2

Has anyone tried it?

Thanks in advance, and thanks for this great software!

D.

mrlinux2u
Posts: 215
Joined: Sat Sep 24, 2011 8:38 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Jul 29, 2015 5:12 pm

@billw

I'm still having the occasional glitch when mp4box fails to convert a recorded video (I've updated my Pi's software and changed power supply's and the camera module itself).

Is it possible to stop mp4box from running and just keep the h264 file recorded by PiKrellCam instead (I'm quite happy with this format)?

Cheers

Paul

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

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Jul 29, 2015 6:58 pm

mrlinux2u wrote:@billw
Is it possible to stop mp4box from running and just keep the h264 file recorded by PiKrellCam instead (I'm quite happy with this format)?
You can change the video_filename suffix. In pikrellcam.conf, change line:

Code: Select all

video_filename $M_%F_%H.%M.%S_$N.mp4
to

Code: Select all

video_filename $M_%F_%H.%M.%S_$N.h264
And restart pikrellcam. I haven't seen that glitch either so I'm not sure what could be happening.

mrlinux2u
Posts: 215
Joined: Sat Sep 24, 2011 8:38 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Jul 29, 2015 7:18 pm

billw wrote:
mrlinux2u wrote:@billw
Is it possible to stop mp4box from running and just keep the h264 file recorded by PiKrellCam instead (I'm quite happy with this format)?
You can change the video_filename suffix. In pikrellcam.conf, change line:

Code: Select all

video_filename $M_%F_%H.%M.%S_$N.mp4
to

Code: Select all

video_filename $M_%F_%H.%M.%S_$N.h264
And restart pikrellcam. I haven't seen that glitch either so I'm not sure what could be happening.
Hi billw,

Cheers for that, much appreciated, and a very simple solution :)

Paul

boomlikethat
Posts: 85
Joined: Sun Aug 03, 2014 10:32 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Jul 29, 2015 7:54 pm

Ok, I have a question.

If I have multiple regions set up, it seems the recording begins from whatever region is activated first.

So, if by chance, movement happens from another region while the other is recording, will it not be recorded? I don't quite understand all of what regions/vectors do beyond picking up motion from within those regions, so I might have missed something.

Or, maybe it's processing speed. I'm using a RPi B+ now. Will an RPi2 speed up processing enough to better handle things like that? Or is that relevant?

Thanks!

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

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Jul 29, 2015 11:26 pm

boomlikethat wrote: If I have multiple regions set up, it seems the recording begins from whatever region is activated first.

So, if by chance, movement happens from another region while the other is recording, will it not be recorded? I don't quite understand all of what regions/vectors do beyond picking up motion from within those regions, so I might have missed something.

Or, maybe it's processing speed. I'm using a RPi B+ now. Will an RPi2 speed up processing enough to better handle things like that? Or is that relevant?
The regions divide the screen into areas that are sensitive to motion. So to check for motion
the program looks at each region and if motion is detected in any one of them then a recording is started.
Then at each subsequent check time, each region is checked again and motion in any of them keeps
the recording going. There is no separate recording per region, but motion in any one region
applies to the whole recording and the composite vector is just the mechanism for how I determine
if a region has motion.

I do all development on a Pi 2 but my deployed Pi detection stations are B+ Pis which also run
gkrellmd so I'm always monitoring the CPU usage which typically ranges from 10% - 40%. With
occasional slightly higher peaks. This is while nginx on the B+ is streaming the mjpeg. When
a mp4 is encoded or a timelapse converted, CPU goes to 100% but the motion detection
keeps working so I have not seen a B+ issue.

Just think of the regions as a mask for areas sensitive to motion and there is really only one
final whole screen motion detect event possible.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jul 30, 2015 4:11 am

In case you want to save just the still image instead of the video to a remote site, you can do something like this:

/home/pi/pikrellcam/scripts/motion-end

Code: Select all

#!/bin/bash

VIDEO_FILE=$1
FIFO=$2
LOG_FILE=$3

# construct still filename from video filename
F=$(basename $VIDEO_FILE .mp4).jpg  
curl -T /home/pi/pikrellcam/media/stills/$F  ftp://ftp.mysite.com/pics/$F --user USERNAME:PASSWORD

kevw
Posts: 22
Joined: Wed Aug 27, 2014 1:49 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jul 30, 2015 8:30 am

billw wrote:
boomlikethat wrote: If I have multiple regions set up, it seems the recording begins from whatever region is activated first.

So, if by chance, movement happens from another region while the other is recording, will it not be recorded? I don't quite understand all of what regions/vectors do beyond picking up motion from within those regions, so I might have missed something.

Or, maybe it's processing speed. I'm using a RPi B+ now. Will an RPi2 speed up processing enough to better handle things like that? Or is that relevant?
The regions divide the screen into areas that are sensitive to motion. So to check for motion
the program looks at each region and if motion is detected in any one of them then a recording is started.
Then at each subsequent check time, each region is checked again and motion in any of them keeps
the recording going. There is no separate recording per region, but motion in any one region
applies to the whole recording and the composite vector is just the mechanism for how I determine
if a region has motion.

I do all development on a Pi 2 but my deployed Pi detection stations are B+ Pis which also run
gkrellmd so I'm always monitoring the CPU usage which typically ranges from 10% - 40%. With
occasional slightly higher peaks. This is while nginx on the B+ is streaming the mjpeg. When
a mp4 is encoded or a timelapse converted, CPU goes to 100% but the motion detection
keeps working so I have not seen a B+ issue.

Just think of the regions as a mask for areas sensitive to motion and there is really only one
final whole screen motion detect event possible.
Is there scope to trigger a recording after a pattern of regions is triggered, so to capture when someone walks left to right across a scene when hitting 2 or more regions in order? Also is there any way to create regions from a mask? No worries if no to both questions..just thoughts :)

Cheers,

Kev

Raspberrz
Posts: 11
Joined: Sat Nov 23, 2013 11:17 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jul 30, 2015 1:53 pm

kevw wrote: Is there scope to trigger a recording after a pattern of regions is triggered, so to capture when someone walks left to right across a scene when hitting 2 or more regions in order? Also is there any way to create regions from a mask? No worries if no to both questions..just thoughts :)
I had a more simple idea about handling the regions: Would it be possible to implement that only detected motion in one region triggers an action, maybe starting a script for emailing?

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

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jul 30, 2015 4:04 pm

Raspberrz wrote:I had a more simple idea about handling the regions: Would it be possible to implement that only detected motion in one region triggers an action, maybe starting a script for emailing?
Is the idea that you still want to record video from motion in any region, but have a special script action triggered by any activity in one specific region?

Jasimo
Posts: 51
Joined: Mon Apr 27, 2015 11:50 am

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jul 30, 2015 4:19 pm

Hi,

could someone explain the parameter for motion_vectors_dimming and motion_area_min_side, did they affect the motion detection? I read the explanation in the conf file, but I didn't catch the sentence.
Rgs
Jan

Raspberrz
Posts: 11
Joined: Sat Nov 23, 2013 11:17 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jul 30, 2015 5:35 pm

jbeale wrote:Is the idea that you still want to record video from motion in any region, but have a special script action triggered by any activity in one specific region?
Exactly! Like recording every motion in the driveway, but only starting a script if there's something in front of my door. I suggested starting a script because I'm planning to change output via gpio.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jul 30, 2015 5:52 pm

Jasimo wrote:Hi,
could someone explain the parameter for motion_vectors_dimming and motion_area_min_side, did they affect the motion detection? I read the explanation in the conf file, but I didn't catch the sentence.
Rgs
Jan
The dimming is the percent to dim the jpeg stream when the show of motion vectors is enabled.
If you want more contrast between the image and drawn motion vector squares, set the dimming
lower. Set it higher if you want to see the image better, but less contrast is available for the vectors.

If motion vector count limit is set low, the size of the detected object can be very small and the blow
up of that detected area for a thumb can be grainy or even missed since there can be some skew. Setting
a minimum to the motion area side compensates for that. The units of the minimum is pixels.

Neither of these affect actual motion detection.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jul 30, 2015 5:59 pm

kevw wrote: Is there scope to trigger a recording after a pattern of regions is triggered, so to capture when someone walks left to right across a scene when hitting 2 or more regions in order? Also is there any way to create regions from a mask? No worries if no to both questions..just thoughts :)
That's getting into taking action based on some kind of tracking information which is currently
not done. Although I've thought that eventually I would do something about that .

Nope to the mask unless you want to come with some way other than the gui to generate
a motion regions file. It could be done, but I have no plans to do so.

Jasimo
Posts: 51
Joined: Mon Apr 27, 2015 11:50 am

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jul 30, 2015 6:00 pm

thx for the explanation.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jul 30, 2015 6:10 pm

Raspberrz wrote:
jbeale wrote:Is the idea that you still want to record video from motion in any region, but have a special script action triggered by any activity in one specific region?
Exactly! Like recording every motion in the driveway, but only starting a script if there's something in front of my door. I suggested starting a script because I'm planning to change output via gpio.
As a one shot, the motion area information can be passed to the preview-save script and it may or
may not be something right at the door. So to know if something gets to the door or is at the door
is getting into tracking information which is not available, but again is something I've had in mind.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jul 30, 2015 7:21 pm

billw wrote:
Raspberrz wrote:
jbeale wrote:Is the idea that you still want to record video from motion in any region, but have a special script action triggered by any activity in one specific region?
Exactly! Like recording every motion in the driveway, but only starting a script if there's something in front of my door. I suggested starting a script because I'm planning to change output via gpio.
As a one shot, the motion area information can be passed to the preview-save script and it may or
may not be something right at the door. So to know if something gets to the door or is at the door
is getting into tracking information which is not available, but again is something I've had in mind.
Actually, you were having the right idea and I was being too complicated. If there was a config for:

Code: Select all

on_region_motion region_number script_command
you could put a region around the door and put that region number in the command. That would
be useful.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jul 30, 2015 11:23 pm

git update
Web page password protection is now changed to use htpasswd. The install-pikrelllcam.sh
script will need to be run after an update with git pull origin to get web page password protection.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jul 31, 2015 3:13 am

Maybe I just haven't updated to the latest, or mistyped something but I was puzzled for a while about why my motion-end script didn't work. Until I realized that the file was /home/pi/pikrellcam/scripts/motion-end (with a dash) but
/home/pi/.pikrellcam/pikrellcam.conf was calling out on_motion_end $C/motion_end $v $P $G
with an underscore.

Two other comments:
1) I never heard of curlftpfs but discovered today it is very handy for scripts to add and clean out files from a remote FTP site, handling it just as a local directory.
2) If you want to detect fast and bright things (eg. car headlights, not people) at night, with pikrellcam it is much better to just leave the camera framerate at 24 fps. With slow shutter, the motion detection often does not see cars at all (headlights become a long static streak, instead of a moving point of light). If you want to detect dark and slow-moving things, then slow shutter is an advantage.

stephencassidy
Posts: 37
Joined: Mon Aug 19, 2013 11:12 am

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jul 31, 2015 9:07 am

billw wrote:I've pushed an update and sun times should be working. Those that want to change frame fps
at night can put lines like this in ~/.pikrellcam/at-commands.conf:

Code: Select all

# sunrise/sunset or dawn/dusk (times are reported in the log file)
# Motion is detected and preview updated at video_fps/mjpeg_divider so
# mjpeg_divider should be changed when video_fps is changed.  Also change
# video_mp4_box to track video_fps or mp4 will be slow or fast motion.
#
# Adjust camera parameters in the evening: sunset{+-offset}
daily sunset "@exposure_mode night"
daily sunset+10 "@video_fps 4"
daily sunset+10 "@video_mp4box_fps 4"
daily sunset+10 "@mjpeg_divider 1"

# Adjust camera parameters in the morning sunrise{+-offset}
daily sunrise-10 "@video_fps 24"
daily sunrise-10 "@video_mp4box_fps 24"
daily sunrise-10 "@mjpeg_divider 4"
daily sunrise "@exposure_mode auto"
G7BWP - The installer is changed to handle non pi user, but I don't have a setup to test with
so please post any errors you get if you try to install again.
This is working almost perfecty. I did notice that for the past couple of evenings no (or very little) motion has been captured between the sunset and sunrise times.

In /tmp/log
sunrise/sunset times: valid dawn/dusk times: valid
dawn: 4:21
sunrise: 5:05
sunset: 20:48
dusk: 21:31


the last capture last evening was at 20:51 and the first capture this morning was 05:54

my at-commands file

Code: Select all

daily sunset "@exposure_mode night"
daily sunset+10 "@video_fps 4"
daily sunset+10 "@video_mp4box_fps 4"
daily sunset+10 "@mjpeg_divider 1"

# Adjust camera parameters in the morning sunrise{+-offset}
daily sunrise-10 "@video_fps 24"
daily sunrise-10 "@video_mp4box_fps 24"
daily sunrise-10 "@mjpeg_divider 4"
daily sunrise "@exposure_mode auto"


any ideas?

Thanks

ste

boomlikethat
Posts: 85
Joined: Sun Aug 03, 2014 10:32 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jul 31, 2015 11:32 am

@billw/jbeale

Just ran the update, getting this on the thumbnail screen:
hours.jpg
hours.jpg (41.82 KiB) Viewed 3001 times
Any ideas? Thanks!

Update:
Seems to correct itself once videos are recorded and thumbs are being created, but upon clearing the videos/thumbnails, the same erroneous view comes up (0 events in 399,539.4 hours)

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

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jul 31, 2015 2:03 pm

Yes, I didn't handle the special case of "no events". Right now it was coded to take the time difference between the first event and the last event, because I didn't know how to tell when to start timing from whenever you last cleared out the folder.

The big number problem with no events is fixed in the version I'm using now, see below, but I made another change also, adding current time/date at upper right. I didn't know how to do that without adding another frame around the whole window and putting the rest of the header off-center due to my lack of PHP/HTML coding skills.
https://github.com/jbeale1/PiCam1/blob/ ... thumbs.php

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

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jul 31, 2015 2:51 pm

stephencassidy wrote: This is working almost perfecty. I did notice that for the past couple of evenings no (or very little) motion has been captured between the sunset and sunrise times.
...
the last capture last evening was at 20:51 and the first capture this morning was 05:54
It could be that the lighting conditions are such that you are always getting the noise "sparkles"
at night and that would inhibit the current motion detection. Improving detection during those
sparkle periods is next up for me to work on.
If that's what is affecting you, turn on showing of vectors and you should see the noise. I see the
noise level also affected somewhat by frame rate so if this is it, you could try a different night frame
rate until I get this issue worked out.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jul 31, 2015 2:59 pm

I just fixed an oversight in the install script for the new htpasswd option where the password was
not properly set up. So if you tried it and didn't get a web page password, try again.

Return to “Camera board”