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

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Dec 21, 2017 3:34 pm

DaveDJ : Note, that microphone is stereo by itself, but the USB audio adaptor you linked to says only: "Mono microphone (optional)" so it will not give you a stereo input data stream through USB into the R-Pi. AFAIK there are no simple cheap audio input adaptors for stereo. There is only one stereo input option available for the RPi under $10 that I am aware of, the PS3-Eye Cam: https://www.amazon.com/Sony-PlayStation ... B0072I2240

The next cheapest is probably this Behringer stereo line-in cable https://www.amazon.com/gp/product/B01DT827FA plus two line-level-out mics (which would also need their own power.)

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

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Dec 27, 2017 8:19 pm

I want to move the media folder to a usb drive. How do i do that. I cannot find pickrell.conf.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Dec 27, 2017 8:45 pm

You have to search in :

/home/"your user name"/. pikrellcam/pikrellcam.conf

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

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Dec 28, 2017 12:51 am

Thankyou that worked. I have another question, How would I get the media files to save on another pi through wifi. I have this camera outside and it is -22 atm. The pidrive seems to stop working when it gets very cold. So for now I have put to OS and everything on the SD card and the pidrive is used for storage only. however I have not tested this yet.

allen2000
Posts: 8
Joined: Thu Mar 03, 2016 3:00 am

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Dec 28, 2017 5:53 am

Hello,
Thanks for the great work.
Here comes one question that whether it is possible to have a loop video recording with motion log as well as still thumbs saved.
In case there is some motion detection missed, I could still have the chance to check it in the loop video.
With the motion log and still thumbs, I can also review the interested motion detected from the loop video.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Dec 28, 2017 3:47 pm

allen2000 wrote:
Thu Dec 28, 2017 5:53 am
Hello,
Thanks for the great work.
Here comes one question that whether it is possible to have a loop video recording with motion log as well as still thumbs saved.
In case there is some motion detection missed, I could still have the chance to check it in the loop video.
With the motion log and still thumbs, I can also review the interested motion detected from the loop video.
If motion is enabled during loop video recording, a loop video is tagged as having motion and you will see the word "Motion" on the web page thumb. A loop video that has no motion ends in "_0.mp4", if it has motion it ends in "_1.mp4". With the next release coming up soon a loop video with audio events only will end in "_a.mp4" and be labeled on the web page with "Audio".

Also, if motion is detected during a loop video (motion enabled) the preview_save, on_motion_begin and on_motion_end commands are run where you can do anything additional you want (email, log, etc).

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

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Dec 28, 2017 11:57 pm

I got the 2 channel audio fixed up and audio can now be used as a motion event to trigger a recording.

The PS3 Eye Cam is a good buy. It has better sensitivity than a -35 dB electret mic I was using and is better with noise than those cheap USB soundcards you find on Ebay and Amazon. I've been able to modulate noise with those soundcards just by changing the orientation of the USB extension cable I have them plugged in to. So I do recommend trying the Eye Cam, thanks John for pointing it out.

allen2000
Posts: 8
Joined: Thu Mar 03, 2016 3:00 am

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Dec 29, 2017 2:40 am

Hi billw,
Thanks for your quick response.
One more question, can I config it as motion monitor only instead of motion recorder? Which means once there is motion detected, only thumb saved without video recorded. Along with the preview_save, on_motion_begin and on_motion_end commands, it is fine to make customized actions afterwards.
BTW, for the "on_motion_end" event, is it triggered at the time to start generating mp4 video file or after mp4 video file was ready under videos folder?

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

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Dec 29, 2017 3:54 am

