rjhazeld
Posts: 28
Joined: Mon Feb 16, 2015 9:19 am

Re: RPi Cam Web Interface

Thu Sep 07, 2017 8:47 pm

I have tried a few days ago to install RPi Cam Web Interface on a clean install from noobs. First try resulted in lots of error messages regarding PHP because php7.0 ( instead of php5) is now adopted. to get round the problem I installed nginx and php first and then used install which worked after amending a couple of paths. I now have a largely working system which has the media folder mapped to a NAS. The Nginx error log shows a problem with the variable 'Remote_User':-

2017/09/07 21:11:17 [error] 527#527: *7157 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined variable: remote_user in /var/www/Cam/index.php on line 190" while reading response header from upstream, client: 192.168.1.6, server: localhost, request: "GET /Cam/index.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "192.168.1.12", referrer: "http://192.168.1.12/Cam/schedule.php"

I am not sure where this variable is supposed to be read from can anyone enlighten me please.

PHP7.0 doesn't include an -apc module so far it doesn't seem to be a problem do I need to find a workaround?

I guess an updated installation file will be available in time. Any help with these issues in the meantime would be appreciated.

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

Re: RPi Cam Web Interface

Wed Sep 13, 2017 8:59 am

wpballa1 wrote:
Wed Sep 06, 2017 6:14 pm
Is there any way to enable/disable the end_box.sh macro remotely? I have a system far away that is generating too many messages from light changes as clouds go by.
The end_box.sh macro if present is called when the conversion of a capture to .mp4 format is completed. It is typically used to send a notification or email.

So is your problem that you are getting too many notifications from a script you have written?

There is currently no direct enable / disable of these macros from the web interface, but it would be possible to add one if thought to be useful.

The other thing to check is the motion settings. If using internal it is possible to tune the response time to filter out quite a lot of false detections. Adding the motion detection variables to the annotation string helps tune the settings so that the sensitivity and time response is good enough for real motion detection while filtering out false ones.

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

Re: RPi Cam Web Interface

Wed Sep 13, 2017 9:02 am

rjhazeld wrote:
Thu Sep 07, 2017 8:47 pm
I have tried a few days ago to install RPi Cam Web Interface on a clean install from noobs. First try resulted in lots of error messages regarding PHP because php7.0 ( instead of php5) is now adopted. to get round the problem I installed nginx and php first and then used install which worked after amending a couple of paths. I now have a largely working system which has the media folder mapped to a NAS. The Nginx error log shows a problem with the variable 'Remote_User':-

2017/09/07 21:11:17 [error] 527#527: *7157 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined variable: remote_user in /var/www/Cam/index.php on line 190" while reading response header from upstream, client: 192.168.1.6, server: localhost, request: "GET /Cam/index.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "192.168.1.12", referrer: "http://192.168.1.12/Cam/schedule.php"

I am not sure where this variable is supposed to be read from can anyone enlighten me please.

PHP7.0 doesn't include an -apc module so far it doesn't seem to be a problem do I need to find a workaround?

I guess an updated installation file will be available in time. Any help with these issues in the meantime would be appreciated.
Thanks for this report. I have been on vacation and hadn't seen the update to php7. I'll check this out to see what updates are needed.

Albertowue
Posts: 3
Joined: Wed Sep 13, 2017 3:46 pm

Re: RPi Cam Web Interface

Wed Sep 13, 2017 3:59 pm

Hi all, I have successfully installed RPI on my new Raspberry Zero W (with a fresh install of the last version of raspbian, stretch).
In particular I update the system (apt-get update and upgrade), followed the instructions (./install) and choose lighttpd as webserver.
After 5 minutes the installation has finished and I restarted the raspberry.
Now everything works but I can not switch to MJPEG-Stream, when i click on the button appear LOADING in red and the preview does not appear.

Can you help me?

Thx

wpballa1
Posts: 23
Joined: Sat Jun 27, 2015 12:49 am

Re: RPi Cam Web Interface

Wed Sep 13, 2017 4:15 pm

