CharlyDelta
Posts: 99
Joined: Thu Jul 18, 2013 4:04 am
Location: Montreal

Re: RPi Cam Web Interface

Sat Jun 23, 2018 5:39 pm

Hello...

Now, I have removed timelaps start, motion detection start and stop camera buttons but the button ''record video start'' does not show ''stop'' even the video is running.
I have to refresh the page to get the stop show up in the button.

Image

here's the code before I removed the buttons, and then:

Code: Select all

     </div>
         </div>
      </div>
          <?php simple_button(); ?>
      <div class="container-fluid text-center liveimage">
         <div><img id="mjpeg_dest" <?php echo getLoadClass() . getImgWidth();?>
                 <?php if(file_exists("pipan_on")) echo "ontouchstart=\"pipan_start()\""; ?> onclick="toggle_fullscreen(this);" src="./loading.jpg"></div>
         <div id="main-buttons">
            <input id="shutdown_button" type="button" value="shutdown system" onclick="sys_shutdown();" class="btn btn-danger">
            <input id="video_button" type="button" class="btn btn-primary" <?php getdisplayStyle('actions', $userLevel); ?>>
            <input id="image_button" type="button" class="btn btn-primary" <?php getdisplayStyle('actions', $userLevel); ?>>
            <input id="timelapse_button" type="button" class="btn btn-primary" <?php getdisplayStyle('actions', $userLevel); ?>>
            <input id="md_button" type="button" class="btn btn-primary" <?php getdisplayStyle('settings', $userLevel); ?>>
            <input id="halt_button" type="button" class="btn btn-danger" <?php getdisplayStyle('settings', $userLevel); ?>>
         </div>
      </div>
      <div id="secondary-buttons" class="container-fluid text-center">

Code: Select all

    <a class="navbar-brand" href="#"><?php echo CAM_STRING; ?></a>
            </div>
         </div>
      </div>
          <?php simple_button(); ?>
      <div class="container-fluid text-center liveimage">
         <div><img id="mjpeg_dest" <?php echo getLoadClass() . getImgWidth();?>
                 <?php if(file_exists("pipan_on")) echo "ontouchstart=\"pipan_start()\""; ?> onclick="toggle_fullscreen(this);" src="./loading.jpg"></div>
         <div id="main-buttons">
            <input id="shutdown_button" type="button" value="shutdown system" onclick="sys_shutdown();" class="btn btn-danger">
            <input id="video_button" type="button" class="btn btn-primary" <?php getdisplayStyle('actions', $userLevel); ?>>
            <input id="image_button" type="button" class="btn btn-primary" <?php getdisplayStyle('actions', $userLevel); ?>>
         </div>
      </div>
      <div id="secondary-buttons" class="container-fluid text-center">
thanks for the help

Call-151
Posts: 5
Joined: Sun Jun 24, 2018 1:12 pm

Re: RPi Cam Web Interface

Sun Jun 24, 2018 1:16 pm

Hello

I would like the motion detection to start at boot.
So far, no luck.
I think I need the md = 1 but where would be the place to do it (and how :-)
Thank you

takanori
Posts: 1
Joined: Mon Jun 25, 2018 7:09 am

Re: RPi Cam Web Interface

Mon Jun 25, 2018 7:15 am

Hello and thanks for this great software.

I've ran into a problem, however. Since I'm recording to a network share, I've decided to go with external boxing since unlike my RPi, the NAS host has plenty of spare CPU power. I had a script running from cron every 30 mins (modified version of the one from the wiki, which checks for files pending for boxing). It all worked really well, until it stopped :) The automatic purge stopped working. I've read that it removes the video files based on their thumbnails, but for some time the thumbnails are automatically deleted after the h264 file is done saving.

Any pointers please?

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

Re: RPi Cam Web Interface

Mon Jun 25, 2018 8:19 am

CharlyDelta wrote:
Sat Jun 23, 2018 5:39 pm
Hello...

Now, I have removed timelaps start, motion detection start and stop camera buttons but the button ''record video start'' does not show ''stop'' even the video is running.
I have to refresh the page to get the stop show up in the button.

here's the code before I removed the buttons, and then:


thanks for the help
A function in the javascript is trying to maintain the state of all the buttons. So when you remove some of them then the function encounters an error and therefore fails to maintain even the remaining ones.

