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

Re: RPi Cam Web Interface

Fri Jul 10, 2015 12:56 pm

Just have to say, I hadn't updated since May and I'm a bit unhappy with some of the changes. For exmaple the RPi_Cam_Web_Interface_Installer.sh, is it really necessary for the menu system to pop up when we give it one of the old commands that worked? On top of that going from 5.1.7 to 6.0.2 and now I have no video again. guess I will spend time trying to figure out what is broken.

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

Re: RPi Cam Web Interface

Fri Jul 10, 2015 1:19 pm

Gary Littlemore wrote:
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?
Same as before, just leave the action (update, install, etc) off the end
./RPi_Cam_Web_Interface_Installer.sh

Note for those unfamiliar with file completion; if you just type ./RP and hit the Tab key it will find the matching script.

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

Re: RPi Cam Web Interface

Fri Jul 10, 2015 1:30 pm

rahlquist wrote:Just have to say, I hadn't updated since May and I'm a bit unhappy with some of the changes. For exmaple the RPi_Cam_Web_Interface_Installer.sh, is it really necessary for the menu system to pop up when we give it one of the old commands that worked? On top of that going from 5.1.7 to 6.0.2 and now I have no video again. guess I will spend time trying to figure out what is broken.
Sorry to hear that your update wasn't smooth. I've installed the latest on 3 systems over the last couple of days without issues (using defaults). Please share when you find a reason why video is not working so any necessary improvement can be made.

The work on the installer is in progress at the moment so still seems a bit fragmented. I think the intention to be fully graphical but with separated support for common actions like stop and start when this is complete.

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

Re: RPi Cam Web Interface

Fri Jul 10, 2015 1:57 pm

btidey wrote: Actually that's interesting about iframe dependency on network delay as silvan has a theory on cause of iframe errors and extra delays in writing h264 buffers making the problem worse would fit in with this theory.

On the process for recording and boxing, as far as the Pi is concerned it is all local files as the mount hides the fact that the files are actually somewhere else. So your steps are effectively correct but the Pi process doesn't know its a shared folder elsewhere.

The process is actually (ignoring the circular buffer)
1. Start capture command with camera MMAL
2. Open h264 file
3. Accept callbacks from the camera software each containing a buffer of h264 data and write to the file.
4. Stop capture with Camera MMAL
5. Close h264 file and queue a request to box this h264 file

Separately the foreground loop is checking the box queue and kicking off a command which converts the h264 file to mp4 and deleting the original h264. As soon as this completes the next item in the boxing queue is started if there is one.

So the capturing of the raw data to h264 is time critical, and this is where iframe errors would occur, but the boxing is not particularly time critical unless the network is too slow to allow it to keep up with captures.
Ok this explains a lot for me. My Pi camera is in an area with fringe wifi. Its not great but it does drop from time to time and other wifi loads make it hiccup on occasion. So I changed my Pi cam to save the h264 local and then used icrontab to try to push the file to my linux media server (using rsync) which would then box it and make it available on my Lan. I constantly got lots of iframe errors so that files would not play. So it seems that incron would see a pause in the writing as a close of the file and probably move the incomplete file, or interfere with the write timing. Made the whole setup pretty worthless.

This sheds some light I guess. So to may my setup work efficiently I need to find a way to detect when the file is closed without interrupting the writes. So that I can then push it to my media server. Hmmm.....

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

Re: RPi Cam Web Interface

Fri Jul 10, 2015 2:17 pm

btidey wrote: Sorry to hear that your update wasn't smooth. I've installed the latest on 3 systems over the last couple of days without issues (using defaults). Please share when you find a reason why video is not working so any necessary improvement can be made.
No need to apologize I was just being a grouch. Sorry I didn't try to fix it, I just removed the whole thing and reinstalled. That got it back to working.
The work on the installer is in progress at the moment so still seems a bit fragmented. I think the intention to be fully graphical but with separated support for common actions like stop and start when this is complete.
Ugh I hate to hear that. In the past it was a couple simple commands and no need for a gui or menu. I cant speak for anyone else but hiding things behind menu, but I would appreciate it if the .sh file would accept commands and not bother with the gui if a proper command is passed and ends without error. Sorry a bit of a command line aficionado.

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

Re: RPi Cam Web Interface

Fri Jul 10, 2015 2:23 pm

