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

Re: RPi Cam Web Interface

Sun Apr 12, 2015 6:08 pm

silvanmelchior wrote:
xab wrote:How can I build raspimjpeg?
Clone Robert's fork of the userland and run the buildme-script in it, it will replace /opt/vc/bin/raspimjpeg with the new compiled version. The source is in the repo itself in "host_applications/linux/apps/raspicam/". At the moment there are 4 relevant files:

RaspiMJPEG.h
RaspiMJPEG.c
RaspiMUtils.c
RaspiMCmds.c
RaspiMCam.c

Silvan
Yes. That is how I build, but on mine the new binaries end up by default in ~/userland/build/bin and I then replace the working copy in /opt/vc/bin which is actually on a different Pi. This is probably just a difference in install DESTINATION set up

Building on a Pi 2 is significantly faster than Pi 1 and doing repetitive builds is then fairly painless.

xab
Posts: 23
Joined: Sat Jan 24, 2015 1:24 pm

Re: RPi Cam Web Interface

Sun Apr 12, 2015 6:26 pm

Thank you for your kind guidelines. However I'm wondering whether I could use my desktop machine to cross compile this?
Currently running windows but starting up a VM shouldn't be a problem.. however setting up all the tools to cross compile might be :D. Maybe someone here has done that? Can someone give me an approximation of how long first compile and second could take? (model B) Or it doesn't matter?
On another note.. If I based my other programs on an earlier version of raspimjpeg (downloaded pre-compiled version ~January) Will everything break?

edit:
I tried downloading new compiled version, first tests went good, so I can assume that some of it will not break for sure :D
First build took around 30min.. second one took around 2-5 min
Last edited by xab on Sun Apr 12, 2015 8:28 pm, edited 2 times in total.

piecam
Posts: 84
Joined: Mon Feb 23, 2015 12:55 am

Re: RPi Cam Web Interface

Sun Apr 12, 2015 6:55 pm

btidey wrote:
It sounds like the video capture has stopped, but boxing hasn't worked plus the status file that is used to communicate back to the web code has got out of step with reality. I'm not sure how that could happen at the moment.

Assuming you are using background MPBoxing then the buttons should return to an idle status as soon as the raw recording stops and this shouldn't depend on whether boxing succeeds or fails. If you are using inline boxing then the status will be boxing until this operation completes.

Basically raspimjpeg writes it as it goes through these different states (start video, motion detect on, boxing etc) . The web code then reads it to determine how to display the buttons.

The file in question is the status_mjpeg.txt file in the /var/www folder. It just has 1 line in with values like ready, md_ready, md_video, boxing in it. When nothing is happening it should have ready or md_ready in it depending on whether motion detection is on.

So if it appears to freeze check this file. If it says video or md_video then the web will think a capture is still in progress. Similarly if it says boxing and you know MP4Box has stopped then again that would be a real problem. If either case and you know it has stopped then as a test you could edit the file to say ready or md_ready, save it and see what happens to the web interface. Do not add a line feed onto the file, it should have just a single string with no line ending. E.g. a 'ready' file will be 5 bytes long.
HI Robert,
I have again 5 out 6 pi cams got into GUI web picture feed frozen again. However, this time, simply 'stop/start' schedule didn't make it. I had to reboot the box and 'stop/start' scheduler to make it work.

It's weird that no body else experiencing this?!!

The status file I checked, has nothing in it.

thanks

0lly
Posts: 77
Joined: Sun Mar 02, 2014 5:07 pm

Re: RPi Cam Web Interface

Sun Apr 12, 2015 7:08 pm

silvanmelchior wrote:
0lly wrote:Hi silvanmelchior
Buffer only works if Video_fps = 25 ?
if i set the Video_fps to 10 it crashes.
After reboot

Code: Select all

pi@raspberrypi ~/RPi_Cam_Web_Interface $ ./RPi_Cam_Web_Interface_Installer.sh start
Started
pi@raspberrypi ~/RPi_Cam_Web_Interface $ mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
Thanks, this should be fixed in the new version
Yes works now,many Thanks. :D

silvanmelchior
Posts: 76
Joined: Mon Nov 25, 2013 5:56 pm

Re: RPi Cam Web Interface

