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

another use for RPi Cam Web Interface

Mon Jun 29, 2015 5:09 am

Somewhat of a tangent, but I want to thank silvanmelchior and btidey yet again for the ever-improving software. I found another use for it as a collector of test cases for an OpenCV experiment.
Demo on YouTube: https://www.youtube.com/watch?t=18&v=KCevhaR75_s

I'm pretty impressed with OpenCV and Python. After one weekend of playing with examples, I was able to get something that does more than a stock motion-detector webcam does. At least in some cases, it can distinguish cars and pedestrians from tree branches moving in the wind, by measuring how far detected objects travel across the screen.

mm803
Posts: 1
Joined: Mon Jun 29, 2015 12:26 pm

Re: RPi Cam Web Interface

Mon Jun 29, 2015 12:39 pm

Hi guys,

This is a great project. I've tried to install it on the new RPi but no luck.
On the webpage I get Loading but the image never starts. I can reboot the RPi from the menu though.

It must be something easy to fix but I couldn't find anyone having the same problem.

Could someone suggest an idea?

Thanks

Marius

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

Re: RPi Cam Web Interface

Mon Jun 29, 2015 1:59 pm

mm803 wrote:On the webpage I get Loading but the image never starts. I can reboot the RPi from the menu though.
Does your RPi camera work OK with other applications (raspistill or raspivid) ? Have you tried a different browser? (It works on all my computers and laptops, and my Android phone, but does not work on my wife's newer Samsung/Android phone, just shows "Loading").

If you go to the main RPi Cam web page, click "Edit schedule settings" button, and then "Show Log", what does it say? Below is what it says for me:

Code: Select all

{2015/06/29 06:57:35} RaspiMJPEG Version 5.2.1
{2015/06/29 06:57:35} recommended video buffers 1
{2015/06/29 06:57:35} h264 buffers set to recommended 1
{2015/06/29 06:57:35} MJPEG streaming, ready to receive commands
{2015/06/29 06:57:35} send smd 9
{2015/06/29 06:57:36} DEBUG 3
[2015/06/29 06:58:05] RaspiCam support started
[2015/06/29 06:58:05] Capture Pipe already exists /var/www/FIFO1
[2015/06/29 06:58:05] Scheduler loop is started
[2015/06/29 06:58:05] Reload parameters command requested
[2015/06/29 06:58:05] Scheduler loop is started
[2015/06/29 06:58:06] New period detected 3
[2015/06/29 06:58:06] Send md 1
[2015/06/29 06:58:08] Send em auto
{2015/06/29 06:58:08} External motion detection started
{2015/06/29 06:58:09} recommended video buffers 1
{2015/06/29 06:58:09} h264 buffers set to recommended 1
{2015/06/29 06:58:09} DEBUG 3
{2015/06/29 06:58:09} Change: exposure_mode = auto
[2015/06/29 06:58:11] Scheduled management tasks. Next at 1435588086

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

Re: motion settings and nighttime vision

Mon Jun 29, 2015 2:17 pm

Hey Robert (or anyone else here):

Looking for a little help on activating motion.

Basically, the recorded video shot is about 1-3 seconds later than the preview photo. Is there a way I can tighten that up? I would like to see the recording begin at the same time as the preview shot (if that's even possible).

Sorry for the ignorance here, but I'm not sure what I should be changing with all the motion setting options.

Also, I'm trying to keep these cameras hidden, and could use better lighting for nighttime use. I tried an IR spotlight, but since it was outside, and my RPi cams (both are Pi-NoIRs) are inside (against a glass in the window), it was not as effective as I would like. As you might imagine, even setting the camera to nighttime produced a lot of false positives.

Thanks again, Robert (and everyone else) for making this excellent app even better.

Gary Littlemore
Posts: 327
Joined: Thu Oct 11, 2012 11:52 am
Location: Cheshire, UK

Re: RPi Cam Web Interface

Mon Jun 29, 2015 2:20 pm

mm803 wrote:It must be something easy to fix but I couldn't find anyone having the same problem.
Lots of people have reported that issue...

search.php?keywords=loading&t=63276&sf=msgonly
3b+, 2b, b+, b, Zero & Zero-W

Gary Littlemore
Posts: 327
Joined: Thu Oct 11, 2012 11:52 am
Location: Cheshire, UK

Re: motion settings and nighttime vision

Mon Jun 29, 2015 2:21 pm

boomlikethat wrote:Hey Robert (or anyone else here):

Looking for a little help on activating motion.

Basically, the recorded video shot is about 1-3 seconds later than the preview photo. Is there a way I can tighten that up? I would like to see the recording begin at the same time as the preview shot (if that's even possible).

Sorry for the ignorance here, but I'm not sure what I should be changing with all the motion setting options.

Also, I'm trying to keep these cameras hidden, and could use better lighting for nighttime use. I tried an IR spotlight, but since it was outside, and my RPi cams (both are Pi-NoIRs) are inside (against a glass in the window), it was not as effective as I would like. As you might imagine, even setting the camera to nighttime produced a lot of false positives.

Thanks again, Robert (and everyone else) for making this excellent app even better.
Within 'Camera Settings' you have an option for 'Buffer', put 3000 (milliseconds) in the field and hit 'Ok'
Last edited by Gary Littlemore on Mon Jun 29, 2015 2:33 pm, edited 1 time in total.
3b+, 2b, b+, b, Zero & Zero-W

rmjspa
Posts: 13
Joined: Wed Jun 10, 2015 11:03 am

Re: RPi Cam Web Interface

Mon Jun 29, 2015 2:29 pm

ok, about the buffer you know. You can record 3 sec. before the motion starts.

About the IR lightning, you have to bring the camera as close as possible to the window. Just a few mm. The IR Lightning should be outside the window or in a far end corner also very close to the glass.

For IR Lightning I can highly recommend this one out of Ebay.

http://www.ebay.de/itm/301559299373?_tr ... EBIDX%3AIT

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

Re: motion settings and nighttime vision

Mon Jun 29, 2015 2:36 pm

Gary Littlemore wrote:
boomlikethat wrote:Hey Robert (or anyone else here):

Looking for a little help on activating motion.

Basically, the recorded video shot is about 1-3 seconds later than the preview photo. Is there a way I can tighten that up? I would like to see the recording begin at the same time as the preview shot (if that's even possible).

Sorry for the ignorance here, but I'm not sure what I should be changing with all the motion setting options.

Also, I'm trying to keep these cameras hidden, and could use better lighting for nighttime use. I tried an IR spotlight, but since it was outside, and my RPi cams (both are Pi-NoIRs) are inside (against a glass in the window), it was not as effective as I would like. As you might imagine, even setting the camera to nighttime produced a lot of false positives.

Thanks again, Robert (and everyone else) for making this excellent app even better.
Within 'Camera Settings' you have an option for 'Buffer', put 3000 (milliseconds) in the field and hit 'Ok'
Garry,

Thanks, I'll give it shot!

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

Re: another use for RPi Cam Web Interface

Mon Jun 29, 2015 2:43 pm

jbeale wrote:Somewhat of a tangent, but I want to thank silvanmelchior and btidey yet again for the ever-improving software. I found another use for it as a collector of test cases for an OpenCV experiment.
Demo on YouTube: https://www.youtube.com/watch?t=18&v=KCevhaR75_s

I'm pretty impressed with OpenCV and Python. After one weekend of playing with examples, I was able to get something that does more than a stock motion-detector webcam does. At least in some cases, it can distinguish cars and pedestrians from tree branches moving in the wind, by measuring how far detected objects travel across the screen.
This is cool! The idea that it also shows coordinates could make it really useful. Thanks for sharing!

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

Re: RPi Cam Web Interface

Mon Jun 29, 2015 3:14 pm

rmjspa wrote:ok, about the buffer you know. You can record 3 sec. before the motion starts.

About the IR lightning, you have to bring the camera as close as possible to the window. Just a few mm. The IR Lightning should be outside the window or in a far end corner also very close to the glass.

For IR Lightning I can highly recommend this one out of Ebay.

http://www.ebay.de/itm/301559299373?_tr ... EBIDX%3AIT
Thanks for the info. I do have a few of these, haven't deployed them. A larger one I had was against the brick wall, about 5-6 to from the glass from the setup of the RPi. Trying to keep the actual location hidden, if I can. You could see the lighting when set to nighttime mode, but would go dark when recording began.

I'm going to give it another shot, getting close as I can while trying to be "stealthy". Thanks!

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

Re: another use for RPi Cam Web Interface

Mon Jun 29, 2015 3:25 pm

@boomlikethat: With the camera in preview or stills mode, it can go to long-exposure "night" mode, at least 1/4 second or more. But when recording video (including if you have the buffer enabled, meaning it is video recording to buffer all the time) it uses a short exposure to maintain 25 fps so the image is much darker. IMHO the RPi camera isn't the right solution if you want moving images at night. If you do use an IR or any kind of light, it should be shining through a completely different piece of glass, otherwise multiple internal reflections within the glass get back to the camera and end up washing out your image. Look at any outdoor camera with IR, you'll see the camera glass and IR LED glass covers are separate.
boomlikethat wrote:This is cool! The idea that it also shows coordinates could make it really useful. Thanks for sharing!
Actually, the stock 'motion' program can also give you the upper-left and lower-right coordinates of the detected motion area, but it tends to be a rough approximation. It is useful for example, to generate a thumbnail showing only the motion area instead of the whole frame. OpenCV gives you more tools and parameters to tweak to separate out the motion of interest from the possibly noisy background, so I find it better at tracking an object moving across the frame .

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

Re: another use for RPi Cam Web Interface

Mon Jun 29, 2015 3:29 pm

jbeale wrote:@boomlikethat: With the camera in preview or stills mode, it can go to long-exposure "night" mode, at least 1/4 second or more. But when recording video (including if you have the buffer enabled, meaning it is video recording to buffer all the time) it uses a short exposure to maintain 25 fps so the image is much darker. IMHO the RPi camera isn't the right solution if you want moving images at night. If you do use an IR or any kind of light, it should be shining through a completely different piece of glass, otherwise multiple internal reflections within the glass get back to the camera and end up washing out your image. Look at any outdoor camera with IR, you'll see the camera glass and IR LED glass covers are separate.

Ok, I think I try setting the IR lighting in another window, I have a number of them in the area I have the RPi set up.

Yeah, I tend to agree on the RPi Camera at night, but I'm still willing to try. I do have a few outdoor, IR cameras, so I see what you mean about the different glass.
boomlikethat wrote:This is cool! The idea that it also shows coordinates could make it really useful. Thanks for sharing!
Actually, the stock 'motion' program can also give you the upper-left and lower-right coordinates of the detected motion area, but it tends to be a rough approximation. It is useful for example, to generate a thumbnail showing only the motion area instead of the whole frame. OpenCV gives you more tools and parameters to tweak to separate out the motion of interest from the possibly noisy background.
.

Uh, how do you do that? :)

miraaz
Posts: 34
Joined: Tue May 19, 2015 9:28 am

Re: RPi Cam Web Interface

Mon Jun 29, 2015 7:46 pm

miraaz wrote:
btidey wrote:
The installer should have said

Currently webserver is using port xx
Do you want to change it?

It then sets up the Web server config as required. One bit missing at the moment is that this port number (if not default 80) is also required in the motion netcam_url setting if using motion detection and this is not currently fixed up by the installer and must be done manually.
Tnx. I look that when i find time.
Its implemented now. Happy testing.

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

Re: another use for RPi Cam Web Interface

Mon Jun 29, 2015 8:20 pm

boomlikethat wrote:Uh, how do you do that? :)
You change /etc/motion/motion.conf to run a script when a motion event triggers saving a still frame. Below is the line I used:

Code: Select all

on_picture_save /home/pi/mmal/psave.sh %f %i %J %K %L
Here I am calling my 'psave.sh' bash script to extract the area of interest. More detail here: viewtopic.php?f=43&t=52855

PicoPi
Posts: 74
Joined: Sat Jun 27, 2015 10:37 pm
Location: Ottawa, Canada

Re: RPi Cam Web Interface

Mon Jun 29, 2015 8:56 pm

Exactly. I bought a dozen of these
http://www.aliexpress.com/item/1-Pcs-fo ... 84777.html
and want to automate my house :)
When you ring the bell, the pi will open the door for you if you are in the database. I think it's going to be a very fun project and a lot of failures :(
There is a lot of info on facial rec and I thing it can be done reliably.
But success will taste even sweeter :)

