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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Mar 27, 2016 12:58 am

BerryPicker wrote:What is the best way to assign multiple tasks to take place for a single point in time or a single motion event. The several individual custom tasks will be bash scripts put in the scripts folder. The tasks will be called from within at-commands.conf for time events, and from within pikrellcam .conf for motion events.

Can the time or event be repeated for each task?
e.g.
daily sunset "do-this"
daily sunset "do-that"
Yes, the commands are put in a list and you can have multiple same time events.
e.g.
on_motion_begin $C/do-this
on_motion_begin $C/do-that
The commands in pikrellcam.conf are not in a list so, no. Your do-this script just has to do it all.
Or can several tasks be listed against a single time, or motion event
e.g.
daily sunset "do-this" "do-that"
e.g.
on_motion_begin $C/do-this $C/do-that
I was thinking there would be only one command per on_command, but this might work:

Code: Select all

on_motion_begin /bin/sh -c "script1; script2"

BerryPicker
Posts: 177
Joined: Tue Oct 16, 2012 3:03 pm
Location: The East of England

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Mar 27, 2016 9:52 am

Thank you again billw for your comprehensive help. For me pikrellcam is doing a great job in daylight hours. I'm hoping to extend the operating hours with IR lighting, to supplement movement detection with PIR, and to have pikrellcam trigger a real time audio annunciator.

My only trouble has been ladybugs walking across window glass in the field of view. They seem to come to this spot because it's nicely sheltered from the rain and free of cobwebs.

As for the limitations of a single thumbnail per recording pointed out by jbeale, my thoughts go to the operation of PVRs and the setting of bookmarks within a recorded video. On playback it is possible with the PVR to jump from one bookmark to the next (forwards or backwards), and to change the thumbnail picture whilst playback is paused. Perhaps pikrellcam could be enhanced to store bookmarks for points where it was detecting additional movements during a recording. Maybe an idea for a new feature if there is sufficient interest.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Mar 29, 2016 7:49 pm

BerryPicker wrote: I'm hoping to extend the operating hours with IR lighting
One of my PiKrellCam cameras runs at night, using an IR-type Pi-compatible from ebay plus two of these:
http://www.amazon.com/Univivi-U06R-Wide ... B00M3O5ERK which put out a lot of (IR) light. It works well and I've seen some raccoons, opossums, and a lot of cats in addition to the foot and car traffic going past my driveway.

If you've got good lighting I haven't found PIR sensors to work any better or more reliably than PiKrellCam, quite the contrary; but maybe you have better sensors than what I've found.

boomlikethat
Posts: 85
Joined: Sun Aug 03, 2014 10:32 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Mar 30, 2016 3:17 pm

@jbeale,

That IR light looks pretty good, so I ordered one (for now). Can you tell me how it's set up, and it's proximity to the Cam? I want to keep the camera's location secret. Mine are in windows indoors, and I would want to install the lighting outside.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Mar 30, 2016 3:53 pm

My camera is placed in between two lights, one mounted on each corner of my garage. Like most IR lights, it is very directional (even though it claims to be wide angle) but this is actually what you want in most cases. You just point the hot spot of the beam at the most distant area you want to cover, then the dimmer light coming out to the sides illuminates the closer areas, so you end up with more even illumination overall given that distant things would otherwise be much dimmer.

A single light can work OK, but inevitably you will have "harsh" lighting because the light comes from only one direction, and if the subject gets too close to the light it becomes overexposed to full white and you see no detail. With two lights some distance apart and pointing slightly towards each other, you can fill in the shadows better, so the scene has less contrast and you get a larger area where things are all properly exposed and not too dark or blown out.

By the way these lights are quite visible at night if you are in the center of the beam and you look directly at them; you see six little red dots from the emitters. If you are outside the central beam they are much harder to see. If it is near a normal visible-white outdoor light fixture, it probably wouldn't be noticed, even if the white light is low power and isn't bright enough for the camera exposure by itself.