You have two choices. Either remove the bits in script.js that maintain the removed buttons, or leave the button references in index.php and hide them instead.

I would do the second option. The buttons can already be hidden according to userlevel so instead force the userlevel to be minimum on those buttons you don't want to see.

e.g.

Code: Select all

            <input id="timelapse_button" type="button" class="btn btn-primary" <?php getdisplayStyle('actions', '0'); ?>>

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

Re: RPi Cam Web Interface

Mon Jun 25, 2018 8:27 am

Call-151 wrote:
Sun Jun 24, 2018 1:16 pm
Hello

I would like the motion detection to start at boot.
So far, no luck.
I think I need the md = 1 but where would be the place to do it (and how :-)
Thank you
Best way is to set in the scheduler settings for the period start to contain an md 1 command. This will be executed on start up in All Day mode.

If you have multiple period starts because you are using Sun based or Fixed Time scheduling then you can control which periods have motion detection running by using a md 1 in the period starts where you want motion detection on and md 0 in those where you want to turn it off. On boot up the appropriate period start command will be executed.

You can alternatively edit the /etc/raspimjpeg config file so that it has motion_detection true instead of motion_detection false

Call-151
Posts: 5
Joined: Sun Jun 24, 2018 1:12 pm

Re: RPi Cam Web Interface

Mon Jun 25, 2018 3:13 pm

btidey wrote:
Mon Jun 25, 2018 8:27 am
Best way is to set in the scheduler settings for the period start to contain an md 1 command. This will be executed on start up in All Day mode.
I did tried that, I put md 1 in motion start, in all day mode, save setting, reboot, but it does not seems to work.
I have setup two email alert, one that send the preview and one that send the video. If I put the ca 1, and click on start motion detection, it work well. but if I put md 1 nothing happen, and the index.php webpage, the button stay at motion detection start, instead of displaying motion detection stop, and even if I start it manually, the button does change

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

Re: RPi Cam Web Interface

Mon Jun 25, 2018 4:36 pm

Call-151 wrote:
Mon Jun 25, 2018 3:13 pm
btidey wrote:
Mon Jun 25, 2018 8:27 am
Best way is to set in the scheduler settings for the period start to contain an md 1 command. This will be executed on start up in All Day mode.
I did tried that, I put md 1 in motion start, in all day mode, save setting, reboot, but it does not seems to work.
I have setup two email alert, one that send the preview and one that send the video. If I put the ca 1, and click on start motion detection, it work well. but if I put md 1 nothing happen, and the index.php webpage, the button stay at motion detection start, instead of displaying motion detection stop, and even if I start it manually, the button does change
I have just tried this and it works for me. Went into scheduler, added md 1 to Period Start in All Day and did a Save Settings. The save causes the scheduler to recheck the period and it then executed the md 1 and motion detection was started with button changed to Stop. Scheduler Log showed

Code: Select all

[2018/06/25 17:29:19] Saved schedule settings
[2018/06/25 17:29:19] Send Schedule reset
[2018/06/25 17:29:19] Reload parameters command requested
[2018/06/25 17:29:19] Scheduler loop is started
[2018/06/25 17:29:20] New period detected 0
[2018/06/25 17:29:20] Send md 1
{2018/06/25 17:29:20} Internal motion detection started
{2018/06/25 17:29:20} recommended video buffer size 65536
Check your scheduler log. If you can't resolve it then zip your scheduler settings (/var/www/html/schedule.json) and post here so it can be checked.

Call-151
Posts: 5
Joined: Sun Jun 24, 2018 1:12 pm

Re: RPi Cam Web Interface

Mon Jun 25, 2018 5:41 pm

btidey wrote:
Mon Jun 25, 2018 4:36 pm
Call-151 wrote:
Mon Jun 25, 2018 3:13 pm
btidey wrote:
Mon Jun 25, 2018 8:27 am
Best way is to set in the scheduler settings for the period start to contain an md 1 command. This will be executed on start up in All Day mode.
I did tried that, I put md 1 in motion start, in all day mode, save setting, reboot, but it does not seems to work.
I have setup two email alert, one that send the preview and one that send the video. If I put the ca 1, and click on start motion detection, it work well. but if I put md 1 nothing happen, and the index.php webpage, the button stay at motion detection start, instead of displaying motion detection stop, and even if I start it manually, the button does change
I have just tried this and it works for me. Went into scheduler, added md 1 to Period Start in All Day and did a Save Settings. The save causes the scheduler to recheck the period and it then executed the md 1 and motion detection was started with button changed to Stop. Scheduler Log showed