It would be useful to be able to enable/disable the various macros. I tried changing the motion settings to reduce false alarms from clouds going by, but I could not get acceptable results even with 100% on the light adjustment. I am changing to a PIR for motion detection email alarms to solve the problem. I just thought the macro control would be useful.

As an aside, I've also run into problems with php in stretch, am currently trying again with the last wheezy version.

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

Re: RPi Cam Web Interface

Thu Sep 14, 2017 9:18 am

Albertowue wrote:
Wed Sep 13, 2017 3:59 pm
Hi all, I have successfully installed RPI on my new Raspberry Zero W (with a fresh install of the last version of raspbian, stretch).
In particular I update the system (apt-get update and upgrade), followed the instructions (./install) and choose lighttpd as webserver.
After 5 minutes the installation has finished and I restarted the raspberry.
Now everything works but I can not switch to MJPEG-Stream, when i click on the button appear LOADING in red and the preview does not appear.

Can you help me?

Thx
Turn on Developer tools in your browser (normally F12 or via menu) and select network tab.

When in default stream mode you should see each image being requested and downloaded at a high rate.

When you click the stream button you should see one request for the stream followed by a much slower rate of status requests.

See below
stream.png
stream.png (19.66 KiB) Viewed 1740 times

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

Re: RPi Cam Web Interface

Thu Sep 14, 2017 9:20 am

wpballa1 wrote:
Wed Sep 13, 2017 4:15 pm
It would be useful to be able to enable/disable the various macros. I tried changing the motion settings to reduce false alarms from clouds going by, but I could not get acceptable results even with 100% on the light adjustment. I am changing to a PIR for motion detection email alarms to solve the problem. I just thought the macro control would be useful.

As an aside, I've also run into problems with php in stretch, am currently trying again with the last wheezy version.
I'll see if I can add something for the macros.

All was working ok in Jessie but I haven't tried the latest update released a few days ago. I'll be checking that out at the weekend.

Albertowue
Posts: 3
Joined: Wed Sep 13, 2017 3:46 pm

Re: RPi Cam Web Interface

Thu Sep 14, 2017 10:29 am

When I click the stream bottom (for the MJPEG Stream) I see:

Image

If I change the format of streaming a couple of times (normal -> MJPEG -> normal) when I go back to the standard format the preview has become very slow (it seems to have 0.5 fps or less). In this case I must reboot the Raspberry.

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

Re: RPi Cam Web Interface

Thu Sep 14, 2017 11:40 am

Albertowue wrote:
Thu Sep 14, 2017 10:29 am
When I click the stream bottom (for the MJPEG Stream) I see:

Image

If I change the format of streaming a couple of times (normal -> MJPEG -> normal) when I go back to the standard format the preview has become very slow (it seems to have 0.5 fps or less). In this case I must reboot the Raspberry.
The stream request is not being honoured for some reason (shows as pending)

If you restart and use default does it work OK? The overall data transmitted is almost the same between the 2 modes. It is just that in stream mode only one request is sent whereas in default each frame is requested.

It is possible the request is getting lost for some reason or it may be associated with latest jessie which I haven't tested with yet.

You could try an older jessie (http://downloads.raspberrypi.org/raspbian/images/) while I check out if the latest jessie is causing problems.

Albertowue
Posts: 3
Joined: Wed Sep 13, 2017 3:46 pm

Re: RPi Cam Web Interface

Thu Sep 14, 2017 2:20 pm

Thank you very much btidey :D , I followed your advice and solved the problem! I have download an older version of Raspbian Jessie Lite (
June release), same procedure (update, git clone and ./install with lighttpd) and now the MJPEG Stream work like a charm! :mrgreen:
So the problem is the last version of Raspian Stretch :roll:
Last edited by Albertowue on Thu Sep 14, 2017 3:53 pm, edited 1 time in total.

wpballa1
Posts: 23
Joined: Sat Jun 27, 2015 12:49 am

Re: RPi Cam Web Interface

Thu Sep 14, 2017 3:36 pm

I too solved the php incompatibility by reverting to the last Jessie Lite version, so the problem is just with the Stretch release.

boolstring
Posts: 1
Joined: Fri Sep 15, 2017 7:24 am

Re: RPi Cam Web Interface

Fri Sep 15, 2017 7:31 am

Hi there,

i newly installed the PRI-Cam Web-Interface and i am pretty impressed about the possibilities.
At the moment i try to figure out some hardware specific specs. So far i did not find any information on that.

I would like to use the raspi with the rpi-cam-web interface as a time-lapse recorder in a more or less dim and dark environment (sub-sea imaging). For this i am looking for a solution to get a trigger signal, every time an image is taken. With this signal i would like to ignite an additional high power flash build on LEDs.

The flash is there, the pi is there, the software is there.... But i am not able to find a trigger. Might be the resason that i am a little better in LED flash design than in software ;-)

