]> www.vanbest.org Git - motioneye-debian/commitdiff
framerate dimmer can now be set to 0 (again) and it will refresh once
authorCalin Crisan <ccrisan@gmail.com>
Sat, 9 Sep 2017 19:49:36 +0000 (22:49 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sat, 9 Sep 2017 19:49:36 +0000 (22:49 +0300)
motioneye/static/js/main.js
motioneye/templates/main.html

index a1f74520050874f13930c06931e50763d8a28a8b..dbc8452ca6c716416e68a2b3a1f956acf9bdeba7 100644 (file)
@@ -4978,20 +4978,27 @@ function refreshCameraFrames() {
         
         var count = parseInt(1000 / (refreshInterval * this.config['streaming_framerate']));
         var serverSideResize = this.config['streaming_server_resize'];
+        var cameraId = this.id.substring(6);
+
         count /= framerateFactor;
-        
+
+        /* if frameFactor is 0, we only want one camera refresh at the beginning,
+         * and no subsequent refreshes at all */
+        if (framerateFactor == 0 && this.refreshDivider == 0) {
+            refreshCameraFrame(cameraId, this.img, serverSideResize);
+            this.refreshDivider++;
+        }
+
         if (this.img.error) {
             /* in case of error, decrease the refresh rate to 1 fps */
             count = 1000 / refreshInterval;
         }
-        
+
         if (this.refreshDivider < count) {
             this.refreshDivider++;
         }
         else {
-            var cameraId = this.id.substring(6);
             refreshCameraFrame(cameraId, this.img, serverSideResize);
-            
             this.refreshDivider = 0;
         }
     });
index 55dc7006567666f3203f464ad843c13e48c15f54..e55377c2321181bf237221b04bee325f2237ea3f 100644 (file)
                         <td class="settings-item-value"><input type="text" class="range styled prefs" id="layoutRowsSlider"></td>
                         <td><span class="help-mark" title="configures the number of rows used to lay out the camera frames">?</span></td>
                     </tr>
-                    <tr class="settings-item" min="1" max="100" snap="2" ticksnum="6" decimals="0">
+                    <tr class="settings-item" min="0" max="100" snap="2" ticksnum="6" decimals="0">
                         <td class="settings-item-label"><span class="settings-item-label">Frame Rate Dimmer</span></td>
                         <td class="settings-item-value"><input type="text" class="range styled prefs" id="framerateDimmerSlider"></td>
                         <td><span class="help-mark" title="dims the global frame rate to save network bandwidth and traffic (doesn't work on simple MJPEG cameras)">?</span></td>