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

Re: RPi Cam Web Interface

Mon Jan 23, 2017 9:32 am

Arrebar wrote:I am preparing a home security camera system for someone. For this purpose I use a raspberry pi 3 with the original camera and display. To prevent the display to be on 24/7 I have installed a screensaver on the raspberry.

Upon motion detection, I want run a script that stops the screensaver. The script works when I use it from the commandline, but it does not work from the RPI cam web interface. The log shows the script is executed, however, nothing happens:

[2017/01/21 20:22:17] Start capture requested from Pipe
[2017/01/21 20:22:17] Send sy screen.sh
{2017/01/21 20:22:17} Executing macro /var/www/html/macros/screen.sh &
[2017/01/21 20:22:19] Send im

In the macros folder, ls -l will give -rwxrwxrwx 1 www-data www-data screen.sh

Does anyone work with the macros? Of does anyone have another idea how to call my script file upon motion detection.
Many thanks
Log shows your macro is being executed so that part is OK. The reason why it is not working (but working from command line) is probably to do with permissions. When a macro is run by the system then it is being run by user www-data. If the operations that the script is trying to perform are not allowed for this user then it won't work, whereas from the command line it is being run as user (pi) and then does work.

Running as www-data does give extra security to prevent a web operation doing nasty things. You can either add www-data user to groups that are allowed to do the operation or you can be more selective and allow the www-data to perform specific operations. This is actually how the web interface is allowed to do things like reboot and shutdown the system. The install puts a file /etc/sudoers.d/RPI_Cam_Web_Interface which specifies the operation that can be performed. A similar approach could be used to add more commands.

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

Re: RPi Cam Web Interface

Mon Jan 23, 2017 9:52 am

rjhazeld wrote:A bit odd since this was a clean install of a fresh download of Jessie onto a brand new card on two Pi a pi zero and a Pi 3b.

I found the install instructions on the elinux page a bit confusing with the instructions for Jessie Light and then some additional workarounds for Jessie. It seems that the ./install works for Jessie now so maybe an edit of that focusing on the new approach with a note that if motion settings aren't displayed when external motion is started to check that the HTTP Control settings are correct. The RPi_Cam_Web_Interface_Installer details could be put at the end of the section for reference. For most running, ./install and completing the dialogue box, will work fine.

It's a great piece of software in its own right and as a base from which custom pages can be created.
I have tried to clarify a bit more and added some material to trouble shooting for the motion parameters.

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

Re: RPi Cam Web Interface

Mon Jan 23, 2017 10:04 am

Max1968 wrote:Hi,

I'm using this for several cams around the house for ~2 years now, and i really like it. About 3 months ago i changed from external motion to internal motion detection and "outsourced" the boxing to a NAS where I stored the videos anyway in order to reduce load on the pi's.

However recently some of my cameras are "loosing" events, and I found the following entries in some of my cameras' logs:

As you can see, all these are restarted by watchdog almost every minute. The cameras mounted in the nestboxes dont have these issues, unfortunately I dont have exact temperature/moisture data for all my cameras, but for sure these are mounted in a unfriendly environment. They are protected from rain as they are underneath a ceiling, but for sure they are facing low temperature (it is -13° outside right now) and there might even be some moisture sometimes. Might this be the reason or is there anything else I can check to figure out the root cause ?

I wanted to mount these inside anyway and just expose the camera lens to the outside, but didnt have time yet to do this - So this might move this up my todo list if it is the reason :)
The watchdog triggers typically happen when the camera callbacks that provide the preview data stop for some reason.

The temperature may be making the Pis more susceptible to any marginal voltage supply problems so I would definitely be ensuring that the voltage at the Pi board itself is within tolerance >4.75V and maybe more generous when running at low temperatures.

Another very recent problem is that the latest rpi-update kernel installs seemed to have introduced some form of camera incompatibility with the software when run on older Pi models. This will only be a possible problem if the rpi-update has been run explicitly.

Max1968
Posts: 11
Joined: Fri Jul 24, 2015 6:24 am

Re: RPi Cam Web Interface

Mon Jan 23, 2017 10:25 am

