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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jan 21, 2018 12:02 am

arnauld wrote:
Sat Jan 20, 2018 5:56 pm
Also, could you tell me what I should change in the .conf file so that the camera and mic stop recording 30 seconds after the end of detecting the last motion.
You need to set the post capture time in the GUI: Setup->Config->Times->Post_Capture
Or in the config file, edit motion_post_capture.

If you set that longer than event_gap, event_gap will be auto changed to match because post capture
can't be < event gap.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jan 21, 2018 12:04 am

I"ve been making the web pages show if archiving is to a NFS, and there's now some help about NFS setup.

Rasilon
Posts: 84
Joined: Wed Mar 11, 2015 7:30 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jan 21, 2018 1:09 am

How would I connect to pikrellcam from a remote location? I don't know what to put in the internet address bar

Rasilon
Posts: 84
Joined: Wed Mar 11, 2015 7:30 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jan 21, 2018 11:17 pm

NV I cheated and used a service.

arnauld
Posts: 20
Joined: Wed Oct 14, 2015 2:12 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Jan 22, 2018 3:24 pm

billw wrote:
Sun Jan 21, 2018 12:02 am
You need to set the post capture time in the GUI: Setup->Config->Times->Post_Capture
Or in the config file, edit motion_post_capture.
If you set that longer than event_gap, event_gap will be auto changed to match because post capture
can't be < event gap.
thank you.

Rasilon
Posts: 84
Joined: Wed Mar 11, 2015 7:30 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Jan 22, 2018 8:56 pm

Feature request. Share to Facebook, youtube ect.

Ouba
Posts: 11
Joined: Sun Jan 01, 2017 4:12 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Jan 24, 2018 11:15 am

Hi,

I try to use an RPI IR Cut auto filter camera with pikrellcam.
My goal is to activate this filter by using in the at-commands.conf file "sunrise" and "sunset". At sunrise and sunset a python script will set a gpio pin to high or low. By this way, the Ir Cut Filter will be switched.
I think that i have to create 2 python scripts, one for the sunrise and one for the sunset. Then I have to place them in the /home/user/pikrellcam/scripts an call them. Example of what I will put in the at-commands:
daily sunrise "$C/do-switchOnIrCut"
daily sunset "$C/do-switchOffIrCut"

Do you think that it is the good way to make this Ir Cut Fully fonctionnal ?

@Billw: Thanks again for this great software

sarkass
Posts: 1
Joined: Thu Jan 25, 2018 5:28 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jan 25, 2018 6:01 pm

Is there a known way to view the camera output in pikrellcam not using tcp? Maybe similar to the way raspivid works. Not a big deal, but thought I'd ask.

Nestboxtech
Posts: 55
Joined: Fri Apr 11, 2014 9:45 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Feb 24, 2018 11:47 pm

Ouba wrote:
Wed Jan 24, 2018 11:15 am
Hi,

I try to use an RPI IR Cut auto filter camera with pikrellcam.
My goal is to activate this filter by using in the at-commands.conf file "sunrise" and "sunset". At sunrise and sunset a python script will set a gpio pin to high or low. By this way, the Ir Cut Filter will be switched.
I think that i have to create 2 python scripts, one for the sunrise and one for the sunset. Then I have to place them in the /home/user/pikrellcam/scripts an call them. Example of what I will put in the at-commands:
daily sunrise "$C/do-switchOnIrCut"
daily sunset "$C/do-switchOffIrCut"

Do you think that it is the good way to make this Ir Cut Fully fonctionnal ?

@Billw: Thanks again for this great software

I would also be v interested to know how to do this. I'm using pyephem python module to switch an IR filter and control illumination in a BirdBox, and am using pikrellcam for the video (+audio) capture - If I could use PiKrellCam to do this would remove a layer of complexity, I hadn’t considered to use pikrellcam directly to do this. I coincidentally recently wrote the following summary of various approaches to trigger events based on whether its day or night: http://nestboxtech.blogspot.co.uk/2018/ ... vents.html
http://nestboxtech.blogspot.co.uk/

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Feb 25, 2018 6:27 pm

Nestboxtech wrote:
Sat Feb 24, 2018 11:47 pm
Ouba wrote:
Wed Jan 24, 2018 11:15 am
Hi,