Is there any solution or is the someone who has done something similar before?

Best regards

boolstring

Bakiki
Posts: 1
Joined: Fri Sep 15, 2017 1:09 pm

Re: RPi Cam Web Interface

Fri Sep 15, 2017 1:17 pm

Hi

Can anyone confirm if there's a way to control the camera from a python script. I want to access the video feed remotely within a python code which requires stopping and starting video feed at intervals directed by the script.
Alternatively, is there a way to capture the url web feed through python..... again at intervals...

Any help would be appreciated.


Thanks

quavoce
Posts: 98
Joined: Fri Nov 27, 2015 9:11 am

Re: RPi Cam Web Interface

Sat Sep 16, 2017 6:29 pm

Hi Robert,

Could you create a new path setting in /etc/raspimjpeg where raw .h264 video files are saved to please? I need something that saves h264 files to another folder other than media when "MP4 Boxing mode" has been set to Off.

I am having a lot of watchdog resets occurring on my RPi Web Cams due to a lack of resources when MP4Box converts 30 or 60 mins video files (using the "Video Split" and "Monitoring" motion features). This was confirmed after I turned off Boxing mode and subsequently received no more watchdog resets.

My plan is to offload MP4Boxing to a central Linux server with more processing power. Once a h264 file has finished recording, end_vid.sh will copy the file to the Linux server via an NFS mount and remotely trigger the MP4Box command via SSH. Once converted, the file will be stored in a large capacity HD that is in turn mounted to the RPI Cam's /var/www/html/media folder to make it accessible from the webpage.

I tried setting the /etc/raspimjpeg boxing_path parameter to /var/www/html/h264, but with boxing mode turned off, it continued to save files to /var/www/html/media

I have considered using /var/www/html/media as the mount point, but I'd prefer live video to be recorded to the local SD card first in case there's a problem with the mount/network. The script end_vid.sh would check the share is ok before doing the copy.

Perhaps the parameter could be called "h264_path"? Or maybe boxing_path is modified to also work when boxing mode is turned off?

Many thanks!

radoo
Posts: 3
Joined: Mon Jan 19, 2015 7:28 pm

Re: RPi Cam Web Interface

Sun Sep 17, 2017 9:52 am

wpballa1 wrote:
Thu Sep 14, 2017 3:36 pm
I too solved the php incompatibility by reverting to the last Jessie Lite version, so the problem is just with the Stretch release.
Only change I had to do for an nginx install was to replace php-apc with php-apcu package in install.sh script. Then will work on the Stretch debian release.

quavoce
Posts: 98
Joined: Fri Nov 27, 2015 9:11 am

Re: RPi Cam Web Interface

Sun Sep 17, 2017 9:59 am

quavoce wrote:
Sat Sep 16, 2017 6:29 pm
Hi Robert,

Could you create a new path setting in /etc/raspimjpeg where raw .h264 video files are saved to please? I need something that saves h264 files to another folder other than media when "MP4 Boxing mode" has been set to Off.

I am having a lot of watchdog resets occurring on my RPi Web Cams due to a lack of resources when MP4Box converts 30 or 60 mins video files (using the "Video Split" and "Monitoring" motion features). This was confirmed after I turned off Boxing mode and subsequently received no more watchdog resets.

