From 6e594ab97ae1bc71d9737e49cdcb51be984731f2 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Thu, 18 Jul 2019 16:52:54 -0400 Subject: allow max FPS settings for Montage Mode (irrelevant if not using multiport) --- www/js/MonitorModalCtrl.js | 4 +++- www/js/MontageCtrl.js | 12 +++++++++--- www/js/NVR.js | 13 ++++++++++--- www/lang/locale-en.json | 3 ++- www/templates/devoptions.html | 13 +++++++++++-- 5 files changed, 35 insertions(+), 10 deletions(-) diff --git a/www/js/MonitorModalCtrl.js b/www/js/MonitorModalCtrl.js index bf6c95dd..1f0ce944 100644 --- a/www/js/MonitorModalCtrl.js +++ b/www/js/MonitorModalCtrl.js @@ -421,6 +421,7 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$ var apiurl = NVR.getLogin().apiurl; var alarmurl = apiurl + "/monitors/alarm/id:" + $scope.monitorId + "/command:status.json?"+$rootScope.authSession; NVR.log("Invoking " + alarmurl); + console.log ("ALARM = "+alarmurl); $http.get(alarmurl) .then(function (data) { @@ -1061,6 +1062,7 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$ var c = mode == 'on' ? 'on' : 'off'; var alarmurl = apiurl + "/monitors/alarm/id:" + mid + "/command:" + c + ".json?"+$rootScope.authSession; NVR.log("Invoking " + alarmurl); + var status = mode ? $translate.instant('kForcingAlarm') : $translate.instant('kCancellingAlarm'); $ionicLoading.show({ @@ -1257,7 +1259,7 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$ var stream; - var fps = NVR.getLogin().liveFPS; + var fps = NVR.getLogin().singleliveFPS; stream = $scope.monitor.Monitor.streamingURL + "/nph-zms?mode=" + getSingleStreamMode() + "&monitor=" + $scope.monitorId + diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index e5274b81..c350df78 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -596,7 +596,7 @@ angular.module('zmApp.controllers') apiurl += '.json?sort=StartTime&direction=desc&limit=1'+$rootScope.authSession; - NVR.debug ("Getting event count"); + NVR.debug ("Getting event count "+apiurl); $http.get(apiurl) .then (function (data) { // console.log ("EVENTS GOT: "+JSON.stringify(data)); @@ -2022,6 +2022,7 @@ angular.module('zmApp.controllers') $scope.constructStream = function (monitor) { var stream; + var fps = NVR.getLogin().montageliveFPS; if (currentStreamState == streamState.STOPPED || monitor.Monitor.listDisplay == 'noshow' ) { //console.log ("STREAM=empty and auth="+$rootScope.authSession); return ""; @@ -2033,8 +2034,13 @@ angular.module('zmApp.controllers') "&monitor=" + monitor.Monitor.Id + "&scale=" + $scope.LoginData.montageQuality + "&rand=" + randToAvoidCacheMem + monitor.Monitor.Id + - "&buffer=1000" + - $rootScope.authSession + + "&buffer=1000" + + if (fps) { + stream +='&maxfps='+fps; + } + + stream += $rootScope.authSession + appendConnKey(monitor.Monitor.connKey); if (stream) stream += NVR.insertBasicAuthToken(); diff --git a/www/js/NVR.js b/www/js/NVR.js index c9991d80..41cb3118 100644 --- a/www/js/NVR.js +++ b/www/js/NVR.js @@ -124,7 +124,8 @@ angular.module('zmApp.controllers') 'eventServerInterval': '', // list of intervals for all monitors 'refreshSec': '2', // timer value for frame change in sec 'refreshSecLowBW': 8, - 'liveFPS':'', + 'singleliveFPS':'', + 'montageliveFPS':'', 'enableLogs': true, 'enableDebug': true, // if enabled with log messages with "debug" 'usePin': false, @@ -1243,9 +1244,15 @@ angular.module('zmApp.controllers') } - if (typeof loginData.liveFPS == 'undefined') { + if (typeof loginData.singleliveFPS == 'undefined') { - loginData.liveFPS = ''; + loginData.singleliveFPS = ''; + + } + + if (typeof loginData.montageliveFPS == 'undefined') { + + loginData.montageLiveFPS = ''; } diff --git a/www/lang/locale-en.json b/www/lang/locale-en.json index a5304412..d87b7123 100644 --- a/www/lang/locale-en.json +++ b/www/lang/locale-en.json @@ -234,6 +234,7 @@ "kMonitorVideoEncode" :"X264 Video Encode", "kMontage" :"Montage", "kMontageEnableOverlays" :"Enable montage overlay buttons", + "kMontageLiveViewFPS" :"Montage live view FPS", "kMontageShowSidebars" :"Expand montage sidebar", "kMontageShowSidebarsNote" :"for monitors with unseen events", "kMontageEventStorage" :"storage", @@ -360,7 +361,7 @@ "kShowLiveForInProgress" :"play live feed if event recording in progress", "kShowTimeDiffFrames" :"unique times", "kShowTip" :"show tip", - "kSingleViewFPS" :"single live view FPS", + "kSingleLiveViewFPS" :"Single live view FPS", "kSoundOnPush" :"Play sound on push", "kSpeed" :"speed", "kStart" :"Start", diff --git a/www/templates/devoptions.html b/www/templates/devoptions.html index ab8ad90b..e9d719d4 100644 --- a/www/templates/devoptions.html +++ b/www/templates/devoptions.html @@ -22,10 +22,19 @@
- {{'kSingleViewFPS'|translate}} ({{'kSec'|translate}}.) + {{'kMontageLiveViewFPS'|translate}} ({{'kSec'|translate}}.) + +
+ +
+ {{'kSingleLiveViewFPS'|translate}} ({{'kSec'|translate}}.) + +
-- cgit v1.2.3