NeXCtP
Posts: 4
Joined: Sat Feb 14, 2015 6:47 pm

Re: RPi Cam Web Interface

Wed Feb 25, 2015 11:03 pm

btidey wrote:
NeXCtP wrote:Hi.

Is it possible to specify another location for time-lapse images only?
The raspimjpeg main config file /etc/raspimjpeg has separate storage path settings for image and video. The raspimjpeg would need to be stopped and restarted for any change to take effect. The image path would apply to all image recordings both manual and time lapse.

However, I haven't tried this and I think it will break some aspects of the web site which expect everything in the media folder. It would certainly break my preview.php enhancements at the moment.
ok.

So the only alternative is to change the image path completely?

scanner
Posts: 15
Joined: Tue Dec 23, 2014 4:25 pm

Re: RPi Cam Web Interface

Thu Feb 26, 2015 11:52 am

can someone help me with saving timelapse images to a windows share, i'm stiil a noob at this but getting better.
so far this is what I have done
edit /etc/fstab and add the line
//192.168.1.3/rpi /home/pi/server/rpi cifs defaults,_netdev,rw,username=rpiuser,password=Password1,domain=pvtdomain,file_mode=0777,dir_mode=0777 0 0
run sudo mount -a
I can create files through ssh on the mounted share. so permissionsis not the issue from ssh
edit /etc/motion/motion.conf and change target_dir /home/pi/server/rpi
when I record an image it still dumps them in the /var/www/media location.
I also have a problem in that the share is not mounted at boot

What am I missing

btidey
Posts: 1637
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Thu Feb 26, 2015 12:15 pm

NeXCtP wrote: So the only alternative is to change the image path completely?
Depends on what you are trying to achieve here.

If you change the imagepath config then any single image and timelapse recording will go that new folder. If that is all you want then that works. However, if you then click on Download Videos and Images on the web page it will only show video recordings as those are still being saved in the media folder. If you want to do both, use a different folder and still see images in the Download web page, then the web code would need to be changed. Specifically preview.php would need to know where those paths were and to scan and handle video and images separately. Not particularly difficult to do.

If you want to store timelapse differently from single images then that is significantly trickier and would need changes to the underlying raspimjpeg process and an extra path config.

I guess now is the right time to ask why you need to keep them separate. Your top level requirement may be achievable in a different way.

btidey
Posts: 1637
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Thu Feb 26, 2015 12:22 pm

scanner wrote:can someone help me with saving timelapse images to a windows share, i'm stiil a noob at this but getting better.
so far this is what I have done
edit /etc/fstab and add the line
//192.168.1.3/rpi /home/pi/server/rpi cifs defaults,_netdev,rw,username=rpiuser,password=Password1,domain=pvtdomain,file_mode=0777,dir_mode=0777 0 0
run sudo mount -a
I can create files through ssh on the mounted share. so permissionsis not the issue from ssh
edit /etc/motion/motion.conf and change target_dir /home/pi/server/rpi
when I record an image it still dumps them in the /var/www/media location.
I also have a problem in that the share is not mounted at boot

What am I missing
The major thing missing here is that it is not motion that is saving the time lapse images it is raspimjpeg. motion is just being used to detect motion and then send triggers back to raspimjpeg. For standard timelapse operation motion isn't involved at all and is not even running. So changing motion.conf here will have no effect.

You can change the target location where raspimjpeg wil store videos and images as pointed out in another answer. However, this will break the Download Video and image part of the web site.

You could maybe consider making the /var/www/media the target of your share. If you look on the RPiCam wiki there is a chapter pointing to detailed instructions for that.
Last edited by btidey on Thu Feb 26, 2015 12:42 pm, edited 1 time in total.

btidey
Posts: 1637
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Thu Feb 26, 2015 12:39 pm

ianj wrote:Just following up on my original problem... I've since formatted the MicroSD card, reinstalled Raspbian (not NOOBS) and started fresh with only the 3 update steps (update, dist-upgrade and rpi-update) on a Raspi2.