BTW I actually went a step farther than this; I modified the lights with my own drive circuit to be strobe lights that run at the frame rate of the camera, so even fast-moving objects appear as crisp still frames instead of motion-blurred. It is not perfect because I don't have a way to synchronize the strobe to the start-of-frame, so some images show moving objects split in half by one frame exposure time. However I get far more detail on fast motion than with a normal 360 degree shutter that you typically use at night. You can also leave the lights as-is and just set the camera shutter shorter to freeze motion, but that of course needs more light. Doing a short 2 msec pulse at 23 Hz on the IR LEDs allows me to run 4x more current than I could at DC. This mod took some time, and is probably not appropriate for the typical user.

boomlikethat
Posts: 85
Joined: Sun Aug 03, 2014 10:32 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Mar 30, 2016 11:03 pm

@jbeale:

That is really cool. You have really taken off with all the extra stuff you do with PiKrellCam.

I do some tinkering, with my ham radio experience and all, so a little electronics don't intimidate much. But I've always wanted to do it, from when I was younger. Knowing then what I know now, I would have kept with it.
jbeale wrote:My camera is placed in between two lights, one mounted on each corner of my garage. Like most IR lights, it is very directional (even though it claims to be wide angle) but this is actually what you want in most cases. You just point the hot spot of the beam at the most distant area you want to cover, then the dimmer light coming out to the sides illuminates the closer areas, so you end up with more even illumination overall given that distant things would otherwise be much dimmer.

A single light can work OK, but inevitably you will have "harsh" lighting because the light comes from only one direction, and if the subject gets too close to the light it becomes overexposed to full white and you see no detail. With two lights some distance apart and pointing slightly towards each other, you can fill in the shadows better, so the scene has less contrast and you get a larger area where things are all properly exposed and not too dark or blown out.

By the way these lights are quite visible at night if you are in the center of the beam and you look directly at them; you see six little red dots from the emitters. If you are outside the central beam they are much harder to see. If it is near a normal visible-white outdoor light fixture, it probably wouldn't be noticed, even if the white light is low power and isn't bright enough for the camera exposure by itself.

BTW I actually went a step farther than this; I modified the lights with my own drive circuit to be strobe lights that run at the frame rate of the camera, so even fast-moving objects appear as crisp still frames instead of motion-blurred. It is not perfect because I don't have a way to synchronize the strobe to the start-of-frame, so some images show moving objects split in half by one frame exposure time. However I get far more detail on fast motion than with a normal 360 degree shutter that you typically use at night. You can also leave the lights as-is and just set the camera shutter shorter to freeze motion, but that of course needs more light. Doing a short 2 msec pulse at 23 Hz on the IR LEDs allows me to run 4x more current than I could at DC. This mod took some time, and is probably not appropriate for the typical user.

djako
Posts: 6
Joined: Sat Feb 13, 2016 12:25 am

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Mar 31, 2016 9:55 pm

I have three pi's running PiKrellCam and love it! I recently moved over from the RPi Cam Web Interface as I feel it didn't do a good enough job with the motion detection. The PiKrellCam motion detection is outstanding, so I wanted to say thank you for this amazing project.

As a web developer, I've noticed these two projects both have pretty meh web interfaces lol. I'm working on reskinning the interface and was hoping for some feedback. Here's what I've done so far, keep in mind, this is only the index page, I haven't gone into the archive page yet.

Also - I was wondering if there is a way to know the status of the motion detection, timelapse, regions, and vectors when the page is loaded. I wanted to have a little indication light next to these to indicate if they are turned on or not.

http://jako.in/pi.jpg
Image

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

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Mar 31, 2016 11:33 pm

> I'm working on reskinning the interface

I'm not the developer, but that screenshot looks good to me! By the way, I find the existing main and thumbnail pages work OK if you have a large enough screen (eg. desktop PC), but on my laptop or tablet it needs a lot of scrolling up and down to get to the controls since the top image takes up most of the screen. Having the controls on the side like that seems to me clearly better than the existing setup for small screens, and widescreen laptops like mine.