billw wrote:
Thu Dec 28, 2017 11:57 pm
I got the 2 channel audio fixed up and audio can now be used as a motion event to trigger a recording.
Thank you for doing this! I believe the PS3 Eye originally sold for quite a bit more; the current <$10 price may be a closeout (although it's been that way for at least a year now), anyway I recommend it. I stocked up with four of them; the audio quality for the price is a real value.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Dec 29, 2017 4:46 am

allen2000 wrote:
Fri Dec 29, 2017 2:40 am
Hi billw,
Thanks for your quick response.
One more question, can I config it as motion monitor only instead of motion recorder? Which means once there is motion detected, only thumb saved without video recorded. Along with the preview_save, on_motion_begin and on_motion_end commands, it is fine to make customized actions afterwards.
BTW, for the "on_motion_end" event, is it triggered at the time to start generating mp4 video file or after mp4 video file was ready under videos folder?
There's no option for a motion detect to just generate a thumb without a video so you would have to manage those things with processing commands.

At a video record end, the thumb generation and video are executed more or less in parallel (if motion_preview_save_mode is best) and I expect that the thumb would be created first, but it is not guaranteed.

For the thumb path, the thumb is created in the thumbs directory and then the on_preview_save command is run so that is where you would post process the thumb. There can be a complication if your motion_preview_save_mode is "first" instead of "best" because then the on_preview_save command is run before it is known of all of the motion detects that can occur. So there is a chance that the thumb will be renamed at motion end. So if your mode is "first" you probably should do everything in the on_motion_end command.

When a video ends, the on_motion_end command is run after the boxing to a mp4 is finished, so the video is in the videos directory.

allen2000
Posts: 8
Joined: Thu Mar 03, 2016 3:00 am

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Dec 29, 2017 6:06 am

Hi billw,

Thanks for the clarification and it is very helpful for customized actions.
Wishing you all the blessings of a beautiful New Year season!

allen2000
Posts: 8
Joined: Thu Mar 03, 2016 3:00 am

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Dec 29, 2017 6:16 am

jbeale wrote:
Fri Dec 29, 2017 3:54 am
Thank you for doing this! I believe the PS3 Eye originally sold for quite a bit more; the current <$10 price may be a closeout (although it's been that way for at least a year now), anyway I recommend it. I stocked up with four of them; the audio quality for the price is a real value.
Hi jbeale,
I just bought a PS3 Eye and it's on the way. I intend to use it with PiKrellCam on my pi0w with Raspbian Stretch Lite.
Is there any specially config needed or it is just a plug and play device?

DaveDJ
Posts: 11
Joined: Tue Jul 18, 2017 2:12 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Dec 30, 2017 1:18 pm

jbeale wrote:
Thu Dec 21, 2017 3:34 pm

There is only one stereo input option available for the RPi under $10 that I am aware of, the PS3-Eye Cam: https://www.amazon.com/Sony-PlayStation ... B0072I2240

Thanks John

I have taken your advice and ordered one, saves me a headache

Apparently it's a 4 mic array in the ps3 eye

I will be removing the case and stripping it down to the bare minimum and desoldering the power from the usb on the camera board and giving it it's own independent power

Have you any idea of power consumption as it's going to be on all the time

Cheers
Last edited by DaveDJ on Sun Dec 31, 2017 6:30 am, edited 2 times in total.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Dec 30, 2017 2:26 pm

Have you any idea of power consumption as it's going to be on all the time
Good question, I would expect somewhere around 200ma, most older gen image sensors are 100 -150ma just in themselves.
Should make myself an USB current measurement adapter.

lsusb -v|egrep "^Bus|MaxPower"
Ouch, return 500ma, but that could be because USB devices identify back to the host as 100ma or 500ma.
Actual current should be below 500ma

I am trying to figure out how to run a script on motion detect that will grab an image from the Eyecam using fswebcam.
The script runs fine but Pikrellcam does not seem to run it on motion detect.
Might have it wrong, maybe test a GPIO led on motion detect?
Have not used this feature before, lot of stuff in Pikrellcam I have not used :oops:

I want to try two Eyecams plus a Picamera on an old Pi2.
It would be nice to use all 4 USB ports with 4 eyecams but I think the power demand may be too high.
Another reason for using the old Pi2 as it has lower power than a Pi3.

Not sure if Pikrellcam will allow the taking of images from the Eyecam when it is is used as a microphone.
Some sort of extra software that has audio and eyecam images going to a buffer until motion is detected on the Picaimera?
Not sure how to write code like that but it is another reason for the 4 core Pi2, use a core for each camera.
How to make 2-4 cores deal with a single USB port to LAN9514 hub to Eyecams?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Dec 30, 2017 6:17 pm

DaveDJ wrote:
Sat Dec 30, 2017 1:18 pm
Have you any idea of power consumption as it's going to be on all the time
I used a split USB cable with the data lines going to a RPi but +5V coming from an external supply. My lab power supply says the PS3 Eye device draws 110 mA at +5V. I also recorded and played back some audio to check it was working OK. The current drawn is the same, whether or not you are actively recording audio.

In fact I have three PS3 Eye units handy. My Keithley 196 DMM says current is 111.2, 107.0 and 106.8 mA respectively, so that gives you an idea.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Dec 30, 2017 6:32 pm

allen2000 wrote:
Fri Dec 29, 2017 6:16 am
Is there any specially config needed or it is just a plug and play device?
Just plug it in, and it works.

For testing outside of PiKrellCam you can do this, it records 2-minute long MP3 files continually.

Code: Select all

ffmpeg -f alsa -ac 2 -ar 8000 -i plughw:1 -map 0:0 -acodec libmp3lame \
  -b:a 96k -f segment -strftime 1 -segment_time 120 -segment_atclocktime 1 \
   ChA_%Y-%m-%d_%H-%M-%S.mp3

User avatar
MEMEs
Posts: 87
Joined: Tue Jan 13, 2015 7:25 pm
Location: Rotterdam
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Dec 31, 2017 12:31 am

Hi there, I'm trying to get your app running on my raspberry pi zero W.
I 've created a new user and deleted pi for security purposes (maybe thats the source of the problem?)

I can't seem to get the camera going :(
Do you maybe have an idea where to go from here ?

Code: Select all

========================================================
======= PiKrellCam 4.1.3 started at 2017-12-31 00:17:30
========================================================
command FIFO: /home/spycam1/pikrellcam/www/FIFO
audio FIFO  : /home/spycam1/pikrellcam/www/audio_FIFO
mjpeg stream: /run/pikrellcam/mjpeg.jpg
00:17:30 :   execl[wait:1]: /home/spycam1/pikrellcam/scripts-dist/_init /home/spycam1/pikrellcam /home/spycam1/pikrellcam/media/archive /home/spycam1/pikrellcam/media /run/pikrellcam/mjpeg.jpg /home/spycam1/pikrellcam/www/FIFO /tmp/pikrellcam.log servos_off /home/spycam1/pikrellcam/media/loop
  www/media link is already set to /home/spycam1/pikrellcam/media
  www/archive link is already set to /home/spycam1/pikrellcam/media/archive
  www/loop link is already set to /home/spycam1/pikrellcam/media/loop
  /home/spycam1/pikrellcam/www/config.php: LOG_FILE not changed.
  /home/spycam1/pikrellcam/www/config.php: MJPEG_FILE not changed.
  /home/spycam1/pikrellcam/www/config.php: FIFO_FILE not changed.
  /home/spycam1/pikrellcam/www/config.php: PIKRELLCAM not changed.
  /home/spycam1/pikrellcam/www/config.php: SERVOS_ENABLE not changed.
  /home/spycam1/pikrellcam/www/config.php: VERSION not changed.
00:17:30 :   execl[wait:1]: /home/spycam1/pikrellcam/scripts/startup /home/spycam1/pikrellcam /home/spycam1/pikrellcam/media /tmp/pikrellcam.log
  MOUNT_DISK is not set.
00:17:30 :   execl[wait:1]: sudo chown spycam1.www-data /tmp/pikrellcam.log
00:17:30 :   execl[wait:1]: sudo chmod 664 /tmp/pikrellcam.log
00:17:30 :   execl[wait:1]: sudo mkdir -p /run/pikrellcam
make_dir(/run/pikrellcam) failed. No such file or directory
Failed to create media directories or FIFO, exiting!
Thanx in advance!

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Dec 31, 2017 2:02 am

In fact I have three PS3 Eye units handy. My Keithley 196 DMM says current is 111.2, 107.0 and 106.8 mA respectively, so that gives you an idea.
Thanks John, that's a bit better than I expected, will use 110ma as ref.
Two cameras <250ma, well within my power budget. 3 or 4 should work too?

Is there a way to record audio and video from the Eyecams at the same time?
They work great as mics for Pikrellcam, shame to waste the image sensors.
Still they are the cheapest secondhand USB microphones around $2 :lol:
Hi there, I'm trying to get your app running on my raspberry pi zero W.
MEMEs, did you enable camera in raspi-config?
And deleting Pi as user probably won't help, keep everything as normal and get things working first.
Then try changing password/user, one step at time so you know which step breaks it ;)
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

DaveDJ
Posts: 11
Joined: Tue Jul 18, 2017 2:12 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Dec 31, 2017 6:01 am

John

110mA is great news , For me the power is free, But it's going in the car and i was trying to calculate the drain on the battery overnight

Thanks

User avatar
MEMEs
Posts: 87
Joined: Tue Jan 13, 2015 7:25 pm
Location: Rotterdam
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Dec 31, 2017 12:28 pm

MEMEs, did you enable camera in raspi-config?
And deleting Pi as user probably won't help, keep everything as normal and get things working first.
Then try changing password/user, one step at time so you know which step breaks it ;)
Hi there, yes i did enable the camera!