Motion detection doesn't work at the default settings with the interface. I'm lost at this point, as if it doesn't work with a brand new install, I don't know where to begin troubleshooting. :cry:
I too am puzzled by this, most people don't have this much trouble.

The first step in trouble shooting still has to be finding out where in the chain things are braking down where the chain is something like.

1) raspimjpeg is running producing a sequence of images in /dev/shm/mjpeg all called cam.jpg but these should be changing

2) The main web page continually accesses these to display what is going on.

3) motion is started up when detect is pushed on the web page

4) motion also retrieves the stream of the cam.jpg as a source of material for detection. It does this by accessing the url as set up in /etc/motion/motion.conf, netcam_url This same url should work from anywhere. I have my web access secured with a username password and so have to set that up as well in motion.conf with netcam_userpass

5) motion detects movement using its settings as determined in motion.conf

6) When motion detects movement then it sends back a trigger command to the FIFO in /var/www which raspimjpeg is monitoring. These commands can also be simulated via the command line, e.g. echo 'ca 1' >/var/www/FIFO

7) raspimjpeg then picks up the command and then acts on it.

scanner
Posts: 15
Joined: Tue Dec 23, 2014 4:25 pm

Re: RPi Cam Web Interface

Thu Feb 26, 2015 1:02 pm

btidey wrote:
scanner wrote:can someone help me with saving timelapse images to a windows share, i'm stiil a noob at this but getting better.
so far this is what I have done
edit /etc/fstab and add the line
//192.168.1.3/rpi /home/pi/server/rpi cifs defaults,_netdev,rw,username=rpiuser,password=Password1,domain=pvtdomain,file_mode=0777,dir_mode=0777 0 0
run sudo mount -a
I can create files through ssh on the mounted share. so permissionsis not the issue from ssh
edit /etc/motion/motion.conf and change target_dir /home/pi/server/rpi
when I record an image it still dumps them in the /var/www/media location.
I also have a problem in that the share is not mounted at boot

What am I missing
The major thing missing here is that it is not motion that is saving the time lapse images it is raspimjpeg. motion is just being used to detect motion and then send triggers back to raspimjpeg. For standard timelapse operation motion isn't involved at all and is not even running. So changing motion.conf here will have no effect.

You can change the target location where raspimjpeg wil store videos and images as pointed out in another answer. However, this will break the Download Video and image part of the web site.

You could maybe consider making the /var/www/media the target of your share. If you look on the RPiCam wiki there is a chapter pointing to detailed instructions for that.
Thanks
It was after the post that I just mounted the share to the media folder and this did the trick, the only problem I now have is that I have to log into the rpi and run sudo mount -a befor starting the time lapse or any other capture option. I did find elsewhere on google that the auto mount has something to do with the fstab running before the network is established, is there any way to delay this process or auto run sudo mount -a after a response from the network such as ping server and on reply run a ommand.

btidey
Posts: 1637
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Thu Feb 26, 2015 3:31 pm

scanner wrote: Thanks
It was after the post that I just mounted the share to the media folder and this did the trick, the only problem I now have is that I have to log into the rpi and run sudo mount -a befor starting the time lapse or any other capture option. I did find elsewhere on google that the auto mount has something to do with the fstab running before the network is established, is there any way to delay this process or auto run sudo mount -a after a response from the network such as ping server and on reply run a ommand.
You could try the script technique described in last post here http://www.raspberrypi.org/forums/viewt ... 28&t=57113

NeXCtP
Posts: 4
Joined: Sat Feb 14, 2015 6:47 pm

Re: RPi Cam Web Interface

Thu Feb 26, 2015 7:23 pm

btidey wrote:
NeXCtP wrote: So the only alternative is to change the image path completely?
Depends on what you are trying to achieve here.

