LucidEye
Posts: 78
Joined: Sun Aug 04, 2013 2:20 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jun 03, 2016 3:03 am

I just bought a new 4.5 amp power supply specifically for my Pi3 and I am using a cable I know to be good.
No under-voltage indicators being displayed.
I was using the built-in wifi on the Pi3, but I disabled it and I am now using one of my trusty AusPi antenna dongles... it has better signal and range... But I was pretty surprised how good the signal and range was from the Pi3's built-in wifi. Either one I used seemed to have the same issues... it is very possible I've just reached the limit of my poor old router... I'm trying a slightly newer router tonight to see what happens... I also really need to get my router to stop acting as a WiFi bridge... I know that is causing a lot of WiFi load... hoping to get a couple of gigabit powerline adapters this weekend so I can have a wired connection between the gateway router and my router.
jbeale wrote:
LucidEye wrote: I've also been experiencing crashes whenever the Pi tries to compile a timelapse video... even a short one... the progress meter shows up, and a minute or 2 later the web interface becomes unresponsive, and even the SSH connection gets dropped... have to physically unplug the pi to reboot it :-(
This should not happen, any chance there is a power supply issue? Using a 1.5 A or more power supply with good quality cord? I have experienced wifi slowdown and outage which was related to my power supply, so it is possible. Is this a Pi3 using built-in wifi? I have read that there are issues with the driver for the builtin Pi3 wifi

LucidEye
Posts: 78
Joined: Sun Aug 04, 2013 2:20 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jun 03, 2016 4:18 am

