Skip to content

Commit

Permalink
framerate dimmer can now be set to 0 (again) and it will refresh once
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrisan committed Sep 9, 2017
1 parent 2c61784 commit 97a0301
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions motioneye/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
Expand Down
2 changes: 1 addition & 1 deletion motioneye/templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<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>
Expand Down

0 comments on commit 97a0301

Please sign in to comment.