I think in my case neither the power supply nor the "age" of my pies is the issue - The power supplies for those affected pies are inside the building with very short USB cables and never had an issue, while the power supplies of the nest boxes are outside in the garden, almost unprotected, and the USB cables to the pies are 10m long. In the past I had issues with these in regards of power quality, but not with those showing the issues now.

All those cameras have the same HW setup (those having the issue as well as those not having the issue:

Code: Select all

[email protected]:/var/log/watchdog# cat /proc/cpuinfo
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 697.95
Features        : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2708
Revision        : 000e
they are all on the latest SW, including rpi-update (did that on the weekend), but the issue was showing up before as well - Thus my guess still is it is related to either humidity or temperature and will protect one of them better to see if anything changes.

Is there any way to check voltage directly on the pi, i understand i have to use a meter for it ?

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

Re: RPi Cam Web Interface

Mon Jan 23, 2017 11:42 am

Max1968 wrote:I think in my case neither the power supply nor the "age" of my pies is the issue - The power supplies for those affected pies are inside the building with very short USB cables and never had an issue, while the power supplies of the nest boxes are outside in the garden, almost unprotected, and the USB cables to the pies are 10m long. In the past I had issues with these in regards of power quality, but not with those showing the issues now.

All those cameras have the same HW setup (those having the issue as well as those not having the issue:

Code: Select all

[email protected]:/var/log/watchdog# cat /proc/cpuinfo
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 697.95
Features        : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2708
Revision        : 000e
they are all on the latest SW, including rpi-update (did that on the weekend), but the issue was showing up before as well - Thus my guess still is it is related to either humidity or temperature and will protect one of them better to see if anything changes.

Is there any way to check voltage directly on the pi, i understand i have to use a meter for it ?
I would first do a

Code: Select all

sudo rpi-update af9cb14d5053f89857225bd18d1df59a089c171e
Anything after that will cause problems on anything other than Pi3 or recent Pi2. (under investigation).

Voltages on the Pi can be checked either on the GPIO connector or there are test pads on the board. Another method is to check the voltage coming out of the USB ports. I use a little USB volt/current meter for a quick check. http://www.ebay.co.uk/itm/USB-Charger-D ... SwFnFWBTEL

Max1968
Posts: 11
Joined: Fri Jul 24, 2015 6:24 am

Re: RPi Cam Web Interface

Mon Jan 23, 2017 1:01 pm

Of course you are right, and I have to apologize - I did the rpi-upgrade to the version you recommended, and for now at least these messages in the log file are gone. Will take a closer look at it during the next days, but it seems you solved my issue. Thx !

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

Re: RPi Cam Web Interface

Tue Jan 24, 2017 12:54 pm

rpdom wrote:
Gary Littlemore wrote:I've just done a fresh install using Jessie Lite, I was on Wheesy before and now I'm not able to SSH on to the Pi. Anyone got any ideas why?
SSH isn't enabled by default on the latest Raspbian for security reasons. You can enable it by creating a file in the /boot partition called "ssh" (with no extension), then rebooting.
Thanks for your reply, Is anyone able to tell me the command needed to create the SSH file in the correct location please?
3b+, 2b, b+, b, Zero & Zero-W

User avatar
DougieLawson
Posts: 36904
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: RPi Cam Web Interface

Tue Jan 24, 2017 1:46 pm

On linux (assuming /dev/mmcblk0p1 (or /dev/mmcblk0p5 for NOOBS) is mounted as /boot)
sudo touch /boot/ssh

On windows (assuming the SDCard appears as F:\ when you insert it)
echo "" > f:\ssh
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

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

Re: RPi Cam Web Interface

Tue Jan 24, 2017 2:52 pm

Max1968 wrote:Of course you are right, and I have to apologize - I did the rpi-upgrade to the version you recommended, and for now at least these messages in the log file are gone. Will take a closer look at it during the next days, but it seems you solved my issue. Thx !
I have been checking further into rpi-update issue on older Pis (with help from 6by9 and popcornmix-thanks). The issue was traced down to a change introduced to minimise fragmentation in the videoencoder processing. Although not yet fully resolved the problem can be avoided by setting a parameter to turn this minimise processing off.

I have modified the raspimjpeg pprocess and added a raspimjpeg config variable in the latest version (6.2.27) to do this. It defaults to minimise off and with this I am running a Pi Zero with the latest rpi-update without any issues.

Note this problem only occurred on older architecture Pis and only if a recent rpi-update was done.

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

Re: RPi Cam Web Interface

Tue Jan 24, 2017 10:31 pm

DougieLawson wrote:On linux (assuming /dev/mmcblk0p1 (or /dev/mmcblk0p5 for NOOBS) is mounted as /boot)
sudo touch /boot/ssh

On windows (assuming the SDCard appears as F:\ when you insert it)
echo "" > f:\ssh
Hi Dougie, I'm running the Jessie Lite image, not via NOOBS
3b+, 2b, b+, b, Zero & Zero-W

vin100
Posts: 11
Joined: Tue Jan 24, 2017 10:58 pm

Re: RPi Cam Web Interface

Tue Jan 24, 2017 11:08 pm

Hello,

I installed rpi cam Web Interface but I do not manage to convert my photos in a video ( timelapse)
I selected well the photo with the timelapse, then start convert but there is nothing.
It is written busy... and "The requested URL /media/tl_0004_0001_20170124_233847.mp4 was not found on this server."
To what is of use the order start convert ?

Pi3
Jessie Lite
Rpi cam v6.2.27

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

Re: RPi Cam Web Interface

Wed Jan 25, 2017 9:28 am

vin100 wrote:Hello,

I installed rpi cam Web Interface but I do not manage to convert my photos in a video ( timelapse)
I selected well the photo with the timelapse, then start convert but there is nothing.
It is written busy... and "The requested URL /media/tl_0004_0001_20170124_233847.mp4 was not found on this server."
To what is of use the order start convert ?

Pi3
Jessie Lite
Rpi cam v6.2.27
The time lapse converter now uses gstreamer to do the work which utilises the GPU and makes it very fast.

All the necessary components are included in a full Jessie image but not in Jessie Lite. The camera install adds on the extra gstreamer-tools package but not the base gstreamer s/w which is quite a lot of stuff.

There are a few options here.
a) Install gstreamer onto Jessie Lite. I have done this and it then works, but I now normally use method c)
b) Use full Jessie
c) Use full Jessie and remove the major unnecessary components. This gets it back to a lower footprint like Lite. This is covered in the wiki 'Installation tips'