If you change the imagepath config then any single image and timelapse recording will go that new folder. If that is all you want then that works. However, if you then click on Download Videos and Images on the web page it will only show video recordings as those are still being saved in the media folder. If you want to do both, use a different folder and still see images in the Download web page, then the web code would need to be changed. Specifically preview.php would need to know where those paths were and to scan and handle video and images separately. Not particularly difficult to do.

If you want to store timelapse differently from single images then that is significantly trickier and would need changes to the underlying raspimjpeg process and an extra path config.

I guess now is the right time to ask why you need to keep them separate. Your top level requirement may be achievable in a different way.
The issue I want to resolve is that the preview.php cant handle the amount of files a 12-72 hour time-laps produces.

My thought was that maybe this was an easy fix.

There is little point in Viewing time-laps images through the web client. So loss of that is no big deal.
But I would like to keep regular single images in the default folder.

ianj
Posts: 21
Joined: Mon May 12, 2014 2:24 am

Re: RPi Cam Web Interface

Fri Feb 27, 2015 4:23 am

Does anybody have a quick and dirty cron job to enable motion detection between hours and disable at night? I noticed that there were some mentions in the topic, wasn't sure what experiences people have had.

Basically just looking for something that turns it on during daylight, ~6am and off by ~9pm. Going to try this after one final re-install :)

User avatar
DougieLawson
Posts: 40247
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: RPi Cam Web Interface

Fri Feb 27, 2015 7:50 am

Search on here for "sunwait", there's a couple of old threads where we discussed that and came up with a neat solution.
https://www.google.co.uk/search?q=sunwa ... org/forums
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

btidey
Posts: 1637
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Fri Feb 27, 2015 12:50 pm

ianj wrote:Does anybody have a quick and dirty cron job to enable motion detection between hours and disable at night? I noticed that there were some mentions in the topic, wasn't sure what experiences people have had.

Basically just looking for something that turns it on during daylight, ~6am and off by ~9pm. Going to try this after one final re-install :)
I used to use cron with sunwait to do exactly this. You have to be a little careful as there are some sunwait builds out there that have been modified to make them compatible with Windows but have broken the delay part. Fairly simple to fix as it was just a difference between seconds and milliseconds.

Having got a working sunwait then I just had a couple of cron entries like

Code: Select all

03 14 * * * sunwait wait civil set 10 50.0000N 0.0000W ; echo -n 'em night' >/var/www/FIFO ; sunwait civil set -03:00 50.0000N 0.0000W ; echo -n 'md 0' >/var/www/FIFO
03 00 * * * sunwait wait civil rise -03:00 50.0000N 0.0000W ; echo -n 'md 1' >/var/www/FIFO ; sunwait civil rise 20 50.0000N 0.0000W ; echo -n 'em auto' >/var/www/FIFO
(Latitude and longtitude changed from my actual settings!) This actually used 2 seqeuntially sunwaits in each task to separately change mode and set motion detection but could be simplified to one if just wanting to enable / disable motion detection.

However, I then moved to a more flexible solution which doesn't use sunwait. It is a python program launched at boot which calculates sunrise sunset and gives a more flexible set up that can switch modes and send different capture command for 4 different periods (night, dawn, day, dusk). This is described earlier in this thread but details are at https://github.com/roberttidey/RaspiCam

I am now moving this a stage further by integrating it into the web site. To do this I have ported the code into php and also built an extra schedule settings page so that any parameters can be adjusted from the browser. This is not quite ready yet. I have the web settings part working (but not styled) see below. I am starting to test the background daemon and will update when this is ready. It will go in my fork at https://github.com/roberttidey/RPi_Cam_Web_Interface which includes thumbnail previews and motion settings.
Attachments
schedule1.jpg
schedule1.jpg (30.12 KiB) Viewed 4469 times

Giosan
Posts: 7
Joined: Sat Feb 28, 2015 12:05 am

Re: RPi Cam Web Interface

Sat Feb 28, 2015 12:08 am

Awesome script! Works quite nice.