djako
Posts: 6
Joined: Sat Feb 13, 2016 12:25 am

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Apr 01, 2016 12:06 am

jbeale wrote:> I'm working on reskinning the interface

I'm not the developer, but that screenshot looks good to me! By the way, I find the existing main and thumbnail pages work OK if you have a large enough screen (eg. desktop PC), but on my laptop or tablet it needs a lot of scrolling up and down to get to the controls since the top image takes up most of the screen. Having the controls on the side like that seems to me clearly better than the existing setup for small screens, and widescreen laptops like mine.
Thanks! I view the interface a lot on my iPhone, so making the website responsive across multiple screen sizes was one of the issues I wanted to fix. The archive page is a mess right now on my phone. So that's the next item on my list.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Apr 01, 2016 1:10 am

djako wrote:I have three pi's running PiKrellCam and love it! I recently moved over from the RPi Cam Web Interface as I feel it didn't do a good enough job with the motion detection. The PiKrellCam motion detection is outstanding, so I wanted to say thank you for this amazing project.

As a web developer, I've noticed these two projects both have pretty meh web interfaces lol. I'm working on reskinning the interface and was hoping for some feedback. Here's what I've done so far, keep in mind, this is only the index page, I haven't gone into the archive page yet.

Also - I was wondering if there is a way to know the status of the motion detection, timelapse, regions, and vectors when the page is loaded. I wanted to have a little indication light next to these to indicate if they are turned on or not.

http://jako.in/pi.jpg
Image
What you are doing looks nice, but you should know there's some changes coming with presets
and builtin servo control and the upcoming index page is going to have more buttons.

There's a /run/pikrellcam/state file which shows status. In addition to what's in it now, the next
release will add vector/burst, preset, and pan/tilt settings but nothing about the regions yet.
There won't be separate Videos & Thumbs buttons. Only a Videos button which will do what the
Thumbs was doing.

This shows the buttons and the drawn servo pan indicator (servo is on the leftmost preset and there
are three other presets to the right). The "1-2" says the first of two motion detect/region settings for
this pan position preset is selected.
index1.jpg
index1.jpg (14.97 KiB) Viewed 6096 times
Edit: If servos are not configured, the only additional buttons will be the Preset up/down buttons.
When this is released, you can configure as if you had servos even if you don't if you will want to
see the servo interface in action (without the camera actually moving).
The "Servo:" is a button that cycles the servo buttons (the servo direction button images are
replaced) through three configurations which will step by 1, step by 10, continuous steps.

djako
Posts: 6
Joined: Sat Feb 13, 2016 12:25 am

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Apr 01, 2016 3:28 am

billw wrote: What you are doing looks nice, but you should know there's some changes coming with presets
and builtin servo control and the upcoming index page is going to have more buttons.

There's a /run/pikrellcam/state file which shows status. In addition to what's in it now, the next
release will add vector/burst, preset, and pan/tilt settings but nothing about the regions yet.
There won't be separate Videos & Thumbs buttons. Only a Videos button which will do what the
Thumbs was doing.

This shows the buttons and the drawn servo pan indicator (servo is on the leftmost preset and there
are three other presets to the right). The "1-2" says the first of two motion detect/region settings for
this pan position preset is selected.
index1.jpg
Edit: If servos are not configured, the only additional buttons will be the Preset up/down buttons.
When this is released, you can configure as if you had servos even if you don't if you will want to
see the servo interface in action (without the camera actually moving).
The "Servo:" is a button that cycles the servo buttons (the servo direction button images are
replaced) through three configurations which will step by 1, step by 10, continuous steps.
Thanks for the info. When do you expect the new version to be released? I just created my own index.php and renamed the current one so I could still access it. I didn't need all of the controls and options during my everyday usage, which is why I stripped those out on my page. And if I ever needed to change something or move the motion regions I just access index_bak.php, which is your original unmodified page.