Sun Apr 12, 2015 9:53 pm

Hello

I updated the pipan-inscructions on the wiki and changed the interface a bit, now it should be possible again to use pipan with the interface.

Some details:
- The interface allows you to control pipan with WASD-keys
- Pilight can be controlled with the F-Key or in the settings
- The color of Pilight can be controller in the settings
- Pipan can be controlled by dragging the live-preview with your finger on a touch-devise

I captured a video of pipan in action: https://www.youtube.com/watch?v=C5MwCWswKHA
Here is the installation guide: http://elinux.org/RPi-Cam-Web-Interface ... d_Pi-Light

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

Re: RPi Cam Web Interface

Sun Apr 12, 2015 10:47 pm

piecam wrote:
The status file I checked, has nothing in it.

thanks
Empty status file with nothing in it is not good. Not sure how that can happen at the moment. If you get into this state again check file length (is it zero?). Also worth trying to write ready into it just to see if interface recovers and then we can focus on how such a status file can exist.

xab
Posts: 23
Joined: Sat Jan 24, 2015 1:24 pm

Re: RPi Cam Web Interface

Mon Apr 13, 2015 4:25 am

If I wanted to link other libraries into the project (for instance wiringPi, or if wiringPi is already linked then some other library) how would I do it? My guess would be in the arm Makefile, but its huge(too advanced for me right now) and I'm not sure where/what I should add.

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

Re: RPi Cam Web Interface

Mon Apr 13, 2015 8:25 am

xab wrote:If I wanted to link other libraries into the project (for instance wiringPi, or if wiringPi is already linked then some other library) how would I do it? My guess would be in the arm Makefile, but its huge(too advanced for me right now) and I'm not sure where/what I should add.
Can I ask what you are trying to achieve here?

If you want to use GPIO pins to control things like say taking captures then that is already possible by using the pipe command interface supported by raspimjpeg. That allows, for example,a python program to do pretty much everything done by the web interface.

xab
Posts: 23
Joined: Sat Jan 24, 2015 1:24 pm

Re: RPi Cam Web Interface

Mon Apr 13, 2015 8:52 am

btidey wrote:
xab wrote:If I wanted to link other libraries into the project (for instance wiringPi, or if wiringPi is already linked then some other library) how would I do it? My guess would be in the arm Makefile, but its huge(too advanced for me right now) and I'm not sure where/what I should add.
Can I ask what you are trying to achieve here?

If you want to use GPIO pins to control things like say taking captures then that is already possible by using the pipe command interface supported by raspimjpeg. That allows, for example,a python program to do pretty much everything done by the web interface.
I'd like to link some libraries I need to the program to expand functionality, brought wiringPi just as an example of library.
What I'm currently trying to achieve is using databases with the program.

AFUDirk
Posts: 5
Joined: Wed Apr 01, 2015 9:38 am
Location: Germany
Contact: Website

Re: RPi Cam Web Interface

Mon Apr 13, 2015 9:35 am

Hallo,
wie kann ich die neue Version von RPI CAM Control installieren?
Muss ich vorher die alte Versin deinstallieren?
Welche Befehle sind erforderlich?

Ich Bin Neuling in Linux

Dirk

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

Re: RPi Cam Web Interface

Mon Apr 13, 2015 11:01 am

silvan thanks for coming back again and doing so much work to bring in the other changes folks have contributed. Any chance you will get all the updates to annotate added in? ref: viewtopic.php?f=43&t=97929&start=100

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

Re: RPi Cam Web Interface

Mon Apr 13, 2015 11:11 am

rahlquist wrote:silvan thanks for coming back again and doing so much work to bring in the other changes folks have contributed. Any chance you will get all the updates to annotate added in? ref: viewtopic.php?f=43&t=97929&start=100
I thought we had already incorporated all those changes already in the latest version, which does support V3 annotation, text sizing, custom colours. Is there something we have missed?

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

Re: RPi Cam Web Interface

Mon Apr 13, 2015 11:26 am

