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

Re: RPi Cam Web Interface

Tue Jul 07, 2015 4:16 pm

jussi24 wrote:
btidey wrote:Olegg had made a useful pull request adding support for a second camera if using the compute module not a standard Pi.
That's highly interesting. I thought of it since the first cam module I bought. Are there more information available? I know about a second CSI port that is available on the Broadcom chip. Is it identical in connectivity and (GPU-) features? How is double displaying/preview and other things realized in raspimjpeg? What about GPU-limitations when processing both streams simultaneously? Or is it a switching (either/or) concept?
The compute module makes that second csi port available on it connector and I believe the kit makes it easy to connect to.

In the Olegg change it is just a selection switch in the MMAL layer. I.e we connect to the first interface or we connect to the second. Only one is active at a time. I don't know about whether the GPU or MMAL could handle both simultaneously. My guess would be not.

The other restriction in the raspimjpeg support is that both cameras share the same set of parameters. You can of course change parameters on the fly after making a switch but it is not maintaining them separately. That would be feasible in raspimjpeg but is a fairly largish change to the config set up as most items would need to be indexed.

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

Re: Tweaks to speed up streaming

Tue Jul 07, 2015 4:42 pm

southafricanrob wrote:Hi,
I'm using the default settings and have pretty slow and choppy video on a decent speed wifi network. I have tried tweaking some settings but nothing really has much of an impact. Any suggestions on which settings will have the most impact to get a nice smooth video stream?
As this is a general question that has come up before then rather than lose the answer in a post here I have added a little section under trouble shooting on the elInux wiki.http://elinux.org/RPi-Cam-Web-Interface

MyNameWolfgangS
Posts: 12
Joined: Wed Oct 01, 2014 4:15 pm

Re: RPi Cam Web Interface

Tue Jul 07, 2015 5:20 pm

Hi Robert,

I am confused how to handle the macro stuff. I updated via ./RPi_Cam_Web_Interface_Installer.sh update, that part works fine. I've created a file named end_box.sh in /var/www/macros, gave execution rights, owner and group is www-data.

But the script is never executed. What did I wrong? The script should just create a extra copy of the actual file to a remote NAS.

Thanks Wolfgang

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

Re: RPi Cam Web Interface

Tue Jul 07, 2015 5:52 pm

MyNameWolfgangS wrote:Hi Robert,

I am confused how to handle the macro stuff. I updated via ./RPi_Cam_Web_Interface_Installer.sh update, that part works fine. I've created a file named end_box.sh in /var/www/macros, gave execution rights, owner and group is www-data.

But the script is never executed. What did I wrong? The script should just create a extra copy of the actual file to a remote NAS.

Thanks Wolfgang
First thing to check is the schedule log which will show any macro activity. Like

Code: Select all

{2015/07/07 18:40:49} Capturing stopped
{2015/07/07 18:40:49} Add /var/www/media/vi_0047_20150707_184046.mp4 to Box Queue at pos 0
{2015/07/07 18:40:49} Executing macro /var/www/macros/end_vid.sh "/var/www/media/vi_0047_20150707_184046.mp4.h264" 
{2015/07/07 18:40:50} DEBUG 3
{2015/07/07 18:40:50} Start boxing /var/www/media/vi_0047_20150707_184046.mp4.h264 to /var/www/media/vi_0047_20150707_184046.mp4 Queue pos 0
{2015/07/07 18:40:52} Finished boxing /var/www/media/vi_0047_20150707_184046.mp4 from Box Queue at pos 0
{2015/07/07 18:40:52} Executing macro /var/www/macros/end_box.sh "/var/www/media/vi_0047_20150707_184046.mp4" &
Here a stop capture calls the end_vid.sh script (synchronously) and then calls the end_box.sh (asynchronously) when the boxing operation completes.

It will only try to execute and log if it finds the appropriate macros there. So if there is no log then it is not seeing them for some reason. If it is logging it then it is attempting to run them but they are not working for some reason.

Check the macros config is set Ok in /etc/raspimjpeg. It should define the path and the script names like

Code: Select all

macros_path /var/www/macros
boxing_path
subdir_char @

#Job macros - prefix with & to make it run asynchronously
end_img &end_img.sh
end_vid end_vid.sh
end_box &end_box.sh
And then double check the ownership / permissions of the folder and the files