One issue so far: when annotation is on (any text), size switches random every 0.5 sec or so. Big, small, big, big, small. Tried in Chrome and FF. Recorded videos also record this. Any idea what it is?

Then some question: is it possible to implement a dashcam like function to record in blocks of 5 min or so and auto remove old recordings? Only when motion detected.

And is it possible to always start with Motion detection on when rebooting?

rahlquist
Posts: 149
Joined: Tue Jan 21, 2014 1:02 pm

Re: RPi Cam Web Interface

Sat Feb 28, 2015 2:18 am

Giosan wrote:Awesome script! Works quite nice.

One issue so far: when annotation is on (any text), size switches random every 0.5 sec or so. Big, small, big, big, small. Tried in Chrome and FF. Recorded videos also record this. Any idea what it is?
Known issue its being looked at more info here http://www.raspberrypi.org/forums/viewt ... 9&start=50
And is it possible to always start with Motion detection on when rebooting?
Yes near the bottom of /etc/raspimjpeg you will find
motion_detection false

Change that to true.

Giosan
Posts: 7
Joined: Sat Feb 28, 2015 12:05 am

Re: RPi Cam Web Interface

Sat Feb 28, 2015 7:02 am

rahlquist wrote:
Giosan wrote:Awesome script! Works quite nice.

One issue so far: when annotation is on (any text), size switches random every 0.5 sec or so. Big, small, big, big, small. Tried in Chrome and FF. Recorded videos also record this. Any idea what it is?
Known issue its being looked at more info here http://www.raspberrypi.org/forums/viewt ... 9&start=50
And is it possible to always start with Motion detection on when rebooting?
Yes near the bottom of /etc/raspimjpeg you will find
motion_detection false

Change that to true.

OK thanks!

When my finances are better next month I will donate something.

How about splitting recordings in 5 min segments?

Tw1stid
Posts: 20
Joined: Sat Apr 13, 2013 2:27 pm

Re: RPi Cam Web Interface

Sat Feb 28, 2015 3:40 pm

Thanks for the great script!

I've been configuring motion but it doesn't seem like changing the pre_capture value has any effect? I'm recording at 2FPS, and I set pre_capture to 10 in motion.conf. I assumed I'd get 5 seconds of video before motion was detected?

The more I thought about it, it did cross my mind that maybe pre_capture wouldn't work at all as I assume that this just uses motion to tell when motion occurs, but then tells raspivid to actually do the recording?

I'd also like to take high quality stills every X seconds whilst doing motion detection, is this possible? As soon as motion detection starts all the other buttons are greyed out.

Any help appreciated. Thanks.

piecam
Posts: 84
Joined: Mon Feb 23, 2015 12:55 am

Re: RPi Cam Web Interface

Sat Feb 28, 2015 10:35 pm

HI,
https://bitbucket.org/ccrisan/motioneye ... on%20Guide

If some expert here would like to use this GUI for this to manage Motion configuration, and other stuff, it probably make things more easy for noobs and more complete.

thanks in advance.

jazzyuk
Posts: 3
Joined: Sun Mar 01, 2015 12:37 pm

Re: RPi Cam Web Interface

Sun Mar 01, 2015 2:54 pm

Hi,

Bit of a newbie question, how do I change the resolution from 512 x 288? I've set the FOV to 16:9 on the UI, custom resolution to 1280 x 720, but it still stays the same as 512 x 288.

Thanks in advance.

:)

piecam
Posts: 84
Joined: Mon Feb 23, 2015 12:55 am

Re: RPi Cam Web Interface

Sun Mar 01, 2015 3:19 pm

HI all experts,

Can some one kindly point to a link or provide a working Motion detection configuration as well as raspMJPEG conf.?

Basically, I'd like to Pi up and running with with motion detection in effect. If there's , say 10-15% pixel change, record high resolution stills (if not 2500x1900, 1600x1200 or 1280x1024 would be good) for that motion. If it can record 10 mintues video, it's even better.