xab wrote: I'd like to link some libraries I need to the program to expand functionality, brought wiringPi just as an example of library.
What I'm currently trying to achieve is using databases with the program.
Short answer is the core raspimjpeg program is just a c program, so if you want to add functionality into that piece which depends on other libraries then you do it the same way you would with other c programs; include the library headers, call the library functions in the code, add the library to the link list, and make sure the library is in the library path.

That's just a stock 'c' answer. If you need something more specific to raspimjpeg or other parts of the Web interface side then I think we need more info. It maybe that functionality you are thinking of adding could be useful to others as well.

xab
Posts: 23
Joined: Sat Jan 24, 2015 1:24 pm

Re: RPi Cam Web Interface

Mon Apr 13, 2015 11:42 am

btidey wrote:
xab wrote: I'd like to link some libraries I need to the program to expand functionality, brought wiringPi just as an example of library.
What I'm currently trying to achieve is using databases with the program.
Short answer is the core raspimjpeg program is just a c program, so if you want to add functionality into that piece which depends on other libraries then you do it the same way you would with other c programs; include the library headers, call the library functions in the code, add the library to the link list, and make sure the library is in the library path.

That's just a stock 'c' answer. If you need something more specific to raspimjpeg or other parts of the Web interface side then I think we need more info. It maybe that functionality you are thinking of adding could be useful to others as well.
I think that the thing want is the part where I add library to the link list ( where is it?). Sample program has a general gcc -Wall -l/.... but since the makefiles here are more complex, I'm not sure where to put that "-l/..."
I'm going mention that I'm doing this for my BSc thesis so after I'm done with that I'll gladly share it with the community (otherwise some people might claim my work as plagiarized :shock: )

Sephiron
Posts: 13
Joined: Fri Mar 27, 2015 11:10 am

Re: RPi Cam Web Interface

Mon Apr 13, 2015 12:41 pm

2btidey
Hello. Thanks for the Update of the version, everything works now. Though as I used it there are a few new things that I noticed:
- If I change resolution when camera is recording, then the webpage starts notifying with errors after the recording has stopped and it starts video processing in background. The only way to stop those errors is to restart the system. Can it set the new resolution for example after the recording has finished processing?
- There is one irritating moment: When I start selecting from resolution-presets, there is no way to cancel it. So when I choose the dropdown menu and cancel it, then it resets to default value (1280...).
The solution I came up with: change the option for the "select option..." to set image width to 0 and height to 0 (instead of setting them to default value) and then in the handler you would update the parameters only if new width and new height aren't zero.
- Can you please re-enable the memory of last position in index.php again? Cause it is not in the latest version.

P.S. There is a small problem when accessing the site from mozilla: the number input fields are somewhat buggy and can't be selected.

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

Re: RPi Cam Web Interface

Mon Apr 13, 2015 1:29 pm

HI Robert,
I have again 5 out 6 pi cams got into GUI web picture feed frozen again. However, this time, simply 'stop/start' schedule didn't make it. I had to reboot the box and 'stop/start' scheduler to make it work.

It's weird that no body else experiencing this?!!

The status file I checked, has nothing in it.

thanks
I had this problem. I changed my overclock from 900 to 800 and my Pi has been running happily for 3 days with no more freezes.

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

Re: RPi Cam Web Interface

Mon Apr 13, 2015 2:24 pm

xab wrote: I think that the thing want is the part where I add library to the link list ( where is it?). Sample program has a general gcc -Wall -l/.... but since the makefiles here are more complex, I'm not sure where to put that "-l/..."
I'm going mention that I'm doing this for my BSc thesis so after I'm done with that I'll gladly share it with the community (otherwise some people might claim my work as plagiarized :shock: )
Try adding the library to the target_link_libraries setting for raspimjpeg in the CMakeLists.txt in the raspimjpeg directory.

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

Re: RPi Cam Web Interface

Mon Apr 13, 2015 2:29 pm

Sephiron wrote:2btidey
Hello. Thanks for the Update of the version, everything works now. Though as I used it there are a few new things that I noticed:
- If I change resolution when camera is recording, then the webpage starts notifying with errors after the recording has stopped and it starts video processing in background. The only way to stop those errors is to restart the system. Can it set the new resolution for example after the recording has finished processing?
- There is one irritating moment: When I start selecting from resolution-presets, there is no way to cancel it. So when I choose the dropdown menu and cancel it, then it resets to default value (1280...).
The solution I came up with: change the option for the "select option..." to set image width to 0 and height to 0 (instead of setting them to default value) and then in the handler you would update the parameters only if new width and new height aren't zero.
- Can you please re-enable the memory of last position in index.php again? Cause it is not in the latest version.