I try to use an RPI IR Cut auto filter camera with pikrellcam.
My goal is to activate this filter by using in the at-commands.conf file "sunrise" and "sunset". At sunrise and sunset a python script will set a gpio pin to high or low. By this way, the Ir Cut Filter will be switched.
I think that i have to create 2 python scripts, one for the sunrise and one for the sunset. Then I have to place them in the /home/user/pikrellcam/scripts an call them. Example of what I will put in the at-commands:
daily sunrise "$C/do-switchOnIrCut"
daily sunset "$C/do-switchOffIrCut"

Do you think that it is the good way to make this Ir Cut Fully fonctionnal ?

@Billw: Thanks again for this great software

I would also be v interested to know how to do this. I'm using pyephem python module to switch an IR filter and control illumination in a BirdBox, and am using pikrellcam for the video (+audio) capture - If I could use PiKrellCam to do this would remove a layer of complexity, I hadn’t considered to use pikrellcam directly to do this. I coincidentally recently wrote the following summary of various approaches to trigger events based on whether its day or night: http://nestboxtech.blogspot.co.uk/2018/ ... vents.html
Running your script that toggles gpios from at-commands.conf is the way to do it. Since it's already bright by sunrise, maybe offset
the run by some minutes like sunrise-10 and sunset+10. Maybe it's not worth the effort, but a FYI is that since the rate light level
changes can vary over the year, you could even set the command to run at a fixed percent of the time between dawn-sunrise and
sunset-dusk. /run/pikrellcam/state has dawn, sunrise, sunset, and dusk times in minutes and a script run at dawn and sunset
could read the file and calculate the minutes dawn to sunrise and sunset to dusk and sleep wait to toggle gpios until some percent of
those intervals.

@Nestboxtech, the SunWait you tried looks like it is based on the same public domain core routines in a sunriset.c file that I put
into pikrellcam to do the calculations. SunWait seems to have redone parts of the sunriset.c code and I haven't tried getting it to
work, but I think I had to make a small tweak to sunriset.c to get things working in pikrellcam.

Ian
Posts: 4
Joined: Sat May 25, 2013 9:45 am

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Feb 27, 2018 9:31 am

Hello, thanks for this great software.

I've set it all up and did a motion test, but the mp4 files when exported are 0k, when I check in the media > video folder the corresponding h264 file size is at an expected MB.

Am I missing a muxing setting?

Regards
Ian

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

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Feb 28, 2018 12:41 am

Ian wrote:
Tue Feb 27, 2018 9:31 am
Hello, thanks for this great software.

I've set it all up and did a motion test, but the mp4 files when exported are 0k, when I check in the media > video folder the corresponding h264 file size is at an expected MB.

Am I missing a muxing setting?

Regards
Ian
The MP4Box command is probably not succeeding. What's in the log from the line starting with "Motion record start" to the line
starting with "convert"? Some of the lines are very long..

Also, stop pikrellcam from the web page and then run the pikrellcam program from a terminal to see any error messages from the
MP4Box command.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Mar 03, 2018 10:19 am

Big storm, floods, blackouts or lighting took out my 3TB hard drive :(
Should have checked but PiKrellcam just works that I am unused to confirming the systems are working.
Anyway, up and running with third Pi2 system now installed with one PS3 Eyecam, the audio function is great :D
Got storage for 4 days, get new drive next week.

Been a few decades but I'm relearning php to mod index.php to include snapshots from the Eyecam.
Currently testing with fwebcam but is there a way to stream and record the video from the Eyecam?

I have moved the picamera mjpeg to the left and I'm trying to get the Eyecam output in a smaller vid window on the right of the pages.
A second Eyecam output will go below that, onclick will blow them up for better viewing.
Since I have nearly no clue, I am having fun breaking pikrellcam.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Mar 04, 2018 12:51 pm

Further experiments to utilize the video from the Eyecam, while Pikrellcam uses the audio from it's microphones.

fswebcam can get 45fps is you use -F 3, ie 3 frames but it only saves the last file.
A shell loop will time stamp files but so far the faster I have gone is about 5 seconds between images.
Saving to a memory array and then running a command at the end to save images to SDcard should increase speed.
Perhaps mencoder to convert to mjpeg.

uvccapture is another program that works on Pi's with the Eyecam.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Luno
Posts: 3
Joined: Wed Aug 24, 2016 1:20 am

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Mar 05, 2018 2:52 pm

Advice, or maybe a feature request:

I'm using Pikrellcam with a shock sensor on a GPIO pin as an external FIFO trigger, which works as intended either by starting a manual record with "record on 10 6" or as a FIFO motion trigger with "motion trigger 1". What I would like is an "AND" function so that both motion detect and the external trigger need to be triggered for recording to start.
There is however now the possibility that I use the existing command "on motion detect" to tie the two inputs together, but how do I do that?

-Do I let a script triggered by "on motion" check the status of the GPIO pin?
-Is it possible to query a "motion detected" flag in Pikrellcam from my existing script?
-Maybe the easiest would be if I let the GPIO trigger "enable_motion on" and then "on_motion_end" >> "enable_motion off"?

Edit: My last suggestion works; editing #on_motion_end in pikrellcam.conf to:
[on_motion_end echo "motion_enable off" > /home/pi/pikrellcam/www/FIFO]
sets motion to "motion off" after the recording ends!!! Success!!!
What my shock sensor script does is simply :echo "motion_enable on" > /home/pi/pikrellcam/www/FIFO] , wait 5 seconds, then a "motion_enable off"

