User avatar
Gavinmc42
Posts: 4293
Joined: Wed Aug 28, 2013 3:31 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Aug 28, 2016 7:19 am

A
dditional USB webcams?
J Beale has already been there, done that.
Script to save USB cam from Pikrellcam trigger.
viewtopic.php?f=38&t=156555&p=1024060&h ... r#p1024060
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

rpiatf2f10
Posts: 27
Joined: Sat Apr 23, 2016 10:16 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Sep 16, 2016 10:18 pm

HI Jbeable,

With regard to your script to delete old files, it seems that every run of your script will delete some portion of old files. I ran a few times manually, it finally brought down to 85%.

Questions
1. Why did the script not delete all at once to bring it down to 85%, when I manually do it.?
2. It might be that my Cron script was never being executed. Do you have any ideas to check how and why?
[email protected]:~ $ crontab -l
15 * * * * sudo -u pi /home/pi/pikrellcam/scripts/pk-archive 2>&1 | /usr/bin/logger -t PK-Archive

Thanks in advance.
peng

Fruitybit
Posts: 5
Joined: Sat Mar 05, 2016 10:05 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Sep 17, 2016 3:07 pm

Hey there, firstly- loving this, it's so nicely put together!) however, I have a small question; I can update the settings to start detection from boot up, but still have to physically press start for it to begin. Is there a way pikrellcam can be started automatically without me having to interface with it? So I can just plug it in and it starts recording if motion is detected? Or is it me just being dense again?!

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Sep 17, 2016 3:29 pm

@fruitybit: all of my PiKrellCam installs run automatically at bootup, I don't have to interact at all. If you have to push the "start" button under the System menu on the PKC web page, something isn't setup right.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Sep 17, 2016 3:36 pm

rpiatf2f10 wrote:With regard to your script to delete old files, it seems that every run of your script will delete some portion of old files. I ran a few times manually, it finally brought down to 85%.
I didn't actually write the script, I'm just using it. I think it does delete only one day at a time, but if you run it from 'cron' every hour, that is good enough to work OK (unless you are currently recording more than one day's worth of video every hour). If its in your crontab then it should work unless there's a permissions problem. Note that the way I had it, including the phrase

Code: Select all

/usr/bin/logger -t PK-Archive
it should be writing a line to the system log each time it runs. If you look at /var/log/syslog you should see lines like

Code: Select all

Sep 17 08:15:02 rp31 PK-Archive: used space below 85%, nothing to do!
show up every hour. If you don't see that each hour, then the code is not running for some reason. Do you have a blank line at the end of your crontab file? (That is required, for some reason)

Here are some reasons why a crontab task doesn't work:
http://askubuntu.com/questions/23009/re ... s-not-work

Fruitybit
Posts: 5
Joined: Sat Mar 05, 2016 10:05 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Sep 17, 2016 4:18 pm

jbeale wrote:@fruitybit: all of my PiKrellCam installs run automatically at bootup, I don't have to interact at all. If you have to push the "start" button under the System menu on the PKC web page, something isn't setup right.
Awesome- thanks for the swift reply!) I'll run the setup again and see if I've missed the obvious;)

Edit (and a very sheepish one at that);
May we blame this one on old age? It was the obvious after all;)) :oops:

rpiatf2f10
Posts: 27
Joined: Sat Apr 23, 2016 10:16 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Sep 22, 2016 1:25 pm

HI Jbeale,

here's what I have in cron
15 * * * * /home/pi/pikrellcam/scripts/pk-archive 2>&1 | /usr/bin/logger -t PK-Archive

I used $crontab -u pi -e and it had an blank line at bottom. I have a leading " " before 15 and not sure whether it's the reason cron not working.. I took it off now and I get the following in logs.
Sep 22 08:15:01 raspberrypi CRON[24278]: (pi) CMD (/home/pi/pikrellcam/scripts/pk-archive 2>&1 | /usr/bin/logger -t PK-Archive)
Sep 22 08:15:01 raspberrypi PK-Archive: archive_still day 2016-09-21
Sep 22 08:15:01 raspberrypi PK-Archive: /home/pi/pikrellcam/scripts/pk-archive: 19: /home/pi/pikrellcam/scripts/pk-archive: Syntax error: word unexpected (expecting ")")

It seems pointing to a syntax error in scripts, however this is the line 19 in script.
if [[ ( "$_USED_SPACE" > "$_USED_SPACE_LIMIT" ) ]] ; then
echo -e "used space over $_USED_SPACE_LIMIT%, deleting old files..."