Code: Select all

-rwxr-xr-- 1 www-data www-data 76 Jun 26 20:32 end_box.sh
-rwxrwxr-- 1 www-data www-data 76 Jun 26 20:20 end_img.sh
-rwxr-xr-- 1 www-data www-data 76 Jun 26 20:31 end_vid.sh

DpMj
Posts: 1
Joined: Wed Jul 08, 2015 10:27 am

Re: RPi Cam Web Interface with webiopi

Wed Jul 08, 2015 10:36 am

Hey was wondering if someone could guide me in the right direction. I am trying to stream just a video preview to a custom webiopi page but when I do Rpi cam Web interface wants to stream my ip plus the port my page is on. How can I get the preview to just look at my ip without the port that the page is on.

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

Re: RPi Cam Web Interface

Wed Jul 08, 2015 11:31 am

You can find the solution on page #99

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

Re: RPi Cam Web Interface with webiopi

Wed Jul 08, 2015 11:32 am

DpMj wrote:Hey was wondering if someone could guide me in the right direction. I am trying to stream just a video preview to a custom webiopi page but when I do Rpi cam Web interface wants to stream my ip plus the port my page is on. How can I get the preview to just look at my ip without the port that the page is on.
I assume you have a webopi accessed from a non-standard port and you have then embedded the live video preview onto that as per the eLinux wiki.

Are you then saying that the access to the preview is using the webopi port number rather than the port associated with getting the live stream data? If so then I think you need to put the RPi port explicitly in the url used to get the preview data. If you have not put a port in explicitly then it will be using port 80, you then need to put that in explicitly. So wherever you have used cam_pic.php (or cam_pic_new.php) (like in the js) replace that by http://host:port/cam_pic.php where host and port need to point to the RPi

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

Re: RPi Cam Web Interface: findings

Thu Jul 09, 2015 8:58 am

Hello,

first: Great work, the best webcam/surveillance software for the pi around!

To improve things, my findings:

1. Motion detection doesn't start after reboot and after start/stop

workaround for reboot:

placed this in /etc/rc.local

Code: Select all

echo "md 1" > /var/www/FIFO

#END RASPIMJPEG SECTION

2. the new 'graphical' version of RPi_Cam_Web_Interface_Installer.sh:

Pls. add the previous functionality with parameters, so one can use it in the 'old' way: start, restart, update ....
eg. if parameters ar present, use the parameters instead of comig up the text graphics.
This is useful for restarting/updating by scripts.

3. Error Messages in apache logs:

Code: Select all

 File does not exist: /var/www/css/extrastyle.css, referer: preview.php
 File does not exist: /var/www/css/extrastyle.css, referer: schedule.php

BR.
Thomas

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

Re: RPi Cam Web Interface: findings

Thu Jul 09, 2015 10:13 am

tomtgrp wrote:Hello,

first: Great work, the best webcam/surveillance software for the pi around!

To improve things, my findings:

1. Motion detection doesn't start after reboot and after start/stop

workaround for reboot:

placed this in /etc/rc.local

Code: Select all

echo "md 1" > /var/www/FIFO

#END RASPIMJPEG SECTION
BR.
Thomas
I wouldn't want my motion to start after a boot / reboot, I'd like to decide when it's used.
3b+, 2b, b+, b, Zero & Zero-W

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

Re: RPi Cam Web Interface

Thu Jul 09, 2015 10:23 am

Gary Littlemore wrote:
tomtgrp wrote:Hello,

first: Great work, the best webcam/surveillance software for the pi around!

To improve things, my findings:

1. Motion detection doesn't start after reboot and after start/stop

workaround for reboot:

placed this in /etc/rc.local

Code: Select all

echo "md 1" > /var/www/FIFO

#END RASPIMJPEG SECTION
BR.
Thomas
I wouldn't want my motion to start after a boot / reboot, I'd like to decide when it's used.
I would, or even adjust this behaviour, because a surveillance cam should watch after power cycle, right ?

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

Re: RPi Cam Web Interface

Thu Jul 09, 2015 10:52 am

tomtgrp wrote:
Gary Littlemore wrote:
tomtgrp wrote:
1. Motion detection doesn't start after reboot and after start/stop