Edit2: HMM.. Stopping motion detect from script with "motion_enable off" kills any ongoing recording. I will investigate how to use state files so I rather have my script check if motion is detected and then enable motion detection. That should be possible?

The reason this functionality is important to me is because I use Pikrellcam as a car alarm monitoring my driveway with a view of the street and either motion detect or the shock sensor produces a multitude of false positives. However if I could combine the inputs, I would have a very false-trigger immune system

Thank you Bill for a slick piece of software (anyone can have a go at answering this)
Last edited by Luno on Fri Mar 16, 2018 1:26 pm, edited 2 times in total.

Teknor
Posts: 3
Joined: Fri Apr 14, 2017 4:35 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Mar 09, 2018 9:14 am

Configure PiKrellCam with password

Hi - did not include a password for the web interface during setup. I've changed my mind, and now would like to have a pwd. Is there a way to include this directly in the config file? All tips are highly appreciated.

Nestboxtech
Posts: 55
Joined: Fri Apr 11, 2014 9:45 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Apr 01, 2018 7:31 pm

I want to send a text string to overlay the video stream. I can make it work fine by echoing directly from a command prompt:

echo inform \"Have a nice day\" > ~/pikrellcam/www/FIFO
echo inform timeout 2.5 > ~/pikrellcam/www/FIFO

I want to add this to a python script, and have tried various methods involving os.system and subprocess.call, but cant seem to replicate it in python. The closest I've got in my python script is:

import subprocess
subprocess.call("'echo inform \\""\"Have a nice day2""\\\" > ~/pikrellcam/www/FIFO\'", shell=True)

generates the following command output to the terminal window. Looks like if cant find the FIFO pipe?
/bin/sh: 1: echo inform \"Have a nice day2\" > ~/pikrellcam/www/FIFO: not found
http://nestboxtech.blogspot.co.uk/

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

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Apr 02, 2018 5:39 am

An old Pi2 Pikrellcam with Sony USB PS3 Eyecam as the microphone plus external USB stick to storage has issues.
The motion detect locks up and I need to keep hitting the start button.

I suspect I have reached the limits of the Pi2's USB port ;)
Reading USB microphone and at the same time writing the USB drive and web serving might be beyond even a Pi2.
Pi's eLinux page does mention USB webcams can cause trouble.
Been using eyecams for years so I suspect it is the added USB storage conflicting as it seems to lock on writing the motion file.

Unplug/disable the Eyecam, use the sd card for storage and same install works fine.
Will plug Eyecam back it for more testing.
Time to look at I2S microphones?

Will a Pi3B+ work better?
The LAN7514 is a custom chip, 1GB Ethernet and USB hub, is it two dies in one package, more buffer ram?

Time to try a Pi3B's as network drive so the Pikrellcams can archive to this external NFS.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

cyclops1982
Posts: 2
Joined: Wed Apr 04, 2018 8:00 am

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Apr 04, 2018 8:04 am

Hi,

I've seen quite a few people wondering if PiKrellCam works with the Pi Zero and the V2 cam.

I can confirm that this works. I have the PI Zero W with the V2 cam (NO-IR) and it works fine. CPU load is around 10% with full resolution video and i've had no issue recording or playing video back.

Together with the ZeroView (mounting bracket) it really becomes an amazing package. Thank you for the great work!