I don't seem to see a problem there.
If I do cmd line , with
/home/pi/pikrellcam/scripts/pk-archive 2>&1 | /usr/bin/logger -t PK-Archive
I don't see any errors in logs.

More weird is that, in one of pi, I don't see complaint in logs, while rest of 4 had those complaints,
Sep 22 09:15:01 raspberrypi CRON[23106]: (pi) CMD (/home/pi/pikrellcam/scripts/pk-archive 2>&1 | /usr/bin/logger -t PK-Archive)
Sep 22 09:15:01 raspberrypi PK-Archive: archive_still day 2016-09-21
Sep 22 09:15:02 raspberrypi PK-Archive: used space below 85%, nothing to do!

All 5 use same script/cron setup.................!!!!!!!!!!?????????????

THanks
peng

Ongelma
Posts: 113
Joined: Wed Dec 03, 2014 6:46 am

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Oct 05, 2016 11:40 am

Hello again!

First i have to say this is just superb software!!!

And im back with additional feature requests. :D (if you remember i asked those halt and reboot buttons some time ago ;)

I would love to have options in the web interface of this pikrell, to give some timer values for timelapse.

For example these features or just the other. ;)
- clock time to start and stop the timelapse
- hours, minutes to give, how long will the timelapse run

What would be even more amazing would be like a alarm clock app in the ios or android where you can just "tick boxes" which days: mon, tue, wed, thu, fri, sat, sun the timer would run.

Example: weekdays and start from 05am and end to 08pm etc.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Oct 07, 2016 3:26 pm

Ongelma wrote: And im back with additional feature requests.
I've had in mind that timelapse features should be improved and those are some good ideas, thanks.
Also I want to be able to set up multiple timelapses to be running at the same time.

Ongelma
Posts: 113
Joined: Wed Dec 03, 2014 6:46 am

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Oct 10, 2016 10:58 am

Cant wait for these new things. :)

Tashman
Posts: 16
Joined: Tue Mar 08, 2016 11:23 am

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Oct 13, 2016 3:05 pm

Hi all
I've had 2 rpis with pikrellcam running for a good few months now.

Just recently one of the installs has started malfunctioning every few days.

Where should I start to gather info to help solve the issue?

Symptoms are 1 no emails, 2 rpi is up (I can ssh in & reboot) 3 if I goto that pikrellcam Web page I can look at the video archive, click about etc BUT the camera picture is frozen (presumably at the time whatever happened happened). If I click on "preset" nothing happens, nor do any camera parameter settings appear on the OSD.
4 after a reboot via ssh all is well until a few days later and same thing happens.

All help appreciated
Thanks
Tashman

Ongelma
Posts: 113
Joined: Wed Dec 03, 2014 6:46 am

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Oct 13, 2016 4:22 pm

Is your sd card full? ;-) i had some weirdnes when i had mine full of vids.

Tashman
Posts: 16
Joined: Tue Mar 08, 2016 11:23 am

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Oct 13, 2016 4:33 pm

Ongelma wrote:Is your sd card full? ;-) i had some weirdnes when i had mine full of vids.
Hi No its abt 80% free. I'm quite good at clearing stuff off :-)

Tashman
Posts: 16
Joined: Tue Mar 08, 2016 11:23 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Oct 16, 2016 6:12 pm

Tashman wrote:Hi all
I've had 2 rpis with pikrellcam running for a good few months now.

Just recently one of the installs has started malfunctioning every few days.

Where should I start to gather info to help solve the issue?

Symptoms are 1 no emails, 2 rpi is up (I can ssh in & reboot) 3 if I goto that pikrellcam Web page I can look at the video archive, click about etc BUT the camera picture is frozen (presumably at the time whatever happened happened). If I click on "preset" nothing happens, nor do any camera parameter settings appear on the OSD.
4 after a reboot via ssh all is well until a few days later and same thing happens.

All help appreciated
Thanks
Tashman
Can anyone advise how to proceed please? What info is needed? BillW? Jbeale?
Thanks in advance
Tashman

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

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Oct 17, 2016 4:37 am

Tashman wrote: Symptoms are 1 no emails, 2 rpi is up (I can ssh in & reboot) 3 if I goto that pikrellcam Web page I can look at the video archive, click about etc BUT the camera picture is frozen (presumably at the time whatever happened happened). If I click on "preset" nothing happens, nor do any camera parameter settings appear on the OSD.
4 after a reboot via ssh all is well until a few days later and same thing happens.
When this happens, is pikrellcam still running?