I thought for security purposes it would be better to create a new user rather than pi. Then again the camera is behind a firewall.

I'll try to install Pikrellcam on the user pi and give it a nice 30 character long password and fail2ban that blocks all connections.

Thanx for the reply!

edit: any idea what groups are required for pikrellcam to run under the user pi? Then i could use pi as a user account and create an admin account with the complete list of groups (such as sudo).

Edit2: works like a charm with pi as a user account. Thanx! We Always know Small Steps are the best way to go but we Keep forget because we want to do things fast :)

Thanx!

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

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Jan 01, 2018 7:16 pm

I cannot use a usb harddrive for my pikrell cam becuase it is to cold outside. So i want to store the archives on another pi with a wd pidrive
I have been trying for a few days now to store my archives on another pi with pi drive. I did get it to work with owncloud, but it synches so i cannot clear the files in the ownclowd client on the pikrell because they also delete from the server. Any suggestions?

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

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Jan 03, 2018 7:32 am

Ok I give up. Spend a week trying to figure this out. I will try other cam software.

User avatar
underwhelmd
Posts: 93
Joined: Fri Jul 08, 2016 10:05 pm
Location: East Coast, Canada

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Jan 03, 2018 3:45 pm

Rasilon wrote:
Mon Jan 01, 2018 7:16 pm
I cannot use a usb harddrive for my pikrell cam becuase it is to cold outside. So i want to store the archives on another pi with a wd pidrive
I have been trying for a few days now to store my archives on another pi with pi drive. I did get it to work with owncloud, but it synches so i cannot clear the files in the ownclowd client on the pikrell because they also delete from the server. Any suggestions?

I think the intended procedure in that case was:
Pi with camera mounts NAS of your choice on boot. The share being the other pi with the storage. Then archive at will.
or I suppose you could mount the share at times you specify, copy over the archive and unmount.

Edit: Dougie is correct in the next post. Edits in bold.
Last edited by underwhelmd on Wed Jan 03, 2018 4:25 pm, edited 1 time in total.

User avatar
DougieLawson
Posts: 33858
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Jan 03, 2018 3:49 pm

NFS shares are cheaper, easier, more reliable and work with the Linux owner,. group, world permissions.

Using samba/CIFS on Linux is insane.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Jan 03, 2018 7:09 pm

I am trying that now. no idea how to work with vi files though. I cannot find an up to date tututial on installing a nfs that makes any sence.

Return to “Camera board”

Who is online

Users browsing this forum: No registered users and 7 guests