As i'm now looking for a second option, i was wondering if the camera needs to be specific, or if other raspberry pi camera's will also work.
Currently looking at this: https://raspberrypi.dk/en/product/zerocam-fisheye/ or https://thepihut.com/collections/raspbe ... berry-pi-3

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

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Apr 04, 2018 5:19 pm

Hi,

i have a little annoying problem when using pikrellcam with an read-only file-system. I mounted all necessary directories as tmpfs and the root file-system as read only so i can shut down the rpi with no data loss. The live video works fine as long as i mount the root fs writeable. But as soon as i mount it read-only i got most of the time some white area in the lower part of the video. Some frames are fine but most are not correctly shown.
I attached a screenshot from my browser where the problem is shown. It is interesting that the video is ok when i record it or still images and timelaps images are also ok.

I don't know what the problem could be but maybe someone here has an idea. :)

Ciao,
Rainer
Screenshot.jpg
Screenshot.jpg (21.22 KiB) Viewed 2288 times

Nestboxtech
Posts: 55
Joined: Fri Apr 11, 2014 9:45 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Apr 13, 2018 10:52 pm

Nestboxtech wrote:
Sun Apr 01, 2018 7:31 pm
I want to send a text string to overlay the video stream. I can make it work fine by echoing directly from a command prompt:

echo inform \"Have a nice day\" > ~/pikrellcam/www/FIFO
echo inform timeout 2.5 > ~/pikrellcam/www/FIFO

I want to add this to a python script, and have tried various methods involving os.system and subprocess.call, but cant seem to replicate it in python. The closest I've got in my python script is:

import subprocess
subprocess.call("'echo inform \\""\"Have a nice day2""\\\" > ~/pikrellcam/www/FIFO\'", shell=True)

generates the following command output to the terminal window. Looks like if cant find the FIFO pipe?
/bin/sh: 1: echo inform \"Have a nice day2\" > ~/pikrellcam/www/FIFO: not found
?anyone
http://nestboxtech.blogspot.co.uk/

arnauld
Posts: 20
Joined: Wed Oct 14, 2015 2:12 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Apr 15, 2018 3:53 pm

cyclops1982 wrote:
Wed Apr 04, 2018 8:04 am
As i'm now looking for a second option, i was wondering if the camera needs to be specific, or if other raspberry pi camera's will also work.
Currently looking at this: https://raspberrypi.dk/en/product/zerocam-fisheye/ or https://thepihut.com/collections/raspbe ... berry-pi-3
It works, I am using the https://thepihut.com/collections/raspbe ... berry-pi-3 to record hedgehogs at night and it is working fine.

Zuifer
Posts: 8
Joined: Mon Apr 16, 2018 11:02 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Apr 16, 2018 11:20 pm

Hello everyone

Thank you for this great Application.

But i have a problem….it freezed my Raspberry after a while.

Right now my solution is using raspivid with vlc as rtsp stream
and then i start ffmpeg to capture the stream locally.

raspivid -o - -t 0 -w 1920 -h 1080 -fps 30 -b 2500000 | cvlc -vvv stream:///dev/stdin --sout '#rtp{access=udp,sdp=rtsp://:8554/stream}' :demux=h264

(Everybody writes :8554/ but without a /stream it has never worked for me)

ffmpeg -i rtsp://192.168.0.19:8554/stream -acodec copy -vcodec copy -r 25 $(date +\%Y\%m\%d\%H)_test.mp4


This does work very well. I can use more than one instances of ffmpeg dumping the stream.
I tried to combine this with motion, but it crashed the pi after a while. But as i mentioned the manual streaming and dumping works stable.

And only raspivid to vlc and dumping with ffmpeg works. Vlc and Vlc not. I think they hate eachother.

My configuration:

30-50% cpu
68 MB RAM with picrellm

Raspberry Zero W
updated raspian small
GPU Memory 256MB

Now my problem:


After ca.: 30 min without recording i get a freezed Picture in the webstream, the webinterface dont work anymore, but raspberry is working.


Interesting parts of syslog:

Code: Select all

Apr 16 20:17:02 raspberrypi CRON[1013]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Apr 16 20:21:18 raspberrypi kernel: [ 1454.870324] Unable to handle kernel NULL pointer dereference at virtual address 00000003
….
Apr 16 20:21:18 raspberrypi kernel: [ 1454.907581] Stack: (0xcd09f818 to 0xcd0a0000)
Apr 16 20:21:18 raspberrypi kernel: [ 1454.907585] f800:                                                       cd09f8fc 00002900
Apr 16 20:21:18 raspberrypi kernel: [ 1454.907589] f820: 00000a40 d31f4034 00000008 00000040 0000000f 00000000 cf036cd0 d31f4034