There are so much info on this forum and I have difficulty in putting them together.
Thanks in advance.

btidey
Posts: 1637
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Sun Mar 01, 2015 7:16 pm

jazzyuk wrote:Hi,

Bit of a newbie question, how do I change the resolution from 512 x 288? I've set the FOV to 16:9 on the UI, custom resolution to 1280 x 720, but it still stays the same as 512 x 288.

Thanks in advance.

:)
The 512 x 288 is the size of the preview images which are also shown on the main screen and also sent to motion for detection. I think the width is always 512 but the height varies according to the aspect ratio chosen. You can click on the image to enlarge it but the base resolution of the preview remains the same so it doesn't help much.

This is not the same as the resolution at which recordings or images are captured. These will be at whatever the settings have been put to e.g. 1920 x 1080. If you download a capture then you will see the full definition when played in standard player.

The screen you get in downloads by clicking on a capture does use the actual recording (i.e. the full resolution) but in the standard version this gets downsized into a 640 wide window. In my version of the download screen I can set the width of this window so it can show captures in larger ( or smaller windows). E.g. you can set it to be in a 1280 wide window.

btidey
Posts: 1637
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Sun Mar 01, 2015 7:38 pm

piecam wrote:HI all experts,

Can some one kindly point to a link or provide a working Motion detection configuration as well as raspMJPEG conf.?

Basically, I'd like to Pi up and running with with motion detection in effect. If there's , say 10-15% pixel change, record high resolution stills (if not 2500x1900, 1600x1200 or 1280x1024 would be good) for that motion. If it can record 10 mintues video, it's even better.

There are so much info on this forum and I have difficulty in putting them together.
Thanks in advance.
You can make it boot with motion detection on by default by changing the last line in the raspimjpeg conf file (in /etc from

Code: Select all

motion_detection false
to

Code: Select all

motion_detection true
The standard motion.conf (in /etc/motion/) should provide a degree of motion detection as standard.

The 2 basic settings to change are
noise_level 32
and
threshold 1500

Noise level sets the change needed in the corresponding pixel from frame to frame for it to be regarded as a changed pixel. These have values from 0 - 255. So if a pixel is say 100 in 1 frame and 120 in the next then it is not a changed pixel.

The threshold is the number of pixels that have to 'change' from frame to frame for the frames to be regarded as different and potentially causing a motion trigger. The frames fed to motion are 512 x 288 (for 16x9) and so have 150,000 pixels. With a threshold of 1500 that means that 1% of the pixels have to change to cause a motion event.

I find these defaults a bit too sensitive and as typical objects moving through a frame give big changes in pixel values and larger numbers of pixels changing. So increasing these can give less false events if these numbers are increased. I use 80 for a noise level and 3000 for the threshold. Note that in my version you can adjust these values from the web interface directly.

The current software is arranged to stop video recording when motion detects no movement. It is possible with my python helper program (soon to be integrated into the web app) to basically disable motion from stopping a recording and then setting a maximum capture time of whatever you want which will then terminate the capture. That way any triggered recording will be of a fixed length.

jazzyuk
Posts: 3
Joined: Sun Mar 01, 2015 12:37 pm

Re: RPi Cam Web Interface

Sun Mar 01, 2015 8:40 pm

btidey wrote:
jazzyuk wrote:Hi,

Bit of a newbie question, how do I change the resolution from 512 x 288? I've set the FOV to 16:9 on the UI, custom resolution to 1280 x 720, but it still stays the same as 512 x 288.

Thanks in advance.

:)
The 512 x 288 is the size of the preview images which are also shown on the main screen and also sent to motion for detection. I think the width is always 512 but the height varies according to the aspect ratio chosen. You can click on the image to enlarge it but the base resolution of the preview remains the same so it doesn't help much.

This is not the same as the resolution at which recordings or images are captured. These will be at whatever the settings have been put to e.g. 1920 x 1080. If you download a capture then you will see the full definition when played in standard player.