miraaz
Posts: 34
Joined: Tue May 19, 2015 9:28 am

Re: RPi Cam Web Interface

Mon Jun 29, 2015 9:02 pm

triedonce wrote:
btidey wrote:
triedonce wrote: I too am unable to save the external motion config through the web interface. Any changes I make return to the old ones.

My motion.conf file was owned by pi:pi so I did a sudo chown www-data:www-data /etc/motion/motion.conf .
Now ls -la /etc/motion/motion.conf shows : -rw-r--r-- 1 www-data www-data 24139 Jun 25 08:29 motion.conf , but I still am unable to save changes via the web interface save button.

Any advice anyone? I feel I am really overlooking something simple here.
There was a problem setting permissions on the motion.conf file in the installer but should be fixed now. The installer changes the group to www-data and permission to 664 and seems to work OK. I would have thought your ownership change would be similar but try the group method.
Thanks for the suggestion. I tried the grp method and also chmod 664 on the motion.conf file but alas to no avail. I also restarted the pi just to be sure.

I think I may have to do an update and install and see if that helps. Failing that possibly a complete purge and re-install. I could have messed up something still being a bit of a noob ;)

Love the whole web interface thing and thanks for all the support.
I fixed that bug. Withing merge and mast work fine then.

Try:

Code: Select all