I installed per your instructions... started "gkrellmd" on the Pi, then tried "gkrellm -s my-IP" and only get "broken server connection" :-(
billw wrote:You can also graphically monitor with gkrellm the wlan0 traffic, cpu usage, etc of wifi connected
headless Pi boxes. ssh in and:

Code: Select all

sudo apt-get install gkrellmd
Then on your workstation (if the headless is say rpiH):

Code: Select all

sudo apt-get install gkrellm
gkrellm -s rpiH
   #or if rpiH is not in /etc/hosts, use its IP:
gkrellm -s IP-number
If you have multiple Pi machines, gkrellmd on each can be configured to use a different port and
all can be displayed at once on the workstation with multiple: gkrellm -s rpiX -P portnumber

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

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jun 03, 2016 4:44 am

I'm currently using Jessie Lite.
Went looking for a NAS OS to backup the videos I get from all the cameras.
Came across this
http://dietpi.com/

Anyone tried it with pikrellcam?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

tomtgrp
Posts: 41
Joined: Thu Jul 09, 2015 8:35 am

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jun 03, 2016 11:50 am

Hi,

Encoding of timelapse video fails with image size 3280x2464 (new Camera Module)

See below:

Code: Select all

Output #0, mp4, to '00163.mp4':
  Metadata:
    encoder         : Lavf56.1.0
    Stream #0.0: Video: libx264, yuvj420p, 3280x2464, q=-1--1, 6000 kb/s, 6 fps, 6 tbn, 6 tbc
    Metadata:
      encoder         : Lavc56.1.0 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press ctrl-c to stop encoding
x264 [error]: malloc of size 42541808 failedime=10000000000.00 bitrate=   0.0kbits/s
Video encoding failed
/home/pi/pikrellcam/scripts-dist/_timelapse-convert: Zeile 54:  2216 Getötet                nice -2 avconv -r 6 -i $FILENAME_FORMAT -b:v 6M -maxrate 6M -minrate 1M -bufsize 4M -r 6 -vcodec libx264 -crf 20 -g 4 $SERIES.mp4 >> $LOG_FILE

BR
Tom

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

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jun 03, 2016 12:57 pm

To answer my own question.

Dietpi + pikrellcam :(
Looks to be issues with user, permissions and nginx at the least.
Not working but only 650MB, about half Jessie Lite.

Dietpi seems to be more designed as an easy to setup server.
Got some nice features, uses ramfs for lots instead of SD card.
Can automatically setup onto USB drive.
If it was working it would be faster and more reliable than J lite?
Might have to learn to roll my own OS :ugeek: , but not tonight.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

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

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jun 03, 2016 2:09 pm

LucidEye wrote:I installed per your instructions... started "gkrellmd" on the Pi, then tried "gkrellm -s my-IP" and only get "broken server connection" :-(
Ah, sorry, I forgot that the default connections to accept is limited. You can edit /etc/gkrellmd.conf
on the Pi to set these configs or create a /usr/local/etc/gkrellmd.conf or a ~/.gkrellmd.conf with some
or all of these lines it to allow the connections you want:

Code: Select all

# Allow connections from your local network (edit numbers to suit):
allow-host 192.168.0.*

# Allow hosts from anywhere:
allow-host ALL
After editing the gkrellmd.conf file, restart gkrellmd:

Code: Select all

sudo service gkrellmd restart
After the apt-get install of gkrellmd on the Pi, you don't need to manually start it. It is a daemon
service and is supposed to be automatically started.

The gkrellmd.conf is where you would set an alternate port number if you want it. For more info,
do a: man gkrelllmd

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Jun 04, 2016 2:57 am

FWIW, running "speedometer -tx eth0" on the remote headless pi, looks like streaming the JPEG preview takes about 200 kB/sec with a preview image size of 800x592. The size of /var/run/pikrellcam/mjpeg.jpg is 30 kB so I guess I'm seeing about 6 fps.

I did not have an error doing the full resolution timelapse with PiCamera v2.1. VLC says the mp4 file has Resolution: 3280x2466, Display resolution: 3280x2464. This was a very short test with only 10 frames. You have a long one you may need to make sure enough memory is available. I tried a longer timelapse, it worked OK but I notice that 'top' says the 'avconv' process is taking 85% of memory.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Jun 04, 2016 3:09 am

jbeale, 85% memory on a B+, 2B or 3B?
512MB or 1GB.
V2's will probably end up on my Pi2's.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Jun 04, 2016 4:35 am

@Gavinmc42 : good point. I was using a Raspberry Pi 2 Model B with 1 GB ram. So if you had any Pi model with less memory, it might run out of memory trying to create a large mp4 file with avconv.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Jun 04, 2016 5:01 am

1GB is twice 512MB but it is not quite the same.
A big OS might take 100MB+ plus GPU 128MB.
Leaving 250MB on a B free but more than 750MB free on the 2-3's.
Video converters are real CPU/memory hogs.
Is there any converter that can use 4 cores?

Looking at the block diagram, Billw's code looks like it is using the GPU jpeg encoder then going back to the ARM for mjpeg? Can the speed be increased by throwing more cores at it?
One of the reasons I got 2-3's was to learn multi-core programming specifically for camera use, still on my todo list.

Been on the camera forums as a crash course in updating my skills in this area.
Billw's skills are at least an order of magnitude better than mine, last time I did this VGA was high res.
About half on here I have no clue what you guys are talking about:)
Really need to print this whole post off and sit down and read it.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Jun 04, 2016 5:15 am

Of course the GPU handles the conversion of raw camera data to h.264 encoding when you record in video mode. It is only timelapse sequences of still JPEG images that requires much CPU. In this case it is avconv and since 'top' reports it using about 380% cpu when converting a timelapse, I gather it is almost fully using all four processors.

I believe the default is avconv -threads auto which auto-detects the right number of threads for the processor configuration.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Jun 04, 2016 5:18 am

Should read the instructions before offering opinions :oops:
With the default setup on a Pi 2, avconv converts 100 timelapse jpegs into about a 17 second 12 MByte video in about 4 minutes. Toggle show timelapse on the OSD to monitor the converted MP4 size progress. A B+ with one core can be 12 times slower.
Er, one core checking for motion and the other three compressing the timelapse to video.
https://libav.org/documentation/avconv.html#Synopsis
Ok maybe get 5% of that, Billw is a few orders of magnitude above me:)
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Jun 04, 2016 5:39 am

Number crunching.
Have not done timelapse, it's on the list :lol:
Timelapse an image every sec= 86400/day
Every 10secs=8640/day, every minute 1440/day

Pi2 would take 1 hour to avconv 1440 images, B+ = half a day to do it?
Pi2 a bit under 3 days to compress 86400 images.
Starting see why a speedometer might come in handy to figure out what are the slow bits.
What is the slowest timelapse in Raspivid?
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

Sun Jun 05, 2016 9:20 pm

HI guys,

The preview window size seems affecting OSD Detection Square sizes. I have a few Pi B+ and I use same firefox browser; however, some window size on the browser is bigger than others. They all have same video settings, etc.

Anybody has run into situation before? Chrome browser seems having same effect...

thanks in advance.
peng

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

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Jun 06, 2016 4:17 am

peng,

Yep same situation, 4 systems with V1 cameras, same settings, browser preview windows vary in size.
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

Thu Jun 16, 2016 10:34 am

HI, Is this forum dead????....... It seems no update any more........

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Jun 18, 2016 6:19 am

No more Questions?
Because the software works ;)

Me, I'm busy my first Pi Zero's and Ultibo.

Speaking of which, has anyone got Pikrellcam running on a Zero?

Not sure how to go about it.
1) WiFi,
2) Uart and PPP
3) Ethernet over USB
4) ENC28J60
5) RS485
6) ???