I'd love to work with you closer on integrating a better design, as it appears you could use some help on that front. Please don't take that the wrong way lol, I love what you've done so far.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Apr 01, 2016 12:33 pm

djako wrote: Thanks for the info. When do you expect the new version to be released? I just created my own index.php and renamed the current one so I could still access it. I didn't need all of the controls and options during my everyday usage, which is why I stripped those out on my page. And if I ever needed to change something or move the motion regions I just access index_bak.php, which is your original unmodified page.

I'd love to work with you closer on integrating a better design, as it appears you could use some help on that front. Please don't take that the wrong way lol, I love what you've done so far.
I still have to update the help page with the new preset/servo stuff and test/clean up so it could be
anywhere from a few days to a couple of weeks ... at least I hope so...

When I started on pikrellcam I had a good idea of what I wanted to get out of it as far as the
C code motion detection and OSD display features, but when it came to the web interface I did think
it sure would be nice to have some help here! When I get the next release out I expect I won't have
any other major revisions in mind for what I want the web pages to do, so if you can come up with
improvements, I say that's great and thanks for wanting to help!

BerryPicker
Posts: 177
Joined: Tue Oct 16, 2012 3:03 pm
Location: The East of England

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Apr 02, 2016 2:25 pm

billw wrote:There won't be separate Videos & Thumbs buttons. Only a Videos button which will do what the Thumbs was doing.
I'm viewing the pikrellcam web page using a nook hd+ tablet using the android chrome browser. In portrait orientation (1080x1920) the pikrellcam layout fits just perfectly, and presents no difficulty scrolling up and down. I have found the list view presented from the videos button to be useful. For me a list of a day's recordings fits comfortably within the window and avoids any need to scroll.

xzanfr
Posts: 18
Joined: Wed Jun 20, 2012 12:52 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Apr 02, 2016 5:42 pm

Hi Billw.
Not really about the workings of pikrellcam but I thought you might be interested / amused by the following:

I've got 2 installs of pikrellcam, 1 of which looks out from a window at my car in a communal car park.
This afternoon I came home from shopping and noticed some people acting suspiciously in the car park so called the police. When they arrived they asked for descriptions which were pretty vague from me -my memory is not what it used to be - I then remembered the window camera so checked the footage and discovered the people committing a crime directly within the trigger zone, all in glorious HD!
The attending officers watched the footage & radioed the descriptions to their colleagues, who in turn made an arrest all in the space of about 1/2 hour. I put the footage on to an old SD card which the officers took away as evidence.

As they were leaving I got talking with the officer and described the pi and your software - they were well impressed describing is way above what they would normally have to deal with and couldn't believe how little cost and effort is required to get such a good quality cctv system.
You've got a big thumbs up from thames valley police (and me!) - cheers for all your work :D

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Apr 03, 2016 12:27 am

BerryPicker wrote:I have found the list view presented from the videos button to be useful. For me a list of a day's recordings fits comfortably within the window and avoids any need to scroll.
It's having the two buttons on the index page I don't like. I think once on the videos page there can
be a button to select a mode for thumbs or list view.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Apr 03, 2016 12:44 am

xzanfr wrote:Hi Billw.
Not really about the workings of pikrellcam but I thought you might be interested / amused by the following:

I've got 2 installs of pikrellcam, 1 of which looks out from a window at my car in a communal car park.
This afternoon I came home from shopping and noticed some people acting suspiciously in the car park so called the police. When they arrived they asked for descriptions which were pretty vague from me -my memory is not what it used to be - I then remembered the window camera so checked the footage and discovered the people committing a crime directly within the trigger zone, all in glorious HD!
The attending officers watched the footage & radioed the descriptions to their colleagues, who in turn made an arrest all in the space of about 1/2 hour. I put the footage on to an old SD card which the officers took away as evidence.

