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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Jul 25, 2015 4:51 pm

I have now a good list of video and images : thanks to the accurate motion detection.
I think it could be helpful to be able to create directories in video_filename and still_filename

Code: Select all

video_filename $M_%F_%H.%M.%S_$N.mp4
Something like :

Code: Select all

video_filename $M_%F/%H.%M.%S_$N.mp4
Like this we could have 1 directory per day
or

Code: Select all

video_filename $M_%F/%H/%M.%S_$N.mp4
1 directory per day that contain 1 directory per hour.
What do you think?

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Jul 25, 2015 5:29 pm

jbeale wrote:I put this into /home/pi/.pikrellcam/at-commands.conf

Code: Select all

daily start "@video_fps 4"
however, the log at /tmp/pikrellcam.log shows an error, and I see the actual fps remained at 24 fps. I was able to set it manually with the onscreen controls, and see the much improved brightness at night. Maybe the update (git fetch, and rerun install) didn't work? How do I find out what version of pikrellcam I have running?

Code: Select all

2015-07-24 21:25:05 ==== PiKrellCam started ====
...
Bad command: [video_fps] [4]
It does look like you did not get the latest update with the git. You could do a git clone in a
scratch directory and then diff the pikrellcam.c files. There should be a new "video_fps" section
in the command_process() function. I still need to add version numbers.

On the thumbs, I am going to go ahead and add a link in index.php to your thumbnails php, but I was
wondering if it would be better to have a separate "thumbs" directory? Having full sized jpgs
mixed with .th.jpgs might be a bigger maintenance headache but I don't know if you have a
reason for it to better for them to be mixed.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Jul 25, 2015 5:41 pm

YvesG wrote:I have now a good list of video and images : thanks to the accurate motion detection.
I think it could be helpful to be able to create directories in video_filename and still_filename
I'll have to think about how that affects everything and I want to get settled if we should have
a separate thumbs directory before I can figure that out. Absent that, could you manage
it with an hourly script that moves your videos to where you want? But then I guess then you wouldn't
have access to them from the web page so it may not be ideal.

Darn that sensitivity!

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Jul 25, 2015 5:53 pm

="jbeale"

Code: Select all

2015-07-24 21:25:05 ==== PiKrellCam started ====
...
circular buffer allocate: 11.00 MBytes (11 seconds at 8.0 Mbits/sec)
Bad command: [video_fps] [4]
Actually, if that was the total log, then for sure you were not running the new pikrellcam. There should
be sun times in the log now, you should see:

Code: Select all

sunrise/sunset times: valid  dawn/dusk times: valid
dawn:    6:20
sunrise: 6:46
sunset:  20:29
dusk:    20:55

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Jul 25, 2015 6:26 pm

I agree it is better to have full-size stills and thumbnails in separate folders. At the moment I had the motion-area-only thumbnails only and no full-size stills, that's why I could get away with the code I had.

Somehow I didn't have the updated file before, but now I do. Should the "sunrise" time format use two digits for the minutes?

Code: Select all

sunrise/sunset times: valid  dawn/dusk times: valid
dawn:    5:39
sunrise: 6:8
sunset:  20:20
dusk:    20:49

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Jul 25, 2015 8:00 pm

jbeale wrote: Somehow I didn't have the updated file before, but now I do. Should the "sunrise" time format use two digits for the minutes?

Code: Select all

sunrise/sunset times: valid  dawn/dusk times: valid
dawn:    5:39
sunrise: 6:8
sunset:  20:20
dusk:    20:49
I should format that better on the print so it reads 6:08, but in the at-commands file
if you put 6:8 it reads 6 hours 8 minutes so you can get away with it. But yeah, it looks funny.

toadleyb
Posts: 21
Joined: Sat Jan 04, 2014 11:05 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Jul 25, 2015 10:38 pm

Awesome piece of software. I have been using Raspimjpeg for quite a while and just start using this about a week ago. Couple of questions.

I can't seem to get it to generate thumbnails. I followed the post earlier in the thread to set it up. I copied the preview-save to the scripts directory. Opened the file and uncommented the appropriate commands and added the line to pikrellcam.conf to run preview save. Exactly what lines do I need to uncomment in the preview-save script to get it to save thumbnails? I do have it succesfully emailing me via the preview save script so I know the script is running.

Also I am getting a lot of false detects. I have the camera in my kitchen and in the detects I keep getting there is no noticeable motion. The only thing I see is very faint light changes. Can someone explain in noob terms changing the motion settings to get the appropriate detection.

If I go wander around in front of the camera instead of getting one long video of me I get several short videos with different portions of my wandering. I have the motion gap setting at 5 and from what I understand in reading the file this means if it continues to sense motion within 5 seconds it will continue to record the same video until it does not sense motion for 5 seconds and then it will end after whatever setting you have set for post gap. Am I correct?

I don't understand at all what vectors are. I assume the regions are simply to highlight the areas you want it to detect motion and it will not look for motion anywhere else.

I am using this more as just a learning experience than as an actual security cam. Although my apartment did get broken into a couple of years ago in the middle of the day and I wish I had this then!

