From 57b5a093ee6209e25ed9f1b0ddfe7455d4abf1de Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 6 Dec 2015 22:23:34 +0200 Subject: [PATCH] slightly better refresh rate --- motioneye/static/js/frame.js | 6 ------ motioneye/static/js/main.js | 11 ++--------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/motioneye/static/js/frame.js b/motioneye/static/js/frame.js index 03afd01..a474de1 100644 --- a/motioneye/static/js/frame.js +++ b/motioneye/static/js/frame.js @@ -88,13 +88,7 @@ function refreshCameraFrame() { return; } - /* at a refresh interval of 50ms, the refresh rate is limited to 20 fps */ var count = 1000 / (refreshInterval * cameraFrame.streamingFramerate); - if (count <= 2) { - /* skipping frames (showing the same frame twice) at this rate won't be visible, - * while the effective framerate will be as close as possible to the motion's one */ - count -= 1; - } if (img.error) { /* in case of error, decrease the refresh rate to 1 fps */ diff --git a/motioneye/static/js/main.js b/motioneye/static/js/main.js index 8482c6c..e1e3986 100644 --- a/motioneye/static/js/main.js +++ b/motioneye/static/js/main.js @@ -4,7 +4,7 @@ var pushConfigReboot = false; var refreshDisabled = {}; /* dictionary indexed by cameraId, tells if refresh is disabled for a given camera */ var fullScreenCameraId = null; var inProgress = false; -var refreshInterval = 50; /* milliseconds */ +var refreshInterval = 15; /* milliseconds */ var username = ''; var password = ''; var basePath = null; @@ -4270,16 +4270,9 @@ function refreshCameraFrames() { return; /* no manual refresh for simple mjpeg cameras */ } - /* at a refresh interval of 50ms, the refresh rate is limited to 20 fps */ - var count = 1000 / (refreshInterval * this.config['streaming_framerate']); + var count = parseInt(1000 / (refreshInterval * this.config['streaming_framerate'])); var serverSideResize = this.config['streaming_server_resize']; - if (count <= 2) { - /* skipping frames (showing the same frame twice) at this rate won't be visible, - * while the effective framerate will be as close as possible to the motion's one */ - count -= 1; - } - if (this.img.error) { /* in case of error, decrease the refresh rate to 1 fps */ count = 1000 / refreshInterval; -- 2.39.5