rahlquist wrote: Ok this explains a lot for me. My Pi camera is in an area with fringe wifi. Its not great but it does drop from time to time and other wifi loads make it hiccup on occasion. So I changed my Pi cam to save the h264 local and then used icrontab to try to push the file to my linux media server (using rsync) which would then box it and make it available on my Lan. I constantly got lots of iframe errors so that files would not play. So it seems that incron would see a pause in the writing as a close of the file and probably move the incomplete file, or interfere with the write timing. Made the whole setup pretty worthless.

This sheds some light I guess. So to may my setup work efficiently I need to find a way to detect when the file is closed without interrupting the writes. So that I can then push it to my media server. Hmmm.....
In the upgraded version there is now the facility to keep the capture as a local operation and then box the file to its final destination. This can help a lot with remote mounts.

There is also the facility to run job macros at the end of raw capture and at the end of boxing operations so that processes like copying a file to a remote location become much more straightforward.
Last edited by btidey on Fri Jul 10, 2015 3:47 pm, edited 1 time in total.

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

Re: RPi Cam Web Interface

Fri Jul 10, 2015 2:30 pm

rahlquist wrote:
btidey wrote: Sorry to hear that your update wasn't smooth. I've installed the latest on 3 systems over the last couple of days without issues (using defaults). Please share when you find a reason why video is not working so any necessary improvement can be made.
No need to apologize I was just being a grouch. Sorry I didn't try to fix it, I just removed the whole thing and reinstalled. That got it back to working.
The work on the installer is in progress at the moment so still seems a bit fragmented. I think the intention to be fully graphical but with separated support for common actions like stop and start when this is complete.
Ugh I hate to hear that. In the past it was a couple simple commands and no need for a gui or menu. I cant speak for anyone else but hiding things behind menu, but I would appreciate it if the .sh file would accept commands and not bother with the gui if a proper command is passed and ends without error. Sorry a bit of a command line aficionado.
The reasoning here is that the installer even without the graphics is already doing a lot more than actioning the simple commands like it did before. So it asked questions about subfolders, web-ports, security etc as otherwise a user had to fiddle around with things like apache config files and motion.conf files after completing an installation. The graphics side was just a friendlier way of asking these questions.

However, one idea even when the graphical system is in place is to provide a facility where it just operates based on the values held in the local installer config.txt file. This already holds the values entered from the previous install questions as defaults. So this would give a totally automated operation with your own installer defaults and could bypass all questions.

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

Re: RPi Cam Web Interface

Fri Jul 10, 2015 5:42 pm

btidey wrote: In the upgraded version there is now the facility to keep the capture as a local operation and then box the file to its final destination. This can help a lot with remote mounts.

There is also the facility to run job macros at the end of raw capture and at the end of boxing operations so that processes like copying a file to a remote location become much more straightforward.
I'll have to dig into that, because that's my one roadblock with using this 24/7. With the intermittent disconnects samba and to a lesser amount NFS mounts tend to get flaky and in the case of samba cifs mounts they can hang the whole shebang. Thats why I moved to NFS and Rsync. Though as I mentioned even that would screw up the files at times...

So hopefully this will work better. If I can get this knocked out then I can focus on other things like servos and lenses.

Yvo
Posts: 1
Joined: Sat Jul 11, 2015 6:46 am

Re: RPi Cam Web Interface

Sat Jul 11, 2015 6:53 am

Hi,

This is a great project.
I've been playing a while and now i'build an intercom cam.
Since the intercom installation i've re installed everything.
It's working fine but the only thing is that it will not record when motion is detected.
Recording an image is working, when i move in front of my cam motion is not detected and recorded.
What am i doing wrong?
All the setting are the same before i build the cam.
Only difference is that i changed the cam cable for a 60cm cable.
I'am recording to a nas.

Yvo

phmadeira
Posts: 8
Joined: Sat Jul 11, 2015 11:11 am

Re: RPi Cam Web Interface

Sat Jul 11, 2015 11:15 am

help
il like to make motion running but i do have this info

i do have this error :
Motion not running. Put in detection state


i have also followed this tuto to install motion
http://www.instructables.com/id/Raspber ... -software/

but still not working

any help is welcome

thank you

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

Re: RPi Cam Web Interface

Sat Jul 11, 2015 2:14 pm

Yvo wrote:Hi,

This is a great project.
I've been playing a while and now i'build an intercom cam.
Since the intercom installation i've re installed everything.
It's working fine but the only thing is that it will not record when motion is detected.
Recording an image is working, when i move in front of my cam motion is not detected and recorded.
What am i doing wrong?
All the setting are the same before i build the cam.
Only difference is that i changed the cam cable for a 60cm cable.
I'am recording to a nas.