My plan is to offload MP4Boxing to a central Linux server with more processing power. Once a h264 file has finished recording, end_vid.sh will copy the file to the Linux server via an NFS mount and remotely trigger the MP4Box command via SSH. Once converted, the file will be stored in a large capacity HD that is in turn mounted to the RPI Cam's /var/www/html/media folder to make it accessible from the webpage.

I tried setting the /etc/raspimjpeg boxing_path parameter to /var/www/html/h264, but with boxing mode turned off, it continued to save files to /var/www/html/media

I have considered using /var/www/html/media as the mount point, but I'd prefer live video to be recorded to the local SD card first in case there's a problem with the mount/network. The script end_vid.sh would check the share is ok before doing the copy.

Perhaps the parameter could be called "h264_path"? Or maybe boxing_path is modified to also work when boxing mode is turned off?

Many thanks!
Please ignore my request above, I was able to use the modify the video_path to make this work:

video_path /var/www/html/media/vi_%v_%Y%M%D_%h%m%s.mp4

to

video_path /var/www/html/h264/vi_%v_%Y%M%D_%h%m%s.mp4

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

Re: RPi Cam Web Interface

Sun Sep 17, 2017 10:45 am

Hi,

just want to put my request on top. Does anyone have an approch on that problem?

Thanks Wolfgang


Hi,

what have I to do, to get a stream working in Kodi? Kodi 17 is running on a second raspberry with OS LibreElec. Several cameras are running on raspberries Pi1, Pi2 and Pi 3.

Thanks a lot
Wolfgang (NOOB)

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

Re: RPi Cam Web Interface

Sun Sep 17, 2017 12:04 pm

btidey wrote:
Thu Sep 14, 2017 9:20 am
wpballa1 wrote:
Wed Sep 13, 2017 4:15 pm
It would be useful to be able to enable/disable the various macros. I tried changing the motion settings to reduce false alarms from clouds going by, but I could not get acceptable results even with 100% on the light adjustment. I am changing to a PIR for motion detection email alarms to solve the problem. I just thought the macro control would be useful.

As an aside, I've also run into problems with php in stretch, am currently trying again with the last wheezy version.
I'll see if I can add something for the macros.

All was working ok in Jessie but I haven't tried the latest update released a few days ago. I'll be checking that out at the weekend.
Latest version allows control of the macros under 'Systems'. There is a new pipe command 'um' to support this. I will document this in the wiki.

Note this update does NOT change anything with respect to latest Jessie; I am still checking that out.

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

Re: RPi Cam Web Interface

Sun Sep 17, 2017 12:12 pm

Bakiki wrote:
Fri Sep 15, 2017 1:17 pm
Hi

Can anyone confirm if there's a way to control the camera from a python script. I want to access the video feed remotely within a python code which requires stopping and starting video feed at intervals directed by the script.
Alternatively, is there a way to capture the url web feed through python..... again at intervals...

Any help would be appreciated.


Thanks
Full control of camera operation and settings is performed by writing commands into the pipe FIFO in the web folder. Any programming language can do this quite easily.

For example, from a command line one can write echo im > /var/www/html/FIFO to capture an image.

Commands available are described in the wiki and a summary is also available on the schedule web page.

In python just open the FIFO, print the command to it and close.

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

Re: RPi Cam Web Interface

Sun Sep 17, 2017 12:14 pm

radoo wrote:
Sun Sep 17, 2017 9:52 am
wpballa1 wrote:
Thu Sep 14, 2017 3:36 pm
I too solved the php incompatibility by reverting to the last Jessie Lite version, so the problem is just with the Stretch release.
Only change I had to do for an nginx install was to replace php-apc with php-apcu package in install.sh script. Then will work on the Stretch debian release.
As I am checking this out further, could you confirm that mjpeg streaming was OK under nginx after that change

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

Re: RPi Cam Web Interface

Sun Sep 17, 2017 12:18 pm

MyNameWolfgangS wrote:
Sun Sep 17, 2017 10:45 am
Hi,

just want to put my request on top. Does anyone have an approch on that problem?

Thanks Wolfgang


Hi,