In addition because the conversion uses the GPU the image format needs to be compatible with the GPU conversion processing. Full static image resolution conversion will not work but resolutions up to 1920 x 1080 will. If you wish to use higher resolution formats then I suggest downloading the image set for external conversion.

vin100
Posts: 11
Joined: Tue Jan 24, 2017 10:58 pm

Re: RPi Cam Web Interface

Wed Jan 25, 2017 10:35 am

Ok Thanks

But the Gstreamer software is independent from the Rpi Cam Web interface ?
I am going to try to install this software with lite Jessie...

"Full static image resolution conversion will not work but resolutions up to 1920 x 1080 will. If you wish to use higher resolution formats then I suggest downloading the image set for external conversion."
Which software recommend me you to assemble photos ?


Thanks
Vince

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

Re: RPi Cam Web Interface

Wed Jan 25, 2017 11:43 am

vin100 wrote:Ok Thanks

But the Gstreamer software is independent from the Rpi Cam Web interface ?
I am going to try to install this software with lite Jessie...

"Full static image resolution conversion will not work but resolutions up to 1920 x 1080 will. If you wish to use higher resolution formats then I suggest downloading the image set for external conversion."
Which software recommend me you to assemble photos ?


Thanks
Vince
Yes. GStreamer is a separate package. RPi Cam Web Interface only uses it for performing time lapse conversion.

There are lots of tools to turn a sequence of images into a video. There are some that are totally dedicated to that and some more general purpose video editing programs that can do that. One can also install a coded library like ffmpeg and run it from a command line.

Check out
http://timelapseblog.com/2009/08/04/usi ... ime-lapse/

