From 1d3aba59d613bc44aea6202de0c5108ebf6c7b05 Mon Sep 17 00:00:00 2001 From: Moe Alam Date: Sat, 17 Oct 2020 20:35:35 -0700 Subject: [PATCH] add separate mapping available to Object Detector, default is global's --- definitions/en_CA.js | 3 ++- libs/ffmpeg.js | 16 +++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/definitions/en_CA.js b/definitions/en_CA.js index 4dee442b..1acb230c 100644 --- a/definitions/en_CA.js +++ b/definitions/en_CA.js @@ -2978,6 +2978,7 @@ module.exports = function(s,config,lang){ headerTitle: `${lang['Object Detection']} ${lang['Not Connected']}`, isFormGroupGroup: true, isSection: true, + "input-mapping": "detector_object", "section-class": "h_det_input h_det_1", "info": [ { @@ -3185,7 +3186,7 @@ module.exports = function(s,config,lang){ { hidden: true, "name": lang['Traditional Recording'], - + "input-mapping": "detector_sip_buffer", "color": "orange", id: "monSectionDetectorTraditionalRecording", isSection: true, diff --git a/libs/ffmpeg.js b/libs/ffmpeg.js index 2536290f..9b722a01 100644 --- a/libs/ffmpeg.js +++ b/libs/ffmpeg.js @@ -790,6 +790,9 @@ module.exports = function(s,config,lang,onFinish){ const addInputMap = () => { if(inputMapsRequired)detectorFlags.push(s.createFFmpegMap(e,e.details.input_map_choices.detector)) } + const addObjectDetectorInputMap = () => { + if(inputMapsRequired)detectorFlags.push(s.createFFmpegMap(e,e.details.input_map_choices.detector_object || e.details.input_map_choices.detector)) + } const addObjectDetectValues = () => { const objVideoFilters = [objectDetectorFpsFilter] if(e.details.cust_detect_object)detectorFlags.push(e.details.cust_detect_object) @@ -797,30 +800,29 @@ module.exports = function(s,config,lang,onFinish){ detectorFlags.push(objectDetectorDimensionsFlag + ' -vf "' + objVideoFilters.join(',') + '"') } if(sendFramesGlobally){ - addInputMap() + if(builtInMotionDetectorIsEnabled)addInputMap(); detectorFlags.push(baseDimensionsFlag) - if(isCudaEnabled){ - videoFilters.push(cudaVideoFilters) - } + if(isCudaEnabled)videoFilters.push(cudaVideoFilters); videoFilters.push(baseFpsFilter) if(e.details.cust_detect)detectorFlags.push(e.details.cust_detect) addVideoFilters() if(builtInMotionDetectorIsEnabled){ detectorFlags.push('-an -c:v pam -pix_fmt gray -f image2pipe pipe:3') if(objectDetectorOutputIsEnabled){ - addInputMap() + addObjectDetectorInputMap() addObjectDetectValues() detectorFlags.push('-an -f singlejpeg pipe:4') } }else if(sendFramesToObjectDetector){ - addInputMap() + addObjectDetectorInputMap() addObjectDetectValues() detectorFlags.push('-an -f singlejpeg pipe:4') }else{ + addInputMap() detectorFlags.push('-an -f singlejpeg pipe:4') } }else if(sendFramesToObjectDetector){ - addInputMap() + addObjectDetectorInputMap() addObjectDetectValues() detectorFlags.push('-an -f singlejpeg pipe:4') }