what have I to do, to get a stream working in Kodi? Kodi 17 is running on a second raspberry with OS LibreElec. Several cameras are running on raspberries Pi1, Pi2 and Pi 3.

Thanks a lot
Wolfgang (NOOB)
I haven't tried it but you should be able to do this by installing a browser add-on in Kodi and then viewing as normal

E.g. http://www.kodireviews.com/chrome-launcher-addon/

Note that if you want just want to preview multiple camera in there then the wiki describes a method to do this.

radoo
Posts: 3
Joined: Mon Jan 19, 2015 7:28 pm

Re: RPi Cam Web Interface

Sun Sep 17, 2017 4:23 pm

btidey wrote:
Sun Sep 17, 2017 12:14 pm
radoo wrote:
Sun Sep 17, 2017 9:52 am
wpballa1 wrote:
Thu Sep 14, 2017 3:36 pm
I too solved the php incompatibility by reverting to the last Jessie Lite version, so the problem is just with the Stretch release.
Only change I had to do for an nginx install was to replace php-apc with php-apcu package in install.sh script. Then will work on the Stretch debian release.
As I am checking this out further, could you confirm that mjpeg streaming was OK under nginx after that change
Yes, mjpeg works fine under nginx installed on latest Stretch raspbian. Just reinstalled again on a clean image to confirm and not waste people's time. The only thing preventing rpi_cam_web_i to install at all with nginx is the obsolete user cache for PHP package. For stretch: php-apcu that is. Hope this helps! Cheers and thanks for a great software!

quavoce
Posts: 98
Joined: Fri Nov 27, 2015 9:11 am

Re: RPi Cam Web Interface

Sun Sep 17, 2017 7:04 pm

quavoce wrote:
Sun Sep 17, 2017 9:59 am
quavoce wrote:
Sat Sep 16, 2017 6:29 pm
Hi Robert,

Could you create a new path setting in /etc/raspimjpeg where raw .h264 video files are saved to please? I need something that saves h264 files to another folder other than media when "MP4 Boxing mode" has been set to Off.

I am having a lot of watchdog resets occurring on my RPi Web Cams due to a lack of resources when MP4Box converts 30 or 60 mins video files (using the "Video Split" and "Monitoring" motion features). This was confirmed after I turned off Boxing mode and subsequently received no more watchdog resets.

My plan is to offload MP4Boxing to a central Linux server with more processing power. Once a h264 file has finished recording, end_vid.sh will copy the file to the Linux server via an NFS mount and remotely trigger the MP4Box command via SSH. Once converted, the file will be stored in a large capacity HD that is in turn mounted to the RPI Cam's /var/www/html/media folder to make it accessible from the webpage.

I tried setting the /etc/raspimjpeg boxing_path parameter to /var/www/html/h264, but with boxing mode turned off, it continued to save files to /var/www/html/media

I have considered using /var/www/html/media as the mount point, but I'd prefer live video to be recorded to the local SD card first in case there's a problem with the mount/network. The script end_vid.sh would check the share is ok before doing the copy.

Perhaps the parameter could be called "h264_path"? Or maybe boxing_path is modified to also work when boxing mode is turned off?

Many thanks!
Please ignore my request above, I was able to use the modify the video_path to make this work:

video_path /var/www/html/media/vi_%v_%Y%M%D_%h%m%s.mp4

to

video_path /var/www/html/h264/vi_%v_%Y%M%D_%h%m%s.mp4
Hmm, the downside with this alternative method is that I loose the thumbnail images.

When you have time Robert, could you look into my original request above please? My idea is to basically have h264 files saved in an alternative folder, with the thumbnails being written to the media folder. This is what happens when boxing_path is set, but I don't want boxing to occur, yet when I turn boxing mode off, the h264 files revert to being saved in media.

Another hack I found could involve charging the following line in /etc/raspimjpeg

MP4Box_cmd (set -e;MP4Box -fps %i -add %s %s > /dev/null 2>&1;rm "%s";) &

to something like

MP4Box_cmd (/var/www/html/macros/mp4boxcmd.sh %s)

A non-hack method would be better but I'm sure this will work in the mean time. :)

