From f5c3467ea79e6d6e290267bab5a5c10c6bad2b6a Mon Sep 17 00:00:00 2001 From: Moe Date: Wed, 13 May 2020 15:32:53 -0700 Subject: [PATCH] properly expose some object detection options --- definitions/en_CA.js | 72 +++++++++++++++++++++----------------------- libs/ffmpeg.js | 14 +++++++-- 2 files changed, 46 insertions(+), 40 deletions(-) diff --git a/definitions/en_CA.js b/definitions/en_CA.js index 9a8817e8..c30adea7 100644 --- a/definitions/en_CA.js +++ b/definitions/en_CA.js @@ -2107,6 +2107,36 @@ module.exports = function(s,config,lang){ } ] }, + { + hidden: true, + "form-group-class": "h_det_input h_det_1", + "name": "detail=detector_fps", + "field": lang["Detector Rate"], + "description": "How many frames a second to send to the motion detector; 2 is the default.", + "default": "2", + "example": "", + "possible": "" + }, + { + hidden: true, + "form-group-class": "h_det_input h_det_1", + "name": "detail=detector_scale_x", + "field": lang["Feed-in Image Width"], + "description": "Width of the image being detected. Smaller sizes take less CPU.", + "default": "", + "example": "640", + "possible": "" + }, + { + hidden: true, + "form-group-class": "h_det_input h_det_1", + "name": "detail=detector_scale_y", + "field": lang["Feed-in Image Height"], + "description": "Height of the image being detected. Smaller sizes take less CPU.", + "default": "", + "example": "480", + "possible": "" + }, { hidden: true, "name": "detail=detector_lock_timeout", @@ -2137,36 +2167,6 @@ module.exports = function(s,config,lang){ } ] }, - { - hidden: true, - "name": "detail=detector_fps", - "field": lang["Detector Rate"], - "description": "How many frames a second to send to the motion detector; 2 is the default.", - "default": "2", - "example": "", - "form-group-class": "h_det_input h_det_1", - "possible": "" - }, - { - hidden: true, - "name": "detail=detector_scale_x", - "field": lang["Feed-in Image Width"], - "description": "Width of the image being detected. Smaller sizes take less CPU.", - "default": "", - "example": "640", - "form-group-class": "h_det_input h_det_1", - "possible": "" - }, - { - hidden: true, - "name": "detail=detector_scale_y", - "field": lang["Feed-in Image Height"], - "description": "Height of the image being detected. Smaller sizes take less CPU.", - "default": "", - "example": "480", - "form-group-class": "h_det_input h_det_1", - "possible": "" - }, { hidden: true, "name": "detail=detector_record_method", @@ -2434,6 +2434,7 @@ module.exports = function(s,config,lang){ "name": "detail=snap_seconds_inward", "field": lang['Delay for Snapshot'], "description": lang['in seconds'], + "form-group-class": "h_det_input h_det_1", "default": "0", }, { @@ -3048,10 +3049,9 @@ module.exports = function(s,config,lang){ "name": "detail=detector_fps_object", "field": lang['Frame Rate'], "description": "", - "default": "1", + "default": "2", "example": "", - "form-group-class": "h_det_mot_fir_input h_det_mot_fir_1", - "form-group-class-pre-layer": "h_det_pam_input h_det_pam_1", + "form-group-class": "h_casc_input h_casc_1", "fieldType": "number", "numberMin": "1", "possible": "" @@ -3063,8 +3063,7 @@ module.exports = function(s,config,lang){ "description": "", "default": "", "example": "", - "form-group-class": "h_det_mot_fir_input h_det_mot_fir_1", - "form-group-class-pre-layer": "h_det_pam_input h_det_pam_1", + "form-group-class": "h_casc_input h_casc_1", "fieldType": "number", "numberMin": "1", "possible": "" @@ -3076,8 +3075,7 @@ module.exports = function(s,config,lang){ "description": "", "default": "", "example": "", - "form-group-class": "h_det_mot_fir_input h_det_mot_fir_1", - "form-group-class-pre-layer": "h_det_pam_input h_det_pam_1", + "form-group-class": "h_casc_input h_casc_1", "fieldType": "number", "numberMin": "1", "possible": "" diff --git a/libs/ffmpeg.js b/libs/ffmpeg.js index 6642edd5..fc684f3a 100644 --- a/libs/ffmpeg.js +++ b/libs/ffmpeg.js @@ -808,10 +808,18 @@ module.exports = function(s,config,lang,onFinish){ var h264Output = ' -q:v 1 -an -c:v libx264 -f hls -tune zerolatency -g 1 -hls_time 2 -hls_list_size 3 -start_number 0 -live_start_index 3 -hls_allow_cache 0 -hls_flags +delete_segments+omit_endlist "'+e.sdir+'detectorStreamX.m3u8"' var setObjectDetectValues = () => { //for object detection - x.detector_fps_object = '2' x.pipe += s.createFFmpegMap(e,e.details.input_map_choices.detector) - if(e.details.detector_scale_x_object&&e.details.detector_scale_x_object!==''&&e.details.detector_scale_y_object&&e.details.detector_scale_y_object!==''){x.dobjratio=' -s '+e.details.detector_scale_x_object+'x'+e.details.detector_scale_y_object}else{x.dobjratio=x.dratio} - if(e.details.detector_fps_object){x.detector_fps_object = e.details.detector_fps_object} + if( + e.details.detector_scale_x_object && + e.details.detector_scale_x_object !=='' && + e.details.detector_scale_y_object && + e.details.detector_scale_y_object!=='' + ){ + x.dobjratio = ' -s '+e.details.detector_scale_x_object+'x'+e.details.detector_scale_y_object + }else{ + x.dobjratio = x.dratio + } + x.detector_fps_object = e.details.detector_fps_object || '2' x.pipe += ' -r ' + x.detector_fps_object + x.dobjratio + x.cust_detect } if(e.details.detector_pam === '1'){