Thanks for the help and the great software.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 26, 2015 12:04 am

toadleyb wrote:Exactly what lines do I need to uncomment in the preview-save script to get it to save thumbnails? I do have it succesfully emailing me via the preview save script so I know the script is running.
The thumbnails are put in the Stills directory. The line with the "convert" command is the one
to uncomment.
Also I am getting a lot of false detects. I have the camera in my kitchen and in the detects I keep getting there is no noticeable motion. The only thing I see is very faint light changes. Can someone explain in noob terms changing the motion settings to get the appropriate detection.
Be sure the camera is not sitting on a surface subject to vibrations or some disturbance. If you have
to you can reduce sensitivity by setting the Motion->Vector Limits higher and you would have
to experiment.
If I go wander around in front of the camera instead of getting one long video of me I get several short videos with different portions of my wandering. I have the motion gap setting at 5 and from what I understand in reading the file this means if it continues to sense motion within 5 seconds it will continue to record the same video until it does not sense motion for 5 seconds and then it will end after whatever setting you have set for post gap. Am I correct?
Yes, but whatever is causing the false detects may be interfering with getting successful re-triggers
to keep the motion detect going. To debug what is happening, turn on the showing of Regions and
Vectors and watch the screen. It may take some time but if you are getting false triggers there
should be some action on the screen. If you see sharp edges (door frames, counter top edges)
with flashes (those are the motion vectors being drawn) it's probably a sign that something is vibrating
the camera. If you see distributed "sparkles" all over the screen it could be the lighting is at a dim
level where the camera produces noise. If you can point the camera at a part of the kitchen
you don't mind people seeing, turn on showing of Regions and Vectors and post here one of
false detect jpegs that is emailed to you. It might give a clue.
I don't understand at all what vectors are. I assume the regions are simply to highlight the areas you want it to detect motion and it will not look for motion anywhere else.
Yes about the regions. The vectors are the information that the camera hardware generates
about how groups of pixels in the video may have moved from frame to frame. They are called
vectors because the information provides the direction and distance for the move.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 26, 2015 4:58 am

With the new PiKrellCam, the camera shifts to 4 fps after sunset as expected, and the motion detection still works! This is a great feature; for the first time I have a Pi camera system that works at night (under a streetlight; very blurry and noisy, but it still works).

toadleyb
Posts: 21
Joined: Sat Jan 04, 2014 11:05 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 26, 2015 9:20 am

Thanks for all the info Billw. I will play some more after work and see what I can figure out.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 26, 2015 9:22 am

jbeale wrote:With the new PiKrellCam, the camera shifts to 4 fps after sunset as expected, and the motion detection still works! This is a great feature; for the first time I have a Pi camera system that works at night (under a streetlight; very blurry and noisy, but it still works).
Yes it's very useful and works great with the standard cam (curious about the result with a pi-noIR),

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 26, 2015 1:04 pm

Hi all,

First of all I want to say thx for this great pice of code.
Just one question, I have mounted my NAS (/mnt/cam) and I want that the recorded movies/still images to be there.
I tried to edit the pikrellcam.conf file and set media_dir to

Code: Select all

media_dir /mnt/cam
but this doesn´t work. I need al little bit help, pls.

rgs
Jan

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 26, 2015 1:07 pm

Jasimo wrote:Hi all,

First of all I want to say thx for this great pice of code.
Just one question, I have mounted my NAS (/mnt/cam) and I want that the recorded movies/still images to be there.
I tried to edit the pikrellcam.conf file and set media_dir to

Code: Select all

media_dir /mnt/cam
but this doesn´t work. I need al little bit help, pls.

rgs
Jan
Hi Jan, could you make sure that you can write into /mnt/cam first, just do a

Code: Select all

touch /mnt/cam/check
and see if you have an error message (in that case you need to give write permission to your pi user to this folder)

PiKrellCam will create the symlink at the startup so be sure to stop and restart PiKrellCam after changing the config.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 26, 2015 1:22 pm

thanks for the reply, yes I have write permissions and

Code: Select all

touch /mnt/cam/check
generates a "check" file on my nas sucessfully.