quavoce
Posts: 98
Joined: Fri Nov 27, 2015 9:11 am

Re: RPi Cam Web Interface

Sun Sep 17, 2017 7:10 pm

btidey wrote:
Sun Sep 17, 2017 12:12 pm
Bakiki wrote:
Fri Sep 15, 2017 1:17 pm
Hi

Can anyone confirm if there's a way to control the camera from a python script. I want to access the video feed remotely within a python code which requires stopping and starting video feed at intervals directed by the script.
Alternatively, is there a way to capture the url web feed through python..... again at intervals...

Any help would be appreciated.


Thanks
Full control of camera operation and settings is performed by writing commands into the pipe FIFO in the web folder. Any programming language can do this quite easily.

For example, from a command line one can write echo im > /var/www/html/FIFO to capture an image.

Commands available are described in the wiki and a summary is also available on the schedule web page.

In python just open the FIFO, print the command to it and close.
Useful feature!! Thanks!

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

Re: RPi Cam Web Interface

Sun Sep 17, 2017 9:38 pm

quavoce wrote:
Sun Sep 17, 2017 7:04 pm
quavoce wrote:
Sun Sep 17, 2017 9:59 am
quavoce wrote:
Sat Sep 16, 2017 6:29 pm
Hi Robert,

Could you create a new path setting in /etc/raspimjpeg where raw .h264 video files are saved to please? I need something that saves h264 files to another folder other than media when "MP4 Boxing mode" has been set to Off.

I am having a lot of watchdog resets occurring on my RPi Web Cams due to a lack of resources when MP4Box converts 30 or 60 mins video files (using the "Video Split" and "Monitoring" motion features). This was confirmed after I turned off Boxing mode and subsequently received no more watchdog resets.

My plan is to offload MP4Boxing to a central Linux server with more processing power. Once a h264 file has finished recording, end_vid.sh will copy the file to the Linux server via an NFS mount and remotely trigger the MP4Box command via SSH. Once converted, the file will be stored in a large capacity HD that is in turn mounted to the RPI Cam's /var/www/html/media folder to make it accessible from the webpage.

I tried setting the /etc/raspimjpeg boxing_path parameter to /var/www/html/h264, but with boxing mode turned off, it continued to save files to /var/www/html/media

I have considered using /var/www/html/media as the mount point, but I'd prefer live video to be recorded to the local SD card first in case there's a problem with the mount/network. The script end_vid.sh would check the share is ok before doing the copy.

Perhaps the parameter could be called "h264_path"? Or maybe boxing_path is modified to also work when boxing mode is turned off?

Many thanks!
Please ignore my request above, I was able to use the modify the video_path to make this work:

video_path /var/www/html/media/vi_%v_%Y%M%D_%h%m%s.mp4

to

video_path /var/www/html/h264/vi_%v_%Y%M%D_%h%m%s.mp4
Hmm, the downside with this alternative method is that I loose the thumbnail images.

When you have time Robert, could you look into my original request above please? My idea is to basically have h264 files saved in an alternative folder, with the thumbnails being written to the media folder. This is what happens when boxing_path is set, but I don't want boxing to occur, yet when I turn boxing mode off, the h264 files revert to being saved in media.

Another hack I found could involve charging the following line in /etc/raspimjpeg

MP4Box_cmd (set -e;MP4Box -fps %i -add %s %s > /dev/null 2>&1;rm "%s";) &

to something like

MP4Box_cmd (/var/www/html/macros/mp4boxcmd.sh %s)

A non-hack method would be better but I'm sure this will work in the mean time. :)
OK. I'll see what can be done.

It is correct that currently the boxing path is only used when boxing is active. Also thumbnails only get created when the video path is within the same media folder as the thumbnails. The reason for this is that it allows any folder structure in the video_path to be flattened and included in the thumbnail name which in turn allows the thumbnail to point to the video file no matter which subfolder it is in.

I think the two solutions are to change the flattening process to remove that restriction or to make the boxing_path always active even if boxing is not being used. The latter may be the easier option.

Return to “Camera board”

Who is online

Users browsing this forum: jbeale and 15 guests