As they were leaving I got talking with the officer and described the pi and your software - they were well impressed describing is way above what they would normally have to deal with and couldn't believe how little cost and effort is required to get such a good quality cctv system.
You've got a big thumbs up from thames valley police (and me!) - cheers for all your work :D
Interesting story! It's just too bad a lot of us are putting up cameras because we are concerned
about security. I have to leave home periodically for a week or two and that has motivated me a lot
to keep working on pikrellcam. So far I've had no problems other than unwanted solicitors and I do
have many nice nature videos in the meantime.

I think you did the Trailcam? A while back I meant to add a link to that on the PiKrellCam webpage
and I should do that soon before I forget again.

punacmc
Posts: 31
Joined: Tue Nov 19, 2013 4:07 am

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Apr 04, 2016 1:52 am

How would one use the at-commands to initiate night exposure? I was thinking it would look like

daily sunset "@????"

I don't see any actual FIFO commands that deal with the exposure or other camera settings? Am I just missing the command?

stephencassidy
Posts: 37
Joined: Mon Aug 19, 2013 11:12 am

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Apr 04, 2016 6:07 am

The command I use is

daily sunset "@exposure_mode night"

Ste

xzanfr
Posts: 18
Joined: Wed Jun 20, 2012 12:52 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Apr 04, 2016 5:23 pm

billw wrote:Interesting story! It's just too bad a lot of us are putting up cameras because we are concerned
about security. I have to leave home periodically for a week or two and that has motivated me a lot
to keep working on pikrellcam. So far I've had no problems other than unwanted solicitors and I do
have many nice nature videos in the meantime.

I think you did the Trailcam? A while back I meant to add a link to that on the PiKrellCam webpage
and I should do that soon before I forget again.
To be honest, the front camera's main focus is a bridfeeder so it generally catches squirrels & magpies rather than criminals!

I'm hoping to update the trailcam soon so will adjust the relevant sections of the website to reflect the changes once I've had it outside to test a few ideas - I'd like to experiment with some of the comments made in this thread to integrate it a bit further with pikrellcam - e.g. using the dusk / dawn timing to operate the IR filter and trigger a recording from the IR sensor.

Tim Barker
Posts: 40
Joined: Sun Oct 05, 2014 5:02 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Apr 11, 2016 6:50 am

Wow, I've been bashing my head against a brick wall trying to get 'motion' working on 2 Pis running 4.1.13+ which I thought were running identical packages excluding one running an x-term and the other plain and simple text interface. One worked, the other didn't. I just couldn't either get the second working or find the required help on the web that might point me to why the 2 supposedly identical Pis were refusing to 'work together'. In the process I came across links to 'PiKrellCam' and thought I would try it and boy am I glad I did. Not only does it seem to work on the machine I was having problems with but it seems to run at higher speeds with less lag and a better interface. Well done - the marvels of open sourced software. Thanks to all involved in the development including those suggesting changes.

Now to get into the details of the setup...

Tim Barker
Posts: 40
Joined: Sun Oct 05, 2014 5:02 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Apr 11, 2016 11:28 pm

just over 12 hours later and it still seems to be working well, much better results than motion 'straight out of the box'. A couple of comments though. Having spent a fair amount of time installing software to the various Pi's around 2 houses the installation procedure 'is different'. Coupled with this the location of programmes and data directories is also unusual. Getting used to the software is going to take a bit of relearning or adaption and the odd note or two left in certain directories for later. I tend to agree with djako that the interface is a little 'clunky' and that skinning it might be the way to go but it works and does everything, and I suspect more, that is required, well done Billw.

My only constructive comments would be for an installation procedure that is more normal for a Pi (ie using a straight apt-get install command) and a directory structure that is similar to most Pi installations ie, with programmes in one of the more usual areas and config and control files hanging off /etc. Data could then be specified from the config file (as it is) with initial data structures off the users home directory rather than several layers below, perhaps even using an already installed web interface under /var/www. This is not to say that the installation is difficult as it isn't but it is unusual from what I have seen. It is also unusual to use /etc/rc.local to instruct the daemon to run, whilst not apparently a 'true' daemon it seems to run in much the same way. Perhaps it could be modified to run as a straight daemon with the normal control script in /etc/init.d and run from the usual 'service' or 'systemctrl' commands. If these are comments expressed before by others and already answered, I apologise but time hasn't allowed me to read all of the 23 pages of this thread.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Apr 12, 2016 1:58 am