Code: Select all

[2018/06/25 17:29:19] Saved schedule settings
[2018/06/25 17:29:19] Send Schedule reset
[2018/06/25 17:29:19] Reload parameters command requested
[2018/06/25 17:29:19] Scheduler loop is started
[2018/06/25 17:29:20] New period detected 0
[2018/06/25 17:29:20] Send md 1
{2018/06/25 17:29:20} Internal motion detection started
{2018/06/25 17:29:20} recommended video buffer size 65536
Check your scheduler log. If you can't resolve it then zip your scheduler settings (/var/www/html/schedule.json) and post here so it can be checked.

if I put md 1 into Motion Start I dont get your "Send md 1" ?

Code: Select all

[2018/06/25 12:29:05] Saved schedule settings
[2018/06/25 12:29:05] Send Schedule reset
[2018/06/25 12:29:05] Reload parameters command requested
[2018/06/25 12:29:05] Scheduler loop is started
[2018/06/25 12:29:06] New period detected 0
[2018/06/25 12:29:06] Scheduled management tasks. Next at 1529951346
Attachments
schedule.json.zip
(1.73 KiB) Downloaded 25 times

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

Re: RPi Cam Web Interface

Mon Jun 25, 2018 8:34 pm

Call-151 wrote:
Mon Jun 25, 2018 5:41 pm

if I put md 1 into Motion Start I dont get your "Send md 1" ?

Code: Select all

[2018/06/25 12:29:05] Saved schedule settings
[2018/06/25 12:29:05] Send Schedule reset
[2018/06/25 12:29:05] Reload parameters command requested
[2018/06/25 12:29:05] Scheduler loop is started
[2018/06/25 12:29:06] New period detected 0
[2018/06/25 12:29:06] Scheduled management tasks. Next at 1529951346
Your schedule.json does not have a md 1 in the All Day Period Start setting.

It looks like you have put the md 1 in the Motion Start column.

Each time period has three columns

Motion_Start is what happens when a motion detection event occurs. Typically this would have ca 1 to start video recording
Motion_Stop is what happens when motion detection finished occurs. Typically this would have a ca 0 to stop video recording
Period Start is what happens when a new time period is detected

For All Day mode whatever is in its Period Start gets executed. So putting a md 1 in there will start the motion detection support.

Call-151
Posts: 5
Joined: Sun Jun 24, 2018 1:12 pm

Re: RPi Cam Web Interface

Mon Jun 25, 2018 10:02 pm

btidey wrote:
Mon Jun 25, 2018 8:34 pm
For All Day mode whatever is in its Period Start gets executed. So putting a md 1 in there will start the motion detection support.
:-)
never looked at this one :-) now it work !!!!!
thank you so much
I love this software
I have built a solar ebike but I live in an apartment on the third floor. I needed a way to have it a little more secure and so far, I was able to catch people playing around the bike at 2:00 am. I went to see them and they run away. So the raspberry has already paid itself :-)
https://www.flickr.com/photos/[email protected]/albums

CharlyDelta
Posts: 99
Joined: Thu Jul 18, 2013 4:04 am
Location: Montreal

Re: RPi Cam Web Interface

Wed Jun 27, 2018 1:02 pm

btidey wrote:
Mon Jun 25, 2018 8:19 am
CharlyDelta wrote:
Sat Jun 23, 2018 5:39 pm


I would do the second option. The buttons can already be hidden according to userlevel so instead force the userlevel to be minimum on those buttons you don't want to see.

e.g.

Code: Select all

            <input id="timelapse_button" type="button" class="btn btn-primary" <?php getdisplayStyle('actions', '0'); ?>>
Thank you for your help, btidey

Where can I put this code to keep ''Download video and image'' ?

Gerbrand
Posts: 5
Joined: Tue Feb 28, 2017 9:29 pm