The screen you get in downloads by clicking on a capture does use the actual recording (i.e. the full resolution) but in the standard version this gets downsized into a 640 wide window. In my version of the download screen I can set the width of this window so it can show captures in larger ( or smaller windows). E.g. you can set it to be in a 1280 wide window.
Hi,

Thanks for the reply. I'm away from home now but will check out what you said asap.

Regards

chenks
Posts: 21
Joined: Mon Feb 02, 2015 9:50 am

Re: RPi Cam Web Interface

Mon Mar 02, 2015 10:53 am

chenks wrote:the rotation option on the webpage doesn't seem to be working for me.
i'm selecting 180 from the drop-down box, but nothing happens (same for any other option in that dropdown box).
the flip options also seem to do nothing.
i still can't get the settings (with RPi 4.0.3) to apply when using Chrome.

the following don't seem to work.
Chrome 40.x on mac
Chrome 40.x on android
Chrome 41.x (beta) on android

the following do work
Safari 8.0.3 on mac
Chrome 40.x on windows

can anyone offer any help on this?

btidey
Posts: 1637
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Mon Mar 02, 2015 12:41 pm

I have now added scheduling option to the web set up as mentioned before. This replaces my previous python helper program. It gives the same facilities but all controlled via the web pages. It is built into schedule.php now in my fork at https://github.com/roberttidey/RPi_Cam_Web_Interface

It splits the day into 4 periods based on sunrise/sunset. Motion start and end events are then translated into potentially different capture commands for each period. Transitions between 1 day period and the next also send in commands which may be used to switch camera settings (e.g. between auto and night exposure modes.

A separate FIFO is set up by schedule which now receives the motion event start and finish and it in turn then forwards onto the regular FIFO the required commands. The motion settings need to be changed to send to the new FIFO but this can be done via the motion settings page.

It keeps a log of its activity which may be viewed on the web pages.

The background schedule process used for this may be started and stopped from the web page. It could also be added to the boot if needed.
Attachments
schedule2.jpg
schedule2.jpg (44.48 KiB) Viewed 4025 times

User avatar
mad-hatter
Posts: 419
Joined: Sun Feb 26, 2012 2:58 pm
Location: By the UK seaside

Re: RPi Cam Web Interface

Tue Mar 03, 2015 2:10 pm

Hello,

For various reasons I had to re-install RPi Cam Web, its working but with a slight problem.
In preview, using Firefox or Seamonkey on my Widows 7 PC.
The insert 'RPi Cam 2015.03.03_13:18:09' rapidly flickers between the 2 font sizes as shown in the attachment, the time advances correctly.
If I take a still or video, on viewing the image or video the insert shows correctly.
Is this a known fault or my installation gone wrong?

Regards
web-cam.jpg
web-cam.jpg (21.21 KiB) Viewed 3916 times

Code: Select all

pi@mypi ~ $ /opt/vc//bin/vcgencmd version
Feb 28 2015 18:36:00 
Copyright (c) 2012 Broadcom
version 8d7f19506c5d561e7db647e02281376e7e139269 (clean) (release)
pi@mypi ~ $ 

pi@mypi ~ $ uname -a
Linux mypi 3.18.8-v7+ #763 SMP PREEMPT Sat Feb 28 18:29:00 GMT 2015 armv7l GNU/Linux
pi@mypi ~ $ 

btidey
Posts: 1637
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Tue Mar 03, 2015 5:05 pm

mad-hatter wrote:Hello,

For various reasons I had to re-install RPi Cam Web, its working but with a slight problem.
In preview, using Firefox or Seamonkey on my Widows 7 PC.
The insert 'RPi Cam 2015.03.03_13:18:09' rapidly flickers between the 2 font sizes as shown in the attachment, the time advances correctly.

Check out post in this thread from Sat Feb 28, 2015 2:18 am.

Some systems seem to show this but not all.

Return to “Camera board”