Thomas
I wouldn't want my motion to start after a boot / reboot, I'd like to decide when it's used.
I would, or even adjust this behaviour, because a surveillance cam should watch after power cycle, right ?
It is intended that motion detect start up after a power cycle is a function of the configuration.

The echo workaround shouldn't be necessary. Motion detect should start up after a restart if

1) motion_detection true is in the /etc/raspimjpeg config file. By default it is false.

2) If the scheduler is set up to turn on motion detect for whatever time period is in play at the point of start up. So, for example, if it is set up to send md 1 at the start of day time then that will get sent when restarted during the day.

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

Re: RPi Cam Web Interface

Thu Jul 09, 2015 12:42 pm

Oh, yes, didn't see this.
Now it works w/o the workaraound.
Thanks!

Hellcube
Posts: 10
Joined: Tue Apr 07, 2015 11:51 am

Re: RPi Cam Web Interface

Thu Jul 09, 2015 1:09 pm

I realy love this project so i wish to help out a little as i can. I made a new interface. All CSS (no images used) so it will be easier to make any color scheme as You like. It's only HTML not properly coded into php files.

http://zzpgnigcentrala.pl/camera/

I wish to know if you are interested?

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

Re: RPi Cam Web Interface

Thu Jul 09, 2015 5:46 pm

Hellcube wrote:I realy love this project so i wish to help out a little as i can. I made a new interface. All CSS (no images used) so it will be easier to make any color scheme as You like. It's only HTML not properly coded into php files.

http://zzpgnigcentrala.pl/camera/

I wish to know if you are interested?
Thanks. That layout looks nice and clean. I, for one am interested in pursuing this further. I have mainly concentrated on functionality of the raspimjpeg and the functionality of the web interface. Styling and CSS is not an area I have much expertise in.

I assume this is a mock up html/css and so would need a fair bit of work to implement fully and tie into the php.

Few comments.

1. Having the functional sections to switch between is nice from a user point of view but I think as it stands it means all the 'gallery' images will be fetched when the main pageis accessed which may slow things down a bit if one just wants to bring up the live display.

2. One would need to think through the how clicking on a thumbnail works. Does it replace the live view pane?

3. Schedule is currently a separate php which is used as both the web interface and also as the daemon which executes the schedule. The reason for doing it like that was just that it was easier to get consistency; adding variables on the web side automatically made them available in the daemon. If schedule settings were part of the main page then it couldn't work that way directly.

4. To implement such a big change I would suggest we would branch the code in github. That way it can be worked on and tested / tried without breaking the current set up.

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

Re: RPi Cam Web Interface: findings

Thu Jul 09, 2015 5:58 pm

tomtgrp wrote: 2. the new 'graphical' version of RPi_Cam_Web_Interface_Installer.sh:

Pls. add the previous functionality with parameters, so one can use it in the 'old' way: start, restart, update ....
eg. if parameters ar present, use the parameters instead of comig up the text graphics.
This is useful for restarting/updating by scripts.

3. Error Messages in apache logs:

Code: Select all

 File does not exist: /var/www/css/extrastyle.css, referer: preview.php
 File does not exist: /var/www/css/extrastyle.css, referer: schedule.php
BR.
Thomas
miraaz has done a lot of work on the installer allowing subdirs, port selection, security etc to be done during install time rather than fiddling around after.

The graphical part is intended to replace all the little yes/no and console text entry bits. It will be helpful for most people but is still a work in progress as parts get replaced.