Tim Barker wrote:just over 12 hours later and it still seems to be working well, much better results than motion 'straight out of the box'. A couple of comments though. Having spent a fair amount of time installing software to the various Pi's around 2 houses the installation procedure 'is different'. Coupled with this the location of programmes and data directories is also unusual. Getting used to the software is going to take a bit of relearning or adaption and the odd note or two left in certain directories for later. I tend to agree with djako that the interface is a little 'clunky' and that skinning it might be the way to go but it works and does everything, and I suspect more, that is required, well done Billw.

My only constructive comments would be for an installation procedure that is more normal for a Pi (ie using a straight apt-get install command) and a directory structure that is similar to most Pi installations ie, with programmes in one of the more usual areas and config and control files hanging off /etc. Data could then be specified from the config file (as it is) with initial data structures off the users home directory rather than several layers below, perhaps even using an already installed web interface under /var/www. This is not to say that the installation is difficult as it isn't but it is unusual from what I have seen. It is also unusual to use /etc/rc.local to instruct the daemon to run, whilst not apparently a 'true' daemon it seems to run in much the same way. Perhaps it could be modified to run as a straight daemon with the normal control script in /etc/init.d and run from the usual 'service' or 'systemctrl' commands. If these are comments expressed before by others and already answered, I apologise but time hasn't allowed me to read all of the 23 pages of this thread.
Thanks for your input, I don't think these specific things have been
discussed previously in the thread.

I don't consider pikrellcam a daemon. The start/stop can be from the
web interface or a terminal and it runs as user pi so all the media files
can be owned by user pi. For that reason it doesn't reparent to init like
a true daemon would. And through the web interface it has a gui which
makes it rather undaemon like... So really, the start from rc.local is
just a convenience to get it running at startup whether you are headless
or run a gui. If you run a gui you could just as well have it a session
startup. Note the rc.local start is a start as user pi and not root.

Maybe pikrellcam can run forever after startup just like a daemon does,
and maybe it does provide a service for controlling camera hardware, but
structuring it like a true daemon and running not as the user pi while
managing user data files would cause the install and runtime to be much
more complicated and I have to tell you that I am grateful almost every
day that I did not do that!

Basically, since pikrellcam is a user program (back to the not a daemon
discussion) the config files should be under /home/pi and not under /etc
which would be for system wide configurations. Again maybe a gray area
since there's only one user and one camera, but I think the configs are
in the right place except maybe a case could be made for the configs to
be under ~/.config/pikrellcam instead of ~/.pikrellcam.

As for having a package apt install of pikrellcam, in principle I
absolutely agree with you. However, so far I have spent a great deal of
time developing the program and have not had the time to consider setting
up for packaging it.
So honestly, its current form is a convenience for me. But for the user,
I have put in (after a forum suggestion) a one button click upgrade path to
the latest version. Once you get past the initial install, upgrades are
actually quicker than with a package. What I haven't done yet is put in
an uninstall and I should do that. Maybe there will be a package someday.

Tim Barker
Posts: 40
Joined: Sun Oct 05, 2014 5:02 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Apr 13, 2016 7:54 am

Billw,

Thanks for that prompt reply. I fully understand your comments and a little intrigued by the comments concerning 'grateful almost everyday...' but then I am not a programmer just a dabbler. The install procedure and directory structure is just a little different to what I am used to. I'm also used to restarting a service after changing a config file rather than having to do it from within the webpage (which I think is the right way to do it).

Now I need to get into the jargon of the motion detection to set up the two cameras I'm now using to react to slow moving but largish fields for what I am after. I'd have to say that the results to date are very good, just need to know what to tweak and where - some heavy reading of the help files coming up.