P.S. There is a small problem when accessing the site from mozilla: the number input fields are somewhat buggy and can't be selected.
Thanks for feedback. Controls do get fed through straight to camera. I think most are Ok in recording. Res changes may be problematic particularly with circular buffer.

On the pipan init I am already checking with silvan on that; it got removed when he did the other pipan mods and I'm not sure why. Maybe it needs to be optional if in conflict with other desired behaviour?

I'm not seeing a setting issue on my Firefox. Can you be more explicit as to which settings.

Sephiron
Posts: 13
Joined: Fri Mar 27, 2015 11:10 am

Re: RPi Cam Web Interface

Mon Apr 13, 2015 2:55 pm

btidey wrote: Thanks for feedback. Controls do get fed through straight to camera. I think most are Ok in recording. Res changes may be problematic particularly with circular buffer.
Well, it would be enough for me if it showed warning ("Warning: cannot change the resolution because recording is in progress") and would not change the resolution if the recording is in progress. I'm just not sure how to implement that. Is there an easy way to check if the video is processed in background and whether video is being recorded?
btidey wrote: On the pipan init I am already checking with silvan on that; it got removed when he did the other pipan mods and I'm not sure why. Maybe it needs to be optional if in conflict with other desired behaviour?
Well, accessing the pipan.js in that way does "crash" the script if the pipan is not installed, but if so, then there should be file named pipan_off in the folder and that part of the script shouldn't be executed.
btidey wrote: I'm not seeing a setting issue on my Firefox. Can you be more explicit as to which settings.
I am not exactly sure (tested it on another old pc), but it seemed that the fields with numbers could not be properly selected. To change the value, it had to be pasted in the field or something like that.

P.S. On a side note: what happens if raspberry starts running out of memory? Is there a way to make program erase old recordings?

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

Re: RPi Cam Web Interface

Mon Apr 13, 2015 4:14 pm

Sephiron wrote:
btidey wrote: Thanks for feedback. Controls do get fed through straight to camera. I think most are Ok in recording. Res changes may be problematic particularly with circular buffer.
Well, it would be enough for me if it showed warning ("Warning: cannot change the resolution because recording is in progress") and would not change the resolution if the recording is in progress. I'm just not sure how to implement that. Is there an easy way to check if the video is processed in background and whether video is being recorded?
btidey wrote: On the pipan init I am already checking with silvan on that; it got removed when he did the other pipan mods and I'm not sure why. Maybe it needs to be optional if in conflict with other desired behaviour?
Well, accessing the pipan.js in that way does "crash" the script if the pipan is not installed, but if so, then there should be file named pipan_off in the folder and that part of the script shouldn't be executed.
btidey wrote: I'm not seeing a setting issue on my Firefox. Can you be more explicit as to which settings.
I am not exactly sure (tested it on another old pc), but it seemed that the fields with numbers could not be properly selected. To change the value, it had to be pasted in the field or something like that.

P.S. On a side note: what happens if raspberry starts running out of memory? Is there a way to make program erase old recordings?
The web side does know whether a recording is taking place via the status file as that is what controls the main action buttons. So it might be possible to do something with that.There is no direct feedback on whether individual settings commands have worked. We will need to think a bit more about this.

pipan side being looked at.

I have just updated to the most recent Firefox and now I have the settings problem. It is being caused by incompatibilities in the css and Firefox developer shows lots of css errors. This actually applies to the other pages as well not just camera settings. In particular, the tables here are styled with a settingsTable class. If that is taken out then entry then works but the layout gets very ugly.

The scheduler does have purging of old captures to keep things under control but that is not dependent on disk memory usage.

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

Re: RPi Cam Web Interface

Mon Apr 13, 2015 5:00 pm

On the Firefox settings issue (and maybe this applies to Safari as well).

There seems to be a deprecated setting in the css that may be the issue. I made a change which seems to fix it in my Firefox but I don't want to include it just yet as I am not a css expert.