If not, can you restart pikrellcam without having to reboot?
If the restart fails, do the restart from the ssh terminal to see any messages. If the restart works, then if you
could run pikrellcam from the ssh terminal for the duration of the time it takes for the problem to
happen again there could be an exit reason printed that could give a clue.

If if is still running when things stop working, is the /run/pikrellcam/mjpeg.jpg file getting updated (look at ls -l time).

Tashman
Posts: 16
Joined: Tue Mar 08, 2016 11:23 am

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Oct 17, 2016 1:16 pm

billw wrote:
Tashman wrote: Symptoms are 1 no emails, 2 rpi is up (I can ssh in & reboot) 3 if I goto that pikrellcam Web page I can look at the video archive, click about etc BUT the camera picture is frozen (presumably at the time whatever happened happened). If I click on "preset" nothing happens, nor do any camera parameter settings appear on the OSD.
4 after a reboot via ssh all is well until a few days later and same thing happens.
When this happens, is pikrellcam still running?

If not, can you restart pikrellcam without having to reboot?
If the restart fails, do the restart from the ssh terminal to see any messages. If the restart works, then if you
could run pikrellcam from the ssh terminal for the duration of the time it takes for the problem to
happen again there could be an exit reason printed that could give a clue.

If if is still running when things stop working, is the /run/pikrellcam/mjpeg.jpg file getting updated (look at ls -l time).
Yes its still running but the 'live' camera picture on the Pikrellcam web page is frozen, displaying an old camera image from presumably when it went wrong.

The osd overlays (eg Setup,Config,Video Res) don't appear either.

Next time I'll check the mjpeg.jpg file as you suggest & report back.

Is this likely to be a camera problem?

Thanks

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

external alarm trigger?

Mon Oct 17, 2016 5:20 pm

Has anyone tried using PiKrellCam to trigger an external signal? For example, as soon as a motion event is detected, you bring a GPIO pin high, maybe through a shell command. Since I normally use the pre-trigger buffer, I haven't paid attention to the exact response time of the motion detection. I was thinking of turning on an external illuminator to get better image quality, but it uses so much power that I don't want to keep it on all night. I guess normally people have lights on PIR sensors, but I haven't found those to be as reliable (false positive / false negative) as the PiKrellCam motion detection. Obviously it doesn't work in total darkness but what I have now is dim light, it is good enough for motion detection but gives me less than ideal image quality on the recorded video, particularly if there is fast motion.

jit
Posts: 33
Joined: Fri Apr 18, 2014 2:52 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Oct 17, 2016 7:57 pm

Is there any way to configure the size of the thumbnails that get generated on motion events? I have a camera where the thumbnails taken of people are of a very small area, e.g. maybe just someones hand or foot. Ideally I'd like the thumbnail to cover a larger area so that you could potentially see more of the person in the thumbnail.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Oct 17, 2016 8:09 pm

Is the motion_area_min_side parameter in ~/.pikrellcam/pikrellcam.conf useful for this?

punktea
Posts: 21
Joined: Thu Jul 18, 2013 8:55 am

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Oct 18, 2016 8:03 am

I've just started to use this great program. I have a need to make a long recording in manual mode. I notice that video file size grows to 2G (2147483647 bytes to be exact) then stops. Everything else seems to run normally. This happens on 2 different systems. I looked through the config file and could not see any related parameter. I would like to know if there is a way to raise the limit.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Oct 18, 2016 2:52 pm

punktea wrote:I've just started to use this great program. I have a need to make a long recording in manual mode. I notice that video file size grows to 2G (2147483647 bytes to be exact) then stops. Everything else seems to run normally. This happens on 2 different systems. I looked through the config file and could not see any related parameter. I would like to know if there is a way to raise the limit.
It seems it's a library limitation when pikrellcam is compiled:
viewtopic.php?t=45330&p=358772
So either you have to lower the bitrate to get longer videos or you could try recompiling pikrellcam.
If you want to try a compile, go to the pikrellcam/src directory and edit Makefile. Change the line:

Code: Select all

FLAGS = -O2 -Wall $(MMAL_INCLUDE) $(INCLUDES)
to
FLAGS = -O2 -Wall $(MMAL_INCLUDE) $(INCLUDES) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
and the run: make

I'll try this at some point myself, but if you try it and it works, let me know.

Fox Mulder
Posts: 42
Joined: Fri Sep 21, 2012 11:24 am

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Oct 18, 2016 5:44 pm

jit wrote:Is there any way to configure the size of the thumbnails that get generated on motion events? I have a camera where the thumbnails taken of people are of a very small area, e.g. maybe just someones hand or foot. Ideally I'd like the thumbnail to cover a larger area so that you could potentially see more of the person in the thumbnail.
I think the already mentioned motion_area_min_side could be helpful for setting the area in the preview.

