]> www.vanbest.org Git - motioneye-debian/commitdiff
added support for minimum motion frames
authorCalin Crisan <ccrisan@gmail.com>
Sun, 7 Dec 2014 16:27:54 +0000 (18:27 +0200)
committerCalin Crisan <ccrisan@gmail.com>
Sun, 7 Dec 2014 16:27:54 +0000 (18:27 +0200)
src/config.py
static/js/main.js
templates/main.html

index aaa1554668b5c55d13d0103029b7e2033b040383..d15ff29f673d1530a792cb14b1e58b0dcb63b9e2 100644 (file)
@@ -555,6 +555,7 @@ def camera_ui_to_dict(ui):
         'event_gap': int(ui['event_gap']),
         'pre_capture': int(ui['pre_capture']),
         'post_capture': int(ui['post_capture']),
+        'minimum_motion_frames': int(ui['minimum_motion_frames']),
         
         # movies
         'ffmpeg_output_movies': ui['motion_movies'],
@@ -810,6 +811,7 @@ def camera_dict_to_ui(data):
         'event_gap': int(data['event_gap']),
         'pre_capture': int(data['pre_capture']),
         'post_capture': int(data['post_capture']),
+        'minimum_motion_frames': int(data['minimum_motion_frames']),
         
         # motion movies
         'motion_movies': data['ffmpeg_output_movies'],
@@ -1323,6 +1325,7 @@ def _set_default_motion_camera(camera_id, data, old_motion=False):
     
     data.setdefault('pre_capture', 2)
     data.setdefault('post_capture', 4)
+    data.setdefault('minimum_motion_frames', 1)
     
     if old_motion:
         data.setdefault('output_normal', False)
index 632f1902f1c0f01f31a7cd81d1319629dcb735fc..d9e8c524d106c7144a1ce5c9927dff33939bab66 100644 (file)
@@ -282,6 +282,7 @@ function initUI() {
     makeNumberValidator($('#eventGapEntry'), 1, 86400, false, false, true);
     makeNumberValidator($('#preCaptureEntry'), 0, 100, false, false, true);
     makeNumberValidator($('#postCaptureEntry'), 0, 100, false, false, true);
+    makeNumberValidator($('#minimumMotionFramesEntry'), 1, 1000, false, false, true);
     makeNumberValidator($('#smtpPortEntry'), 1, 65535, false, false, true);
     
     /* time validators */
@@ -759,6 +760,7 @@ function cameraUi2Dict() {
         'event_gap': $('#eventGapEntry').val(),
         'pre_capture': $('#preCaptureEntry').val(),
         'post_capture': $('#postCaptureEntry').val(),
+        'minimum_motion_frames': $('#minimumMotionFramesEntry').val(),
         
         /* motion movies */
         'motion_movies': $('#motionMoviesSwitch')[0].checked,
@@ -980,6 +982,7 @@ function dict2CameraUi(dict) {
     $('#eventGapEntry').val(dict['event_gap']);
     $('#preCaptureEntry').val(dict['pre_capture']);
     $('#postCaptureEntry').val(dict['post_capture']);
+    $('#minimumMotionFramesEntry').val(dict['minimum_motion_frames']);
     
     /* motion movies */
     $('#motionMoviesSwitch')[0].checked = dict['motion_movies'];
index 035c93261760d5679736a09e7b80f171b0feb049..eb70c5a06ffbcecbb9efd47c4515bed097dc72a7 100644 (file)
                         <td class="settings-item-value"><input type="text" class="number styled motion-detection" id="postCaptureEntry"><span class="settings-item-unit">frames</span></td>
                         <td><span class="help-mark" title="sets the number of frames to be captured (and included in the movie) after a motion event is detected">?</span></td>
                     </tr>
+                    <tr class="settings-item advanced-setting">
+                        <td class="settings-item-label"><span class="settings-item-label">Minimum Motion Frames</span></td>
+                        <td class="settings-item-value"><input type="text" class="number styled motion-detection" id="minimumMotionFramesEntry"><span class="settings-item-unit">frames</span></td>
+                        <td><span class="help-mark" title="sets the minimum number of successive motion frames required to start a motion event">?</span></td>
+                    </tr>
                 </table>
                 
                 <div class="settings-section-title"><input type="checkbox" class="styled section motion-movies" id="motionMoviesSwitch">Motion Movies</div>