http://mahugh.com/2015/04/29/creating-t ... se-videos/

vin100
Posts: 11
Joined: Tue Jan 24, 2017 10:58 pm

Re: RPi Cam Web Interface

Wed Jan 25, 2017 10:51 pm

I installed gstreamer-tools but also mpv, libav-tools
I launched a timelapse in rpi cam web interface, I dowloaded the photos (.rar).
I renamed the pictures: tl_001.jpg tl_002.jpg tl_003.jpg ...
I do not know if I need to change the destination folder (/ home / pi / timelapse /) in the Rpi WebCamInterface?
After I do not know what to do ...

Is it necessary to use this command with avconv: avconv -i filename_% 03d.jpg -r 10 -qscale 1 timelapse.mp4 ??? Or gstreamer-tools?

Sorry I started with my raspberry

thank you again for your help

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

Re: RPi Cam Web Interface

Thu Jan 26, 2017 12:01 pm

vin100 wrote:I installed gstreamer-tools but also mpv, libav-tools
I launched a timelapse in rpi cam web interface, I dowloaded the photos (.rar).
I renamed the pictures: tl_001.jpg tl_002.jpg tl_003.jpg ...
I do not know if I need to change the destination folder (/ home / pi / timelapse /) in the Rpi WebCamInterface?
After I do not know what to do ...

Is it necessary to use this command with avconv: avconv -i filename_% 03d.jpg -r 10 -qscale 1 timelapse.mp4 ??? Or gstreamer-tools?

Sorry I started with my raspberry

thank you again for your help
On Jessie Lite you need to install the full gstreamer package not just the tools. I think it is

Code: Select all

sudo apt-get gstreamer1.0
It takes a while to install.

The conversion is just done from the web interface by clicking the time lapse thumbnail then pushing 'Start convert'

This renames the files into their own folder and runs the gstreamer convert process. This produces a mp4 video which will appear in the download list. It may show as busy to start with whilst the conversion takes place.

The command line for the conversion is there to allow the parameters to be changed if required but the default will be Ok for most purposes.

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

Re: RPi Cam Web Interface

Thu Jan 26, 2017 12:36 pm

Gary Littlemore wrote:
DougieLawson wrote:On linux (assuming /dev/mmcblk0p1 (or /dev/mmcblk0p5 for NOOBS) is mounted as /boot)
sudo touch /boot/ssh

On windows (assuming the SDCard appears as F:\ when you insert it)
echo "" > f:\ssh
Hi Dougie, I'm running the Jessie Lite image, not via NOOBS
Robert are you able to tell me the command line needed to get the SSH working with Jessie Lite?
3b+, 2b, b+, b, Zero & Zero-W

vin100
Posts: 11
Joined: Tue Jan 24, 2017 10:58 pm

Re: RPi Cam Web Interface

Thu Jan 26, 2017 1:46 pm

Hi btidey,

I Installed gstreamer1.0. OK
I do a timelapse, when I press start convert, it converts well, but I do not have the video (format problem or MIME type was found)

Thanks

User avatar
DougieLawson
Posts: 36904
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: RPi Cam Web Interface

Thu Jan 26, 2017 2:40 pm

sudo update-rc.d enable ssh
or
sudo systemctl enable ssh
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

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

Re: RPi Cam Web Interface

Fri Jan 27, 2017 11:33 am

vin100 wrote:Hi btidey,

I Installed gstreamer1.0. OK
I do a timelapse, when I press start convert, it converts well, but I do not have the video (format problem or MIME type was found)

Thanks
After the conversion completes successfully there should be a new thumbnail jpg and .mp4 file in the media folder. Are you getting those?

As an example with a time lapse sequence captured I have a thumbnail file for the time lapse called
tl_0000_0001_20170127_112856.jpg.t0000.th.jpg
together with a set of associated images.

After conversion I have a video and thumbnail called
tl_0000_0001_20170127_112856.mp4
tl_0000_0001_20170127_112856.mp4.v0000.th.jpg

Also make sure your still image format is compatible. For example, start with 1296 x 972

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

Re: RPi Cam Web Interface

Fri Jan 27, 2017 1:37 pm