Yvo
There are quite a few possible causes of no motion recording. If you check in the trouble shooting section of the wiki then there is a little step by step of things to check and which should help pinpoint where the issue is.

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

Re: RPi Cam Web Interface

Sat Jul 11, 2015 2:21 pm

phmadeira wrote:help
il like to make motion running but i do have this info

i do have this error :
Motion not running. Put in detection state


i have also followed this tuto to install motion
http://www.instructables.com/id/Raspber ... -software/

but still not working

any help is welcome

thank you
First you do not want to do a separate motion install. The RPi Cam installer installs motion itself and also puts a default motion config file in place with the appropriate settings. You should run the installer again to get the right motion.conf in place.

The message 'Motion not running. Put in detection state' occurs when you go into the motion settings page and the motion program is not running. This is because it needs motion to be running to get and save settings. The overall web system starts up the motion process when it wants motion detection active. If you just manually start motion detection from the main page then you should then see the table of settings when you go into motion settings.

Also check out the trouble shooting section on the wiki around motion detection.

LucidEye
Posts: 78
Joined: Sun Aug 04, 2013 2:20 pm

Re: RPi Cam Web Interface

Sat Jul 11, 2015 10:26 pm

Can someone please explain in detail how the servo min-max settings in pipan.php work?

I have pi-pan installed and setup in RPi Cam Web Interface.
I am using the Dagu pan-tilt kit... it uses the same mini servos as the pi-pan kit just with a different bracket setup.
Everything is working great, however, I do not seem to have the full range of motion in my servos.
On startup the servos reset to 0. Mine end up with the pan servo bracket parallel to the servo body, and the tilt servo pointing straight up at 90 degrees... which is what it's supposed to do according to the assembly diagram.

When I try to pan I only get about 130 degrees of rotation.
When I try to tilt I only get about 110 degrees of rotation.

When powered off I can rotate the servos by hand much farther than this before they hit their internal limit stops. So I'm assuming I can get more rotation by setting the min-max settings in pipan.php. However, I have played around with different settings and still can not seem to get my servos to travel as far as their specs say they can.

Can anyone explain how these settings work?
Also, is there any way I can decrease the speed and increment that the servos "step" in? I would like to have slower, shorter moves with each key-press in the RPi Cam Web Interface. I assume this would be done by adjusting the PWM values somewhere?
Thank you.

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

July 11 2015: MP4Box not installed?

Sun Jul 12, 2015 1:13 am

I just installed a fresh Raspbian and RPi Cam Web software, this time I opted for nginx instead of apache. Very nice install menu, by the way!

It works, BUT videos captured remain "busy" always, even though the log file shows "boxing complete". Then I noticed that MP4Box was not present on my system, even though it is fully updated today with apt-get update/upgrade and rpi-update. After I did a manual install of gpac

Code: Select all

sudo apt-get install gpac
then the RPi cam software works as expected to generate mp4 files.

Code: Select all

pi@rp27 ~ $ date
Sat Jul 11 18:15:07 PDT 2015
pi@rp27 ~ $ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@rp27 ~ $ uname -a
Linux rp27 4.0.7+ #802 PREEMPT Wed Jul 8 17:35:23 BST 2015 armv6l GNU/Linux

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

Re: July 11 2015: MP4Box not installed?

Sun Jul 12, 2015 10:34 am

jbeale wrote:I just installed a fresh Raspbian and RPi Cam Web software, this time I opted for nginx instead of apache. Very nice install menu, by the way!

It works, BUT videos captured remain "busy" always, even though the log file shows "boxing complete". Then I noticed that MP4Box was not present on my system, even though it is fully updated today with apt-get update/upgrade and rpi-update. After I did a manual install of gpac

Code: Select all

sudo apt-get install gpac
then the RPi cam software works as expected to generate mp4 files.
Thanks. It looks like motion, gpac and zip are missing from nginx install. I have added those in.

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

Re: RPi Cam Web Interface

Sun Jul 12, 2015 10:40 am

LucidEye wrote:Can someone please explain in detail how the servo min-max settings in pipan.php work?

I have pi-pan installed and setup in RPi Cam Web Interface.
I am using the Dagu pan-tilt kit... it uses the same mini servos as the pi-pan kit just with a different bracket setup.
Everything is working great, however, I do not seem to have the full range of motion in my servos.
On startup the servos reset to 0. Mine end up with the pan servo bracket parallel to the servo body, and the tilt servo pointing straight up at 90 degrees... which is what it's supposed to do according to the assembly diagram.