Second part:

Code: Select all

Apr 16 20:21:18 raspberrypi kernel: [ 1454.907856] [<c03922d8>] (cfb_imageblit) from [<c0392ccc>] (bcm2708_fb_imageblit+0x18/0x1c)
Apr 16 20:21:18 raspberrypi kernel: [ 1454.907860] [<c0392ccc>] (bcm2708_fb_imageblit) from [<c0390938>] (bit_putcs+0x254/0x400)
....
Apr 16 20:21:18 raspberrypi kernel: [ 1454.907931] [<c06357a0>] (do_page_fault) from [<c0009200>] (do_DataAbort+0x44/0xc4)
Apr 16 20:21:18 raspberrypi kernel: [ 1454.907935] [<c0009200>] (do_DataAbort) from [<c0634e94>] (__dabt_svc+0x54/0x80)
Apr 16 20:21:18 raspberrypi kernel: [ 1454.907937] Exception stack(0xcd09fdf8 to 0xcd09fe40)
Apr 16 20:21:18 raspberrypi kernel: [ 1454.907942] fde0:                                                       00000000 00000000
Apr 16 20:21:18 raspberrypi kernel: [ 1454.907946] fe00: 00000000 00000004 cbc6180c 00000003 cbc61000 048ea0a8 00000000 cf580194
Apr 16 20:21:18 raspberrypi kernel: [ 1454.907950] fe20: 00000000 cd09ff0c cd09fe48 cd09fe48 c0502e50 c0502a58 60000013 ffffffff
Apr 16 20:21:18 raspberrypi kernel: [ 1454.907953] [<c0634e94>] (__dabt_svc) from [<c0502a58>] (vchiq_ioctl+0x4a0/0x1958)
Apr 16 20:21:18 raspberrypi kernel: [ 1454.907957] [<c0502a58>] (vchiq_ioctl) from [<c016c824>] (do_vfs_ioctl+0x9c/0x754)
Apr 16 20:21:18 raspberrypi kernel: [ 1454.907960] [<c016c824>] (do_vfs_ioctl) from [<c016cf20>
Apr 16 20:21:18 raspberrypi kernel: [ 1454.907966] Lost 3 message(s)!

If i trigger the record thru motion the same thing happens.

Maybe the memory?
Has anybody the same Problem. I dont know, as i mentioned motion kills the zero too. But with 100% CPU usage and here i still can get on the pi console but the webinterface is broken and cpu is at 5-10% usage.
But only manual stream with ffmpeg works and is stable.


My other Question regarding streaming, capture etc. is :
I am right that the stream is mjpeg and the saved files are h.264?
Why not both h.264. Omxmotion, which doesnt compile for me can do stream and capture in h.264.
I think that both programs use the same principle of encoder motion detection. The threads i read, never gave me i clear status what has been archieved by now. Mjpeg is for sure faster and easier to get into a webpage. But you use the motion vectors of the h.264 encode? Is it possible to get the stream too? I am no programmer, just confused which technique is used and i hope direct stream is possible. It would be a perfect feature. Webinterface and rtsp stream (or netcat).

Thanks

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

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Apr 17, 2018 8:08 am

Been having trouble with microSD cards in the bigger sizes, saw this on another Pi post :D
https://www.wdc.com/products/surveillan ... DD032G1P0A

I use WD purple drives on my main camera, need more reliable SDs for the satellite cams.
Wonder if a ram drive could be used locally and archived on the hour to the network main drive?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

siddyboy
Posts: 1
Joined: Mon Apr 23, 2018 9:41 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Apr 24, 2018 11:30 am

Liking this sw a lot so far.
Trying to set up to take stills on motion detect but I'm obviously missing something really simple. I can set up to capture video but not stills. What settings do I need to change?
I have Pi0W+PicamV2. Using Kweb (Chromium way too slow.)
Hoping to set up headless eventually - although the virtual VNC desktop does not work for me.
Any help gratefully received.

Edit: is it as simple as commenting out the timelapse -> mp4 converter line in the .conf?

Return to “Camera board”