Previous entries are preserved in a config file (introduced by miraaz.

I know what you mean about also being able to automate the whole install process as well. What I would suggest is that we let the graphical piece get finished then it should be possible to consider a switch option that automates the whole process based on the config file. Either that is saved previous stuff or could in principle be generated separately before running.

The Apache errors are being generated because it is looking for a style override css (selected from main page). If it doesn't find one then no overrides are taking place. I think the log messages could be avoided by using a blank extrastyles css file.

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

Re: RPi Cam Web Interface: findings

Thu Jul 09, 2015 6:16 pm

btidey wrote:
tomtgrp wrote: 2. the new 'graphical' version of RPi_Cam_Web_Interface_Installer.sh:

Pls. add the previous functionality with parameters, so one can use it in the 'old' way: start, restart, update ....
eg. if parameters ar present, use the parameters instead of comig up the text graphics.
This is useful for restarting/updating by scripts.

3. Error Messages in apache logs:

Code: Select all

 File does not exist: /var/www/css/extrastyle.css, referer: preview.php
 File does not exist: /var/www/css/extrastyle.css, referer: schedule.php
BR.
Thomas
miraaz has done a lot of work on the installer allowing subdirs, port selection, security etc to be done during install time rather than fiddling around after.

The graphical part is intended to replace all the little yes/no and console text entry bits. It will be helpful for most people but is still a work in progress as parts get replaced.

Previous entries are preserved in a config file (introduced by miraaz.

I know what you mean about also being able to automate the whole install process as well. What I would suggest is that we let the graphical piece get finished then it should be possible to consider a switch option that automates the whole process based on the config file. Either that is saved previous stuff or could in principle be generated separately before running.

The Apache errors are being generated because it is looking for a style override css (selected from main page). If it doesn't find one then no overrides are taking place. I think the log messages could be avoided by using a blank extrastyles css file.
As i wrote, I dont mean the installation precedure. I mean the tasks like start, stop, restart.

So I can restart the Software by

./RPi_Cam_Web_Interface_Installer.sh stop && ./RPi_Cam_Web_Interface_Installer.sh start

So you can let a cronjob do this. With the graphis: not possible!

Example for this need:
I have some Devices operating at remote sites, which are available again after a problem due to restart some services with a nightly cronjob.

I think it would also be a good idea to put the daemon things in a init-script in /etc/init.d and leava the other stuff in RPi_Cam_Web_Interface_Installer.

As the script name says: RPi_Cam_Web_Interface_Installer :-)

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

Re: RPi Cam Web Interface: findings

Thu Jul 09, 2015 9:31 pm

tomtgrp wrote: As i wrote, I dont mean the installation precedure. I mean the tasks like start, stop, restart.

So I can restart the Software by

./RPi_Cam_Web_Interface_Installer.sh stop && ./RPi_Cam_Web_Interface_Installer.sh start

So you can let a cronjob do this. With the graphis: not possible!

Example for this need:
I have some Devices operating at remote sites, which are available again after a problem due to restart some services with a nightly cronjob.

I think it would also be a good idea to put the daemon things in a init-script in /etc/init.d and leava the other stuff in RPi_Cam_Web_Interface_Installer.

As the script name says: RPi_Cam_Web_Interface_Installer :-)
The stop function is 3 lines of code and the start is effectively 4, It would be easy just pull those out into separate start and stop scripts or embed them in whatever else you are doing.

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

Re: RPi Cam Web Interface: findings

Thu Jul 09, 2015 9:40 pm

tomtgrp wrote:
btidey wrote:
tomtgrp wrote: 2. the new 'graphical' version of RPi_Cam_Web_Interface_Installer.sh:

Pls. add the previous functionality with parameters, so one can use it in the 'old' way: start, restart, update ....
eg. if parameters ar present, use the parameters instead of comig up the text graphics.
This is useful for restarting/updating by scripts.

3. Error Messages in apache logs:

Code: Select all

 File does not exist: /var/www/css/extrastyle.css, referer: preview.php
 File does not exist: /var/www/css/extrastyle.css, referer: schedule.php
BR.
Thomas
miraaz has done a lot of work on the installer allowing subdirs, port selection, security etc to be done during install time rather than fiddling around after.

The graphical part is intended to replace all the little yes/no and console text entry bits. It will be helpful for most people but is still a work in progress as parts get replaced.

Previous entries are preserved in a config file (introduced by miraaz.

I know what you mean about also being able to automate the whole install process as well. What I would suggest is that we let the graphical piece get finished then it should be possible to consider a switch option that automates the whole process based on the config file. Either that is saved previous stuff or could in principle be generated separately before running.

The Apache errors are being generated because it is looking for a style override css (selected from main page). If it doesn't find one then no overrides are taking place. I think the log messages could be avoided by using a blank extrastyles css file.
As i wrote, I dont mean the installation precedure. I mean the tasks like start, stop, restart.

So I can restart the Software by

./RPi_Cam_Web_Interface_Installer.sh stop && ./RPi_Cam_Web_Interface_Installer.sh start

So you can let a cronjob do this. With the graphis: not possible!

Example for this need:
I have some Devices operating at remote sites, which are available again after a problem due to restart some services with a nightly cronjob.

I think it would also be a good idea to put the daemon things in a init-script in /etc/init.d and leava the other stuff in RPi_Cam_Web_Interface_Installer.

As the script name says: RPi_Cam_Web_Interface_Installer :-)
tomtgrp i understand what you mean. Please give me little time. In real life i working 2 places 12-14 h every day. So only what i need is more time lol. But yes i also thinked today put start-stop stuff in /etc/init.d. But why put there update?

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