When I try to pan I only get about 130 degrees of rotation.
When I try to tilt I only get about 110 degrees of rotation.

When powered off I can rotate the servos by hand much farther than this before they hit their internal limit stops. So I'm assuming I can get more rotation by setting the min-max settings in pipan.php. However, I have played around with different settings and still can not seem to get my servos to travel as far as their specs say they can.

Can anyone explain how these settings work?
Also, is there any way I can decrease the speed and increment that the servos "step" in? I would like to have slower, shorter moves with each key-press in the RPi Cam Web Interface. I assume this would be done by adjusting the PWM values somewhere?
Thank you.
I am not a big expert on pipan but did include the original code into the system.

pipan.php is where the action takes place to pass commands from the web interface through. At the top of this file is

Code: Select all

  $min_pan = 60;
  $max_pan = 190;
  $min_tilt = 120;
  $max_tilt = 220;
which apply limits to values passed through. So you may want to try editing those to see if that widens the range for you.

Speed is not controlled from the web interface so you would need to look at the pipan code itself for that.

phmadeira
Posts: 8
Joined: Sat Jul 11, 2015 11:11 am

Re: RPi Cam Web Interface

Sun Jul 12, 2015 10:44 am

hello
i do have renistalled everuthin fron scrath
motion detection working good

but now , no video recording posible !!
i did have a thumbpic but no video inside

i do hace troed di change from default to mpeg strem but dorsn t make diference

picture is ok


thank you

phmadeira
Posts: 8
Joined: Sat Jul 11, 2015 11:11 am

Re: RPi Cam Web Interface

Sun Jul 12, 2015 10:53 am

i do have this but no video inside the folder just the thumb i think vi_0006_20150712_105053.mp4.v0006.th.jpg

{2015/07/12 10:51:00} Add /var/www/cam1/media/vi_0006_20150712_105053.mp4 to Box Queue at pos 20
{2015/07/12 10:51:01} Start boxing /var/www/cam1/media/vi_0006_20150712_105053.mp4.h264 to /var/www/cam1/media/vi_0006_20150712_105053.mp4 Queue pos 20
{2015/07/12 10:51:02} Finished boxing /var/www/cam1/media/vi_0006_20150712_105053.mp4 from Box Queue at pos 20

phmadeira
Posts: 8
Joined: Sat Jul 11, 2015 11:11 am

Re: RPi Cam Web Interface

Sun Jul 12, 2015 11:10 am

on the Files pages in the thumb i do have

Busy instead of the file size
2015-07-12
11:07:41

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

Re: RPi Cam Web Interface

Sun Jul 12, 2015 3:06 pm

phmadeira wrote:on the Files pages in the thumb i do have Busy instead of the file size 2015-07-12 11:07:41
I had that problem yesterday; it was because "MP4Box" was not installed on my system (sudo apt-get install gpac)
viewtopic.php?f=43&t=63276&start=2675#p787716

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

Re: RPi Cam Web Interface

Sun Jul 12, 2015 4:46 pm

jbeale wrote:
phmadeira wrote:on the Files pages in the thumb i do have Busy instead of the file size 2015-07-12 11:07:41
I had that problem yesterday; it was because "MP4Box" was not installed on my system (sudo apt-get install gpac)
viewtopic.php?f=43&t=63276&start=2675#p787716
Yes. Lack of MP4Box will behave like that. raspimjpeg launches it asynchronously and doesn't really know whether it is successful. It detects the operation is finished because the associated h264 gets deleted which will happen even if the MP4Box is not there.

I'm not sure why gpac wouldn't be there if doing an Apache install.

toadleyb
Posts: 21
Joined: Sat Jan 04, 2014 11:05 pm

Re: RPi Cam Web Interface

Sun Jul 12, 2015 8:47 pm

I have been happily running this awesome software for several months. I haven't updated in a few weeks so I decided to do an update. I ran the script with update. It asked what directory I wanted to install to. I hit enter to accept the default. It downloaded the update and then I tried to run the script with install. All I would get is a blinking cursor and it would never do anything. So I assumed maybe it didn't download correctly so I completely deleted the RPi_Cam_Web_Interface directory and then re-cloned it. I still get the same thing. I cannot run the script with any commands. I tried running install, stopping the interface, and updating and I just get a blinking cursor and I end up having to ctrl+c to stop it. I did chmod the installer to make it executable.