Re: RPi Cam Web Interface & Summertime

Wed Jun 27, 2018 1:04 pm

For today Sunrise for the center of the Netherlands is given as 03:40 and Sunset: 20:26. Both are 2 hours off, the values are 5:40 and 22:26
I suppose summertime is corrected the wrong way?
Time offset is 0, current gives the right time

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

Re: RPi Cam Web Interface

Wed Jun 27, 2018 3:27 pm

CharlyDelta wrote:
Wed Jun 27, 2018 1:02 pm

Thank you for your help, btidey

Where can I put this code to keep ''Download video and image'' ?
Not sure I understand that question. If you hide the time-lapse button, for example, using that method then the Download video and image should still be visible.

If you mean you want to hide the Download button then use the same method on the line

Code: Select all

<a href="preview.php" class="btn btn-default" <?php getdisplayStyle('actions', $userLevel); ?>>Download Videos and Images</a>

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

Re: RPi Cam Web Interface & Summertime

Wed Jun 27, 2018 3:35 pm

Gerbrand wrote:
Wed Jun 27, 2018 1:04 pm
For today Sunrise for the center of the Netherlands is given as 03:40 and Sunset: 20:26. Both are 2 hours off, the values are 5:40 and 22:26
I suppose summertime is corrected the wrong way?
Time offset is 0, current gives the right time
To get timing right you must first have the Raspberry time zone set up correctly in sudo raspi-config

Then in the schedule set up you can put the offset from UTC in but it is best to put in the time zone specifier string as in

http://php.net/manual/en/timezones.php

So Europe/Amsterdam should be OK

Gerbrand
Posts: 5
Joined: Tue Feb 28, 2017 9:29 pm

Re: RPi Cam Web Interface

Wed Jun 27, 2018 3:53 pm

Seting Europe/Amsterdam for localisation is always my third step after setting a password and hostname.
Time of the clock on the homescreen and everywhere else in the system and filesystem are as expected.

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

Re: RPi Cam Web Interface

Wed Jun 27, 2018 6:04 pm

Gerbrand wrote:
Wed Jun 27, 2018 3:53 pm
Seting Europe/Amsterdam for localisation is always my third step after setting a password and hostname.
Time of the clock on the homescreen and everywhere else in the system and filesystem are as expected.
I meant put Europe/Amsterdam into the time offset in the scheduler. It accepts time zone names as well as numeric values.

Gerbrand
Posts: 5
Joined: Tue Feb 28, 2017 9:29 pm

Re: RPi Cam Web Interface

Wed Jun 27, 2018 6:54 pm

GMTOffset = Europe/Amsterdam

that's the right way to do it!

CharlyDelta
Posts: 99
Joined: Thu Jul 18, 2013 4:04 am
Location: Montreal

Re: RPi Cam Web Interface

Wed Jun 27, 2018 11:27 pm

CharlyDelta wrote:
Wed Jun 27, 2018 1:02 pm
btidey wrote:
Mon Jun 25, 2018 8:19 am
CharlyDelta wrote:
Sat Jun 23, 2018 5:39 pm


Where can I put this code to keep ''Download video and image'' ?
Sorry, my error... everything fine now !!

Tnx

CharlyDelta
Posts: 99
Joined: Thu Jul 18, 2013 4:04 am
Location: Montreal

Re: RPi Cam Web Interface

Sun Jul 01, 2018 2:10 am

Hello..

Something I can't understand..

PurgeSpace_ModeEx-- Select Mode--- Max usage % PurgeSpace_Level --- 40

Used:60.5% Total:14441(MB)


Is there anything else that needs to change for this to take effect?

Tnx

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

Re: RPi Cam Web Interface

Sun Jul 01, 2018 10:55 am

CharlyDelta wrote:
Sun Jul 01, 2018 2:10 am
Hello..

Something I can't understand..

PurgeSpace_ModeEx-- Select Mode--- Max usage % PurgeSpace_Level --- 40

Used:60.5% Total:14441(MB)


Is there anything else that needs to change for this to take effect?

Tnx
Purge is a scheduled activity which runs every Management_Interval (default 3600 once per hour).

The purge first checks whether there are any captures older than the Purge(Video,Image,Lapse)_Hours settings and removes them. 0 means no time limit. This provides a way of getting rid of old stuff even if there is space available.