Want to have a Pi2 or 3 facing front with camera and two Zero's pointing out the side to get 180 degree coverage.
Hardware wise, two USB cables to the Zero's is easiest.
Zero's are not fussy about power, so 5m USB cables maybe possible?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jun 19, 2016 3:23 am

I have used a Pi Zero (the old model, without camera connector) with keyboard, mouse and USB-ethernet module all on an unpowered USB hub and it worked OK. Probably marginal to do that, but it worked. Have not tried PiKrellCam on that one, of course. This is the super-cheap (and previously nearly unusable) 10baseT USB-Ethernet module you can get for under $5 on ebay. It looks like this one:
http://www.ebay.com/itm/USB-2-0-to-Ethe ... 2067398439

While limited to 10 Mbps it doesn't use much current; I measured 50 mA total. In the past it would frequently lock up in use on RPi, but I pulled it out again this month and either I got lucky or the driver for it was updated.

Code: Select all

lsusb:
0fe6:9700 Kontron DM9601 Fast Ethernet Adapter

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jun 19, 2016 4:00 am

jbeale,
I have a ENC28J60 board from Olimex I got years ago.
Driver for it is now in device tree I think. Been also thinking about getting some 28 pin dip versions and bread boarding up some10MBs Ethernet I/Os, but...

Got a Zero with camera plugged into a B with camera, right now.
Both have camera leds on, pikrellcam is working on the B and I assume it is working on the Zero.
Just need to figure out how to access it.
USB at 480MBs makes the most sense, just a USB A to Micro cable.
Looking at the /dev directory I can see "zero".
Most how to OTG gadget Zero web pages are out of date as the drivers are now in the latest release.

Just need to figure out the final configuration setups, but brain is mush from the flu.
I think I might be one config line away from getting it going.

Billw could add the option to pikrellcam and we could have make 5 camera systems on a B+, 2 or 3 with 4 Zero's.
Go the Enc28j60 way I will need a switch, doing USB to Zero the B acts as hub.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jun 19, 2016 4:47 am

Best clues so far.
http://alexfabre.com/include/project/RaspGadget.html
If I had a Mac it might be working.
Trying on a Linux box, Zero should work as gadget there too.
Tries to login, getting very close.

Doing this I get to log on to one of the other pikrellcams instead.
ssh [email protected]
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Jun 25, 2016 3:55 pm

Hi Billw,
Just received my servos (from ebay Pan / tilt camera with two SG90 Servos) and using them with PiKrellCam and a raspberry Pi B. What you have done is amazing.
Thanks a lot
Yves

forme320
Posts: 2
Joined: Sun Jun 26, 2016 5:53 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jun 26, 2016 6:00 pm

Very nice piece of software that does exactly as advertised.

I was wondering if there was a way to have it consistently record from the video feed (save in chunks anywhere from 1hr - 24hr?) and still have the motion detection capability so have x happen when motion is detected. Such as send an email or even start recording another feed as long as motion is detected (not sure if it would be possible to have to files saved from 1 video feed).

Thank you in advance for any help, tips, suggestions.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Jun 27, 2016 2:49 am

forme320 wrote: I was wondering if there was a way to have it consistently record from the video feed (save in chunks anywhere from 1hr - 24hr?) and still have the motion detection capability so have x happen when motion is detected. Such as send an email or even start recording another feed as long as motion is detected (not sure if it would be possible to have to files saved from 1 video feed).
Circular buffer video data could be written to more than one file at once based on different conditions. But there would also need to be quite a few changes in the program to coordinate a motion detected video at the same time as recording a manual video, so I would be hesitant to attempt that. However, motion detection checks don't stop when a manual record is in progress, so a command could be added to execute a script if motion is detected during a manual record. I just don't have a good idea offhand how it should work. There can be a large number of detect events during a video and a command executed on each event could send you a lot of email you don't want. And if the command should only execute once at first detect during a manual record, then if the record is long, you could miss events you want.

To get your record chunks, you would have to set up cron or at-commands to send record commands to the FIFO.

forme320
Posts: 2
Joined: Sun Jun 26, 2016 5:53 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Jun 27, 2016 6:22 pm

billw wrote: However, motion detection checks don't stop when a manual record is in progress, so a command could be added to execute a script if motion is detected during a manual record. I just don't have a good idea offhand how it should work. There can be a large number of detect events during a video and a command executed on each event could send you a lot of email you don't want. And if the command should only execute once at first detect during a manual record, then if the record is long, you could miss events you want.
Would it be possible to have a manual recording that is streamed to the web and then have the motion detection running in the background that can run a script if something is detected.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Jun 27, 2016 7:56 pm

HI YvesG

I was wondering whether you can post a video you got from your Servos and exact model/link of Servos.

I'd like to invest on this as well. :-)

thanks

Return to “Camera board”