Any ideas?

User avatar
Lombra
Posts: 67
Joined: Tue Sep 16, 2014 12:41 am
Location: Sweden

Re: RPi Cam Web Interface

Sun Jul 12, 2015 9:07 pm

Hi,

I realised today that the preview is significantly cropped compared to captured stills. I later found out that I could remedy this by configuring raspimjpeg with a video resolution of 4:3 format, so I set it to 1600x1200. However I feel this is suboptimal. I don't really want to change the resolution of video recording, just the preview. And I don't even know whether you can record in 4:3? It's not super important, because I'm probably not going to be needing to record videos anyway, but it would be nice if it was possible to set the preview aspect ratio separately.

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

Re: RPi Cam Web Interface

Sun Jul 12, 2015 9:38 pm

toadleyb wrote:I have been happily running this awesome software for several months. I haven't updated in a few weeks so I decided to do an update. I ran the script with update. It asked what directory I wanted to install to. I hit enter to accept the default. It downloaded the update and then I tried to run the script with install. All I would get is a blinking cursor and it would never do anything. So I assumed maybe it didn't download correctly so I completely deleted the RPi_Cam_Web_Interface directory and then re-cloned it. I still get the same thing. I cannot run the script with any commands. I tried running install, stopping the interface, and updating and I just get a blinking cursor and I end up having to ctrl+c to stop it. I did chmod the installer to make it executable.

Any ideas?
Yes i know! It was my mistake sorry! I uploaded fix. After merge all is fine again. In new version script Start and Stop also possible old way (without GUI).

HOW TO FIX
1. copy you installer script (DO NOT EDIT MAIN INSTALLER OR YOU GET GIT ERROR AND ABORT)!
cp ./RPi_Cam_Web_Interface_Installer.sh ./fix.sh
2. Now edit that ./fix.sh
Find in your ./fix.sh script lines:

Code: Select all

version=$(cat $versionfile | grep "'APP_VERSION'" | cut -d "'" -f4)
backtitle="Copyright (c) 2014, Silvan Melchior. RPi Cam $version"
And comment them out

Code: Select all

#version=$(cat $versionfile | grep "'APP_VERSION'" | cut -d "'" -f4)
#backtitle="Copyright (c) 2014, Silvan Melchior. RPi Cam $version"
Now run that fix.sh and choose update option.
after update you can delete temporary fix.sh file

Very sorry!
Last edited by miraaz on Sun Jul 12, 2015 10:30 pm, edited 3 times in total.

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

Re: RPi Cam Web Interface

Sun Jul 12, 2015 9:45 pm

Lombra wrote:Hi,

I realised today that the preview is significantly cropped compared to captured stills. I later found out that I could remedy this by configuring raspimjpeg with a video resolution of 4:3 format, so I set it to 1600x1200. However I feel this is suboptimal. I don't really want to change the resolution of video recording, just the preview. And I don't even know whether you can record in 4:3? It's not super important, because I'm probably not going to be needing to record videos anyway, but it would be nice if it was possible to set the preview aspect ratio separately.
There are 3 things going on here; the video aspect ratio, the still image aspect ratio, and the preview aspect ratio. Now the preview is a continuously regenerated jpeg that is used for 3 purposes. It feeds the live video feed on the main page, it feeds the external motion detect program and it is grabbed as a thumbnail whenever a capture of any sort is being done (video or image snap).

Now as you point out if the video aspect ratio is different from the still image aspect ratio then there is a conflict. For the first 2 uses the aspect ratio of the preview jpegs has to match the video aspect ratio for it to make any sense. For the third use (thumbnails) it was a very convenient and cpu friendly way of getting that data. When I first started adding thumbnails into the software I was actually generating them from the full captured data (both video and image) using a separate conversion process but it was pretty slow. Switching to grabbing the preview made this part much more feasible. It might be possible to off-line convert just the images into thumbnails at the different aspect ratio, a bit like the Mp4Box process. So those thumbnails would get changed out as those completed.

I guess the other aspect is that if video captures were never going to be used and motion triggers were going to be used to grab stills then it would be possible to set the jpeg stream at the still image aspect ratio instead of the video.

Video recording 4:3 is entirely feasible and in fact can be desirable for many purposes. I almost always use the 4:3 format. This is because of the sensor aspect ratio which fits this. When you record at HD (16:9) you are actually using a cropped region of the sensor, whereas a video 4:3 gives you a much fuller full field of view.

Return to “Camera board”