Re: RPi Cam Web Interface: findings

Fri Jul 10, 2015 8:28 am

miraaz wrote:
tomtgrp i understand what you mean. Please give me little time. In real life i working 2 places 12-14 h every day. So only what i need is more time lol. But yes i also thinked today put start-stop stuff in /etc/init.d. But why put there update?
miraaz,
sounds like my real live...

The update of course not in start-stop.

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

Re: RPi Cam Web Interface

Fri Jul 10, 2015 8:48 am

With the new GUI update screen, what is now the correct way to update? The Wiki is still showing the old way to update.
3b+, 2b, b+, b, Zero & Zero-W

edimi
Posts: 6
Joined: Wed Mar 04, 2015 8:15 am

Re: RPi Cam Web Interface

Fri Jul 10, 2015 9:50 am

at night the preview is quite bright but when "motion detection" starts recording a video the image gets dark almost black. This happens even if i use rpi noir camera with infrared leds enabled.
Is there anything i can do for that?

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

Re: RPi Cam Web Interface

Fri Jul 10, 2015 10:33 am

Gary Littlemore wrote:With the new GUI update screen, what is now the correct way to update? The Wiki is still showing the old way to update.
Run script, select update.
Run script again select install.

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

Re: RPi Cam Web Interface

Fri Jul 10, 2015 10:43 am

edimi wrote:at night the preview is quite bright but when "motion detection" starts recording a video the image gets dark almost black. This happens even if i use rpi noir camera with infrared leds enabled.
Is there anything i can do for that?
This occurs because in preview it is collecting data benefiting from longer exposure times / night mode. When a video capture starts then it switches over to the video set up and if this has a normal (daytime) frame rate of 25 fps then the exposure time is very short and you get a very dark image.

One of the things you can do is to drop the fps of the recording (e.g. to 4fps) which will help but will probably not be as good as the preview. This is more a 'feature' of the underlying camera system and has been discussed before.

Noir and IR llighting can help but you need a decent powerful IR illuminator to make a substantial difference.

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

Re: RPi Cam Web Interface

Fri Jul 10, 2015 10:54 am

btidey wrote:
Gary Littlemore wrote:With the new GUI update screen, what is now the correct way to update? The Wiki is still showing the old way to update.
Run script, select update.
Run script again select install.
Is there now a command to directly run the script?
3b+, 2b, b+, b, Zero & Zero-W

kevw
Posts: 22
Joined: Wed Aug 27, 2014 1:49 pm

Re: RPi Cam Web Interface

Fri Jul 10, 2015 12:18 pm

btidey wrote:
edimi wrote:at night the preview is quite bright but when "motion detection" starts recording a video the image gets dark almost black. This happens even if i use rpi noir camera with infrared leds enabled.
Is there anything i can do for that?
This occurs because in preview it is collecting data benefiting from longer exposure times / night mode. When a video capture starts then it switches over to the video set up and if this has a normal (daytime) frame rate of 25 fps then the exposure time is very short and you get a very dark image.

One of the things you can do is to drop the fps of the recording (e.g. to 4fps) which will help but will probably not be as good as the preview. This is more a 'feature' of the underlying camera system and has been discussed before.

Noir and IR llighting can help but you need a decent powerful IR illuminator to make a substantial difference.
Manually tweaking the settings also helps, such as manual shutter speed (330000 on the upper limit), EV (10) etc - it introduces noise and also movement blurs due to shutter speed but it can be useable...depends on how much ambient light you're playing with.

EDIT - thats probably not true for video...I'm thinking just on the preview now .. doh .. sorry

Return to “Camera board”