I attach in the zip a modified style_minified.css. Anybody who is having a difficulty entering settings is welcome to try by copying into /var/www/css (backup the previous one first). If it fixes it for you please report back.

Note you may have to do a forced refresh on the main page to ensure you get the updated css rather than the cached one. Normally a shift refresh will do this.
Attachments
style_minified.zip
(17.69 KiB) Downloaded 65 times

Dittie
Posts: 9
Joined: Sun Mar 29, 2015 12:57 pm

Re: RPi Cam Web Interface

Mon Apr 13, 2015 7:35 pm

silvanmelchior wrote:
Dittie wrote: This is really a nice addition! Good to have you back and glad to see you will be working on this together.
Since the movements were short in on my cam it always captured a bit to late. Now the video is actually showing the full movement.

What I did notice while reviewing the timestamps in motion started video is something like this :

Suppose a video started motion triggered with timestamp 16:30:01

16:30:01 good video
16:30:02 good video
16:30:00 blurry/still video
16:30:01 blurry/still video
16:30:02 blurry/still video
16:30:03 good video
16:30:04 good video
16:30:05 good video

It jumps back some seconds and shows blurry video those couple of seconds, after that video looks good again.
Any idea what that could be and how to fix it ? I could send you an example video if you would like to check it out.
I made some bugfixes. Could you check wheter the error is still there? And if so, could you describe me an exact scenario where the bug occurs, so that I can reproduce and try to fix the problem?

Thanks
Works like a charm now!

Sephiron
Posts: 13
Joined: Fri Mar 27, 2015 11:10 am

Re: RPi Cam Web Interface

Mon Apr 13, 2015 8:30 pm

btidey wrote: The scheduler does have purging of old captures to keep things under control but that is not dependent on disk memory usage.
Then, what happens if I just leave it running in motion detection mode? I mean I want it to work like a security camera so that when I launch it, it would continue running and recording latest videos. In a case where the memory of SD card would get filled, I want it to delete older files to make room for the new ones.
-What are the criteria for scheduler's purging of old captures?
-Is the functionality I require implemented or do I need to make some adjustments?
-What would be the best place and method to make such adjustments?

btidey and silvanmelchior thanks again for the efforts, the project is a huge help :)

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

Re: RPi Cam Web Interface

Mon Apr 13, 2015 9:53 pm

Sephiron wrote:
btidey wrote: The scheduler does have purging of old captures to keep things under control but that is not dependent on disk memory usage.
Then, what happens if I just leave it running in motion detection mode? I mean I want it to work like a security camera so that when I launch it, it would continue running and recording latest videos. In a case where the memory of SD card would get filled, I want it to delete older files to make room for the new ones.
-What are the criteria for scheduler's purging of old captures?
-Is the functionality I require implemented or do I need to make some adjustments?
-What would be the best place and method to make such adjustments?

btidey and silvanmelchior thanks again for the efforts, the project is a huge help :)
The criteria for purging is based on the 3 Purge settings for videos, images and time lapses and is all managed in the scheduler.php which is running in the background.

The current scheduler checks the media at management intervals (default every hour) and removes material that is older then the Purge limits. 0 the default means no automatic purging. Setting, for example, PurgeVideo_Hours to 98 means that videos are retained for 1 week and then removed. The thinking here was not so much memory protection, more about automating clean up of old material without having to think about it and the time limit then gives a clear retention criteria.

If we want an additional criteria based on memory usage then it would need an additional scheduler setting like 'Purge_onLowMemory' set in say MB which could still check at management intervals and would remove oldest files till free space was above the set limit. An alternative would be to set the Max memory to be used for media and then behave in a similar way to keep usage approximately below that number. Although that would need to be adjusted to suit the media requirements it may be better if external mounts is used or shared media is used between different cameras. It would also allow separate criteria for images, videos and lapses if thought desirable.

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

Re: RPi Cam Web Interface

Tue Apr 14, 2015 11:30 am

Now incorporates changes from pyjamasam (thanks) which means the main preview image is a mjpeg stream rather than image fetches.

css tweak included to hopefully resolve problem with input of settings from some browsers.

Return to “Camera board”