DougieLawson wrote:sudo update-rc.d enable ssh
or
sudo systemctl enable ssh
I'm assuming this post is regarding my SSH issue, thanks Dougie.
3b+, 2b, b+, b, Zero & Zero-W

vin100
Posts: 11
Joined: Tue Jan 24, 2017 10:58 pm

Re: RPi Cam Web Interface

Fri Jan 27, 2017 3:25 pm

btidey wrote:
vin100 wrote:Hi btidey,

I Installed gstreamer1.0. OK
I do a timelapse, when I press start convert, it converts well, but I do not have the video (format problem or MIME type was found)

Thanks
After the conversion completes successfully there should be a new thumbnail jpg and .mp4 file in the media folder. Are you getting those?

As an example with a time lapse sequence captured I have a thumbnail file for the time lapse called
tl_0000_0001_20170127_112856.jpg.t0000.th.jpg
together with a set of associated images.

After conversion I have a video and thumbnail called
tl_0000_0001_20170127_112856.mp4
tl_0000_0001_20170127_112856.mp4.v0000.th.jpg

Also make sure your still image format is compatible. For example, start with 1296 x 972

369/5000
I have a .mp4 file (after conversion with start convert) in "Download video and images" tl_0000_0001_20170126_151903.mp4

My photos of the timelapse are named as (tl_0000_0001_20170126_151903.jpg) I get a .rar file

After conversion I do not have this Tl_0000_0001_20170127_112856.mp4.v0000.th.jpg

I tried in 1296 x 972 ... It does not work

Thanks

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

Re: RPi Cam Web Interface

Fri Jan 27, 2017 3:48 pm

vin100 wrote:

369/5000
I have a .mp4 file (after conversion with start convert) in "Download video and images" tl_0000_0001_20170126_151903.mp4

My photos of the timelapse are named as (tl_0000_0001_20170126_151903.jpg) I get a .rar file

After conversion I do not have this Tl_0000_0001_20170127_112856.mp4.v0000.th.jpg

I tried in 1296 x 972 ... It does not work

Thanks
What is 369/5000? Is your sequence 5000 images?
I don't understand the reference to a .rar file?

Before installing gstreamer it is best to make sure system is up to date. So I would recommend the sequence

Code: Select all

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install gstreamer1.0
It should be fine just to do that again to make sure everything is in sync.

I don't understand how you get an mp4 file but not a corresponding thumbnail if running it from the Start convert button.

Could you try with a small sequence of say 50 images? I have successfully converted sequences with thousands of mages but it is good to test with small ones to start with.

vin100
Posts: 11
Joined: Tue Jan 24, 2017 10:58 pm

Re: RPi Cam Web Interface

Fri Jan 27, 2017 5:24 pm

Sorry 369/5000 it's nothing, it's a mistake.

1- I uninstall gstreamer1.0 (sudo apt-get autoremove gstreamer1.0)
2- Then:
Sudo apt-get update
Sudo apt-get upgrade
Sudo apt-get install gstreamer1.0
Sudo reboot

I have 2 thumbnails: one corresponding to the pictures of the timelapse (.jpeg), if I click on this thumbnail I can do a download, and I get a .rar file with all my photos .jpeg
And the other corresponding to the result after the "start convert" .mp4
That's all

I will start a sequence again:
Resolutions: Max view 972p 4: 3 1296x972 pxl video fps: 25 recording x 25 boxing image resolution: 2592x1944 px
Timelapse interval 2 sec

vin100
Posts: 11
Joined: Tue Jan 24, 2017 10:58 pm

Re: RPi Cam Web Interface

Fri Jan 27, 2017 5:33 pm

When I click on the .jpg thumbnail, there are:
Convert using:
Gst-launch-1.0 -v multifilesrc location = i_% 05d.jpg caps = \ "image / jpeg, framerate = \ (fraction \) 30/1 \"! Jpegdec! Tail! Videoscale! Video / x-raw! Tail! Omxh264enc target-bitrate = 15000000 control-rate = variable! Video / x-h264, profile = high! H264parse! Mp4mux! Filesink location =

Return to “Camera board”