Then it uses the PurgeSpace_ModeEx setting to maintain the usage / space level.

Note that if using Max_Usage or Max_GB setting then this is the total space used by software plus recordings so should be set above the background software level otherwise all captures will get purged.

For min_space %. It will then purge from oldest capture until there is just that minimum % space (from the overall volume capacity) free.

You should see this activity in the scheduler log at each management interval. If there is nothing to be purged because space is OK then no activity gets logged.

I use the Min % method myself on all my cameras and haven't had to manually delete a file in years.

CharlyDelta
Posts: 99
Joined: Thu Jul 18, 2013 4:04 am
Location: Montreal

Re: RPi Cam Web Interface

Tue Jul 03, 2018 6:39 pm

Hello..

is there any way to change the color of the buttons when they change status?

Ex: turn yellow when "record video start" becomes "record video stop''

Thank you for all the help you give us

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

Re: RPi Cam Web Interface

Tue Jul 03, 2018 8:02 pm

CharlyDelta wrote:
Tue Jul 03, 2018 6:39 pm
Hello..

is there any way to change the color of the buttons when they change status?

Ex: turn yellow when "record video start" becomes "record video stop''

Thank you for all the help you give us
This should be possible.

The script.js parses the state of the buttons and changes labels as required. I think the style could be set the colour at that point.

I'll check that out further.

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

Re: RPi Cam Web Interface

Tue Jul 03, 2018 9:42 pm

I have made the image, timelapse, motion detection and video buttons change colour when active.

This is in latest 6.4.23

RDPUser
Posts: 72
Joined: Tue Jan 30, 2018 12:18 pm

Re: RPi Cam Web Interface

Thu Jul 05, 2018 2:16 pm

Somehow my messages seems to be overseen, so I try again:
Normally there is an h264 video file created. To play it smoothly with the right fps it needs an container like mp4 or mkv. For that purpose MP4-Box option is included. However there are some cautions mentioned in the manual. To better understand:

When is MP4 Box executed? After Record video stop? This would mean after stopping recording video there is high load on the SD-Card and perhaps the CPU.
Or is it always running in background? In case of sudden powercut the MP4-Video would exist and would be playable. So it is save using this option default?

Thanks for telling about the MP4-Box option.

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

Re: RPi Cam Web Interface

Thu Jul 05, 2018 7:38 pm

RDPUser wrote:
Thu Jul 05, 2018 2:16 pm
Somehow my messages seems to be overseen, so I try again:
Normally there is an h264 video file created. To play it smoothly with the right fps it needs an container like mp4 or mkv. For that purpose MP4-Box option is included. However there are some cautions mentioned in the manual. To better understand:

When is MP4 Box executed? After Record video stop? This would mean after stopping recording video there is high load on the SD-Card and perhaps the CPU.
Or is it always running in background? In case of sudden powercut the MP4-Video would exist and would be playable. So it is save using this option default?

Thanks for telling about the MP4-Box option.
Sorry. I missed this one first time around.

The camera subsystem naturally produces h264 files which are not browser friendly. The MP4Box is a separate utility that can convert h264 files to mp4 format.

The settings allow 2 options MP4Box off and MP4Box background.

When Off is selected then no MP4Box is performed and the files are left in their .h264 state. They are not directly viewable from the browser and this option is primarily for advanced users who wish to either use h26 files for other purposes or who wish to do the conversion completely off line.

When background is selected then when a video recording completes then a task to perform the MP4Box conversion is added to a background queue which can hold up to 32 pending conversions. The software is continuously checking this queue and will initiate a new conversion if none is already taking place. As soon as one completes then a new one is started if there is one to do. This way only one conversion is done at a time (they can be quite memory intensive) but they do not impact on the ability to start a new recording as soon as one completes. In practice the conversion is pretty quick and the queue will rarely have more than one item.

Some time back there was a 3rd option where the MP4Box was done synchronously after a recording completed but this did impact on the ability to start a new recording quickly so this option was removed.

Because the conversion is done in the background then there is a possibility that a completed recording in h264 format will be outstanding when power is removed but this should be rare and of course a recording in progress when power is removed would also have problems.

Return to “Camera board”