One other aspect that I am also intrigued about that I think I have seen some reference to is the saving of files locally then transfer to a network device. I'm running one old A+ machine (which seems to run quite hot) which has limited local memory and the machine will be left for long periods during which it is impossible to say just what will be recorded. Perhaps the way to go is to allow the programme to create the MP4s locally then once created (or once a day?) move them to a networked directory on a server (another Pi but with 2Gb of disc). I also want to experiment with different screen ratios/sizes sometime...

oh, and thank you for sharing such a marvellous piece of software which has clearly taken so much time to develop.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Apr 13, 2016 4:24 pm

My strategy is to put in a 32 GB USB memory stick ( mounted as /dev/sda1 ) and save the stills and video there, and use the archiving script which runs just after midnight each day so only one day of events is visible on the "thumbs" page: viewtopic.php?t=115583&p=907956#p905001

You can also use a "motion-end" script to, for example transfer a still image and/or video to a remote site.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Apr 13, 2016 5:03 pm

Timelapse fails if there are missing files in the sequence or files with size 0


Hi,
since I often had short timelapse videos I analyzed the problem:
avconv doesn't like files with 0 size or missing files in a sequence.

I modified the old timelapse-end script to
1. delete timelapse files with size 0
2. renumber all files to get a continious sequence.

@billw
Perhaps you will find it useful and put the code into _timelapse-convert


here the changes in timelapse-end:

Code: Select all


<snip>
........

cd $TIMELAPSE_DIR

DATE=`date +"%F %T"`
echo "  $DATE timelapse-end TIMELAPSE_DIR=$1 VIDEOFILE_MP4=$2 SERIES=$3 FILENAME_FORMAT=$6" >> $LOG_FILE


#cleanup broken image files
DATE=`date +"%F %T"`
echo "  $DATE cleanup broken image files" >> $LOG_FILE
find . -maxdepth 1 -type f -size 0 -exec rm -v {} \;  >> $LOG_FILE
DATE=`date +"%F %T"`
echo "  $DATE rename files to ascending order without gaps" >> $LOG_FILE
export SERIES
ls -1rt -c | xargs rename 's/tl_$ENV{'SERIES'}_.*\.jpg$/our $i; if(!$i) { $i=0; } sprintf("%s_%05d.jpg", $ENV{'SERIES'}, $i++)/e'


DATE=`date +"%F %T"`
echo "  $DATE Timelapse-end: converting $FILENAME_FORMAT to $VIDEOFILE_MP4" >> $LOG_FILE

echo "tl_inform_convert $SERIES.mp4" > $COMMAND_FIFO

</snip>

......


And here is a part or better a test which creates the timelapse file with the hardware encoder.
It uses only a fraction of the software conversion time, but due to the limitations
of the hardware the resulting video size must be <=FullHD.

Code: Select all

#echo "tl_inform_convert $SERIES.mp4" > $COMMAND_FIFO

#Test: resize and hardware-encoding, size must be a multiple of 16
#didnt get gst-lauch to create a playable file, so just write h264 stream to a file and let MP4Box later do the things
#(1) write to .mp4 (real it is a h264 file) so the Webpage displays progress (looks for mp4)
#gst-launch-1.0 -e multifilesrc location=${SERIES}_%05d.jpg start_index=0 \
#       caps="image/jpeg,framerate=\(fraction\)24/1" \
#       ! jpegdec ! queue ! videoscale \
#       ! video/x-raw, width=1920, height=1072 \
#       ! progressreport name=progress ! queue \
#       ! omxh264enc target-bitrate=15000000 control-rate=variable \
#       ! video/x-h264, profile=high ! filesink location=$SERIES.mp4 >> $LOG_FILE

#due to (1) move it to what it is, a h264 file
#mv $SERIES.mp4 $SERIES.h264
#MP4Box -add $SERIES.h264 "$SERIES-hw.mp4"  >> $LOG_FILE
#rm $SERIES.h264



Br
Tom

Return to “Camera board”