sudo chown motion:www-data /etc/motion/motion.conf
and please report if that helped.

triedonce
Posts: 12
Joined: Wed Jun 24, 2015 9:59 pm

Re: RPi Cam Web Interface

Mon Jun 29, 2015 10:26 pm

Yes indeed that fixed it.
Thanks very much.

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

Re: motion settings and nighttime vision

Tue Jun 30, 2015 1:34 am

boomlikethat wrote:
Gary Littlemore wrote:
boomlikethat wrote:Hey Robert (or anyone else here):

Looking for a little help on activating motion.

Basically, the recorded video shot is about 1-3 seconds later than the preview photo. Is there a way I can tighten that up? I would like to see the recording begin at the same time as the preview shot (if that's even possible).

Sorry for the ignorance here, but I'm not sure what I should be changing with all the motion setting options.

Also, I'm trying to keep these cameras hidden, and could use better lighting for nighttime use. I tried an IR spotlight, but since it was outside, and my RPi cams (both are Pi-NoIRs) are inside (against a glass in the window), it was not as effective as I would like. As you might imagine, even setting the camera to nighttime produced a lot of false positives.

Thanks again, Robert (and everyone else) for making this excellent app even better.
Within 'Camera Settings' you have an option for 'Buffer', put 3000 (milliseconds) in the field and hit 'Ok'
Garry,

Thanks, I'll give it shot!
Worked great, thanks so much! Runs better than ever.

illiac4
Posts: 3
Joined: Wed May 13, 2015 4:21 am

Re: RPi Cam Web Interface

Tue Jun 30, 2015 8:42 am

Is it possible to merge changes with https://github.com/skalad/RPi_Cam_Web_I ... r_pan_tilt and make it optional during installation?

TNX

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

Re: RPi Cam Web Interface

Tue Jun 30, 2015 8:57 am

illiac4 wrote:Is it possible to merge changes with https://github.com/skalad/RPi_Cam_Web_I ... r_pan_tilt and make it optional during installation?

TNX
Back on 4th June we integrated in the Servoblaster Skalad type support. One user tested it and it seemed to work.

viewtopic.php?p=770017#p770017

It is not an installer option. There is a file in the www folder called servo_off. If that is renamed to servo_on then the extra controls become visible and operational.

illiac4
Posts: 3
Joined: Wed May 13, 2015 4:21 am

Re: RPi Cam Web Interface

Tue Jun 30, 2015 10:10 am

Oh must have missed that. It works now.
Is it possible to motion track it automatically and when the object goes out of camera sight it should return to initial position?

Gary Littlemore
Posts: 327
Joined: Thu Oct 11, 2012 11:52 am
Location: Cheshire, UK

Re: RPi Cam Web Interface

Tue Jun 30, 2015 12:53 pm

btidey wrote:
illiac4 wrote:Is it possible to merge changes with https://github.com/skalad/RPi_Cam_Web_I ... r_pan_tilt and make it optional during installation?

TNX
Back on 4th June we integrated in the Servoblaster Skalad type support. One user tested it and it seemed to work.

viewtopic.php?p=770017#p770017

It is not an installer option. There is a file in the www folder called servo_off. If that is renamed to servo_on then the extra controls become visible and operational.
Another to-do for the install script maybe, 'Would you like the ServoBlaster turning on? y/n'.
3b+, 2b, b+, b, Zero & Zero-W

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

Re: RPi Cam Web Interface

Tue Jun 30, 2015 2:12 pm

illiac4 wrote:Oh must have missed that. It works now.
Is it possible to motion track it automatically and when the object goes out of camera sight it should return to initial position?
Neither the current external or internal motion triggers are object based. They are just looking for overall changes occurring in the view.

Jbeale had some interesting posts about object detection / tracking using open CSV but using these techniques to detect triggers and do camera tracking control would be challenging to say the least. First you have to deal with background changes as the camera moves and then you have to deal with the potential for multiple conflicting object movements.

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

Re: RPi Cam Web Interface

Tue Jun 30, 2015 2:15 pm

Gary Littlemore wrote: Another to-do for the install script maybe, 'Would you like the ServoBlaster turning on? y/n'.
Possibly but this may start to get overly complex. I think before we get too many questions asked we might want a 'Everything same as before' option.

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

Re: another use for RPi Cam Web Interface

Tue Jun 30, 2015 5:14 pm

boomlikethat wrote:
jbeale wrote:Somewhat of a tangent, but I want to thank silvanmelchior and btidey yet again for the ever-improving software. I found another use for it as a collector of test cases for an OpenCV experiment.
Demo on YouTube: https://www.youtube.com/watch?t=18&v=KCevhaR75_s

I'm pretty impressed with OpenCV and Python. After one weekend of playing with examples, I was able to get something that does more than a stock motion-detector webcam does. At least in some cases, it can distinguish cars and pedestrians from tree branches moving in the wind, by measuring how far detected objects travel across the screen.
This is cool! The idea that it also shows coordinates could make it really useful. Thanks for sharing!
@jbeale: so I looked into your solution with coordinates, etc., and even subscribed to your channel! I'm quite the noob on these things, so I had difficulty doing the whole bash script thing with motion as well.

I'll keep trying, but if there's a set of instructions on how you got to that demo video point with OpenCV, let me know. It really is cool, good work!

Return to “Camera board”