And if you want the resolution of the preview to be higher than the default 150x150 Pixel you have to change the file pikrellcam/scripts-dist/_thumb at the end. But beware that the file _thumb maybe get overridden when updating pikrellcam.
The following line at the end of the script converts the captured image to the thumbnail:

Code: Select all

convert $PREVIEW_JPEG -crop ${SZ}x$SZ+$XO+$YO -resize 150x150\! $THUMB_JPEG_DIR/$THUMB_JPEG
I changed it to just copy the captured image to have a full resolution preview image:

Code: Select all

cp $PREVIEW_JPEG $THUMB_JPEG_DIR/$THUMB_JPEG
Ciao,
Rainer

punktea
Posts: 21
Joined: Thu Jul 18, 2013 8:55 am

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Oct 19, 2016 1:11 am

billw wrote:
punktea wrote:I've just started to use this great program. I have a need to make a long recording in manual mode. I notice that video file size grows to 2G (2147483647 bytes to be exact) then stops. Everything else seems to run normally. This happens on 2 different systems. I looked through the config file and could not see any related parameter. I would like to know if there is a way to raise the limit.
It seems it's a library limitation when pikrellcam is compiled:
viewtopic.php?t=45330&p=358772
So either you have to lower the bitrate to get longer videos or you could try recompiling pikrellcam.
If you want to try a compile, go to the pikrellcam/src directory and edit Makefile. Change the line:

Code: Select all

FLAGS = -O2 -Wall $(MMAL_INCLUDE) $(INCLUDES)
to
FLAGS = -O2 -Wall $(MMAL_INCLUDE) $(INCLUDES) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
and the run: make

I'll try this at some point myself, but if you try it and it works, let me know.
I recompiled and it worked great!

jit
Posts: 33
Joined: Fri Apr 18, 2014 2:52 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Oct 20, 2016 6:48 am

Fox Mulder wrote:
jit wrote:Is there any way to configure the size of the thumbnails that get generated on motion events? I have a camera where the thumbnails taken of people are of a very small area, e.g. maybe just someones hand or foot. Ideally I'd like the thumbnail to cover a larger area so that you could potentially see more of the person in the thumbnail.
I think the already mentioned motion_area_min_side could be helpful for setting the area in the preview.

And if you want the resolution of the preview to be higher than the default 150x150 Pixel you have to change the file pikrellcam/scripts-dist/_thumb at the end. But beware that the file _thumb maybe get overridden when updating pikrellcam.
The following line at the end of the script converts the captured image to the thumbnail:

Code: Select all

convert $PREVIEW_JPEG -crop ${SZ}x$SZ+$XO+$YO -resize 150x150\! $THUMB_JPEG_DIR/$THUMB_JPEG
I changed it to just copy the captured image to have a full resolution preview image:

Code: Select all

cp $PREVIEW_JPEG $THUMB_JPEG_DIR/$THUMB_JPEG
Ciao,
Rainer
Updating _thumb to perform the copy is exactly what I needed. Thank you!

Tashman
Posts: 16
Joined: Tue Mar 08, 2016 11:23 am

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Oct 21, 2016 7:47 am

Tashman wrote:
billw wrote:
Tashman wrote: Symptoms are 1 no emails, 2 rpi is up (I can ssh in & reboot) 3 if I goto that pikrellcam Web page I can look at the video archive, click about etc BUT the camera picture is frozen (presumably at the time whatever happened happened). If I click on "preset" nothing happens, nor do any camera parameter settings appear on the OSD.
4 after a reboot via ssh all is well until a few days later and same thing happens.
When this happens, is pikrellcam still running?

If not, can you restart pikrellcam without having to reboot?
If the restart fails, do the restart from the ssh terminal to see any messages. If the restart works, then if you
could run pikrellcam from the ssh terminal for the duration of the time it takes for the problem to
happen again there could be an exit reason printed that could give a clue.

If if is still running when things stop working, is the /run/pikrellcam/mjpeg.jpg file getting updated (look at ls -l time).
Yes its still running but the 'live' camera picture on the Pikrellcam web page is frozen, displaying an old camera image from presumably when it went wrong.

The osd overlays (eg Setup,Config,Video Res) don't appear either.

Next time I'll check the mjpeg.jpg file as you suggest & report back.

Is this likely to be a camera problem?

Thanks
Hi again, it did it again this morning.
The mjpeg.jpg file is not changing (same size) when checked as you outlined.

What's next billw?

Thanks
Tashman

Return to “Camera board”