after a reboot I have no preview of the camera in the webinterface ;-( see attachment.
Last edited by Jasimo on Sun Jul 26, 2015 1:24 pm, edited 1 time in total.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 26, 2015 1:24 pm

Jasimo wrote: after a reboot I have no preview of the camera in the webinterface ;-(
Go to system and push the restart button (in the web UI)

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 26, 2015 1:30 pm

I have no restart button under system, just a stop and a start button. Perfoming a stop-start doensn´t help.
Is it the right way to enter the mount directly in the pikrellcam.conf, or is there something to do with the scripts/motion-end file?

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 26, 2015 1:33 pm

Jasimo wrote:I have no restart button under system, just a stop and a start button. Perfoming a stop-start doensn´t help.
Is it the right way to enter the mount directly in the pikrellcam.conf, or is there something to do with the scripts/motion-end file?
Ok yes you are right was a start button. Ok so i don't have much more ideas

Should work as you did:
While the www directory itself is fixed, the media directory can be relocated from its /home/pi/pikrellcam/media default to something like /home/pi/media, /mnt/media or even /tmp/media which with /tmp as a tmpfs can be a useful SD card saving special case configuration as long as the limited space is managed. For this, edit media_dir in pikrellcam.conf, restart and the web page link to the new media directory will be automatically updated.

I changed the folder without any problem following those instructions
Sorry i can't help more

EDIT : can you check the symlink under /home/pi/pikrellcam/www
you should find media -> /mnt/cam

caldimerda
Posts: 67
Joined: Tue Oct 09, 2012 9:41 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 26, 2015 1:37 pm

Thanks for the advice billw and jbeale

I stepped down the video frame rate last night and the image does become more visible. But with the pi noir camera there is still a gulf between the image from Raspimpeg at night (fairly good out to about 10 metres) and pikreecam set even to 1 fps (not much visible beyond 2 metres).

I've no idea what the significance is of the "pre-buffered video". Is that something integral to the program's operation, or can that be switched off at night? I'd happily sacrifice motion detect accuracy - if that's the issue - when using the IR illumination, since at 1 fps nothing is clear enough to detect anyway!

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 26, 2015 1:59 pm

YvesG wrote:
Jasimo wrote:I have no restart button under system, just a stop and a start button. Perfoming a stop-start doensn´t help.
Is it the right way to enter the mount directly in the pikrellcam.conf, or is there something to do with the scripts/motion-end file?
Ok yes you are right was a start button. Ok so i don't have much more ideas

Should work as you did:
While the www directory itself is fixed, the media directory can be relocated from its /home/pi/pikrellcam/media default to something like /home/pi/media, /mnt/media or even /tmp/media which with /tmp as a tmpfs can be a useful SD card saving special case configuration as long as the limited space is managed. For this, edit media_dir in pikrellcam.conf, restart and the web page link to the new media directory will be automatically updated.

I changed the folder without any problem following those instructions
Sorry i can't help more

EDIT : can you check the symlink under /home/pi/pikrellcam/www
you should find media -> /mnt/cam
under the directory /home/pi/pikrellcam/www
I found media but not /mnt/cam
inside media are the three directorys stills,timelaps, videos

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 26, 2015 2:02 pm

@Jasimo could you stop PiKrellCam
then rm -Rf /home/pi/pikrellcam/www/media
then ln -sf /mnt/cam /home/pi/pikrellcam/www/media
Check in the PiKrellCam config that the media directory is /mnt/cam
Check that /home/pi/pikrellcam/www/media => /mnt/cam
Start again PiKrellCam
Check if stills,timelaps, videos folders have been created /mnt/cam

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 26, 2015 2:18 pm

done and under

Code: Select all

/home/pi/pikrellcam/www/media
I see my nas files
after a restart of PiKrellCam there are no directorys generated under /mnt/cam
and I got still no preview picture in the GUI

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 26, 2015 2:20 pm

something in log file maybe, could you check /tmp/pikrellcam.log

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 26, 2015 2:24 pm

just this

Code: Select all

2015-07-26 16:15:11 ==== PiKrellCam started ====
using FIFO: /home/pi/pikrellcam/www/FIFO
using mjpeg: /run/pikrellcam/mjpeg.jpg

2015-07-26 16:23:20 ==== PiKrellCam started ====
using FIFO: /home/pi/pikrellcam/www/FIFO
using mjpeg: /run/pikrellcam/mjpeg.jpg

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 26, 2015 2:26 pm

Next steps in the log are

Code: Select all

using FIFO: /home/pi/pikrellcam/www/FIFO
using mjpeg: /run/pikrellcam/mjpeg.jpg
execl:[/home/pi/pikrellcam/scripts-dist/init /home/pi/pikrellcam /home/pi/pikrellcam/media /run/pikrellcam/mjpeg.jpg /home/pi/pikrellcam/www/FIFO /tmp/pikrellcam.log]
  www/media link is already set to /home/pi/pikrellcam/media
  /home/pi/pikrellcam/www/config.php: MJPEG_FILE not changed.
  /home/pi/pikrellcam/www/config.php: FIFO_FILE not changed.
  /home/pi/pikrellcam/www/config.php: PIKRELLCAM not changed.
execl:[/home/pi/pikrellcam/scripts/startup /home/pi/pikrellcam /home/pi/pikrellcam/media /tmp/pikrellcam.log]
EDIT : so you can see that pikrellcam don't reach the line www/media link is already set to /home/pi/pikrellcam/media (that explain why the symlink wasn't create). Could you check in the 2 or 3 first pages of this thread there is a way to make the program more verbose, it could help to identify why it's stuck after 2 lines...

EDIT2 : verbose mode see here : viewtopic.php?p=792276#p792276

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 26, 2015 2:55 pm

found the problem, I mounted /mnt/cam
then in pikrellcam.conf the parameter has to be set to

Code: Select all

media_dir /mnt/cam/media
instead of

Code: Select all

media_dir /mnt/cam
thx for the help, now i can go on testing the other functionalities.

Return to “Camera board”