From a6b78c0a4e6dd8fb88437dedce4e69750a2c7d1d Mon Sep 17 00:00:00 2001 From: Ian Rubado Date: Sun, 5 Apr 2020 22:12:15 -0400 Subject: [PATCH] Revert "Merge branch 'always_record_on_motion' into dev" This reverts commit 5f804ce396152cab41794a387f0c1aabb4a9df07, reversing changes made to 184bc2fa6963cad132f113ea04d5caf7f03b22fb. --- definitions/en_CA.js | 19 ------------------- languages/en_CA.json | 3 +-- plugins/tensorflow/shinobi-tensorflow.js | 20 +------------------- plugins/yolo/shinobi-yolo.js | 19 ++----------------- web/libs/js/dash2.monitoredit.js | 2 +- web/libs/js/main.dash2.js | 1 - 6 files changed, 5 insertions(+), 59 deletions(-) diff --git a/definitions/en_CA.js b/definitions/en_CA.js index 5f8f7c21..1412be01 100644 --- a/definitions/en_CA.js +++ b/definitions/en_CA.js @@ -2985,25 +2985,6 @@ module.exports = function(s,config,lang){ } ] }, - { - "name": "detail=detector_always_record", - "field": lang['Start recording on motion'], - "description": "", - "default": "0", - "example": "", - "selector": "h_det_alwy_rec", - "fieldType": "select", - "possible": [ - { - "name": lang.No, - "value": "0" - }, - { - "name": lang.Yes, - "value": "1" - } - ] - }, { hidden: true, "name": "detail=detector_fps_object", diff --git a/languages/en_CA.json b/languages/en_CA.json index 49651fb2..913c1d2a 100644 --- a/languages/en_CA.json +++ b/languages/en_CA.json @@ -969,6 +969,5 @@ "There are no monitors that you can view with this account.":"There are no monitors that you can view with this account.", "Delete Monitors and Files": "Delete Monitors and Files", "Select atleast one monitor to delete": "Select atleast one monitor to delete.", - "Use Built-In":"Use Built-In", - "Start recording on motion":"Start recording on motion" + "Use Built-In":"Use Built-In" } diff --git a/plugins/tensorflow/shinobi-tensorflow.js b/plugins/tensorflow/shinobi-tensorflow.js index a119d427..7e721c95 100644 --- a/plugins/tensorflow/shinobi-tensorflow.js +++ b/plugins/tensorflow/shinobi-tensorflow.js @@ -63,25 +63,7 @@ s.detectObject=function(buffer,d,tx,frameLocation){ time: resp.time } }) - } else if (d.mon.detector_pam === '1' && d.mon.detector_always_record === '1' ) { - var width = parseFloat(d.mon.detector_scale_y) - var height = parseFloat(d.mon.detector_scale_x) - tx({ - f:'trigger', - id:d.id, - ke:d.ke, - details:{ - plug:config.plug, - name:'motion_before_tensorflow', - reason:'motion', - imgHeight:width, - imgWidth:height - } - }) - } - }) - .catch(error => { - console.log(error) + } }) // var detectStuff = function(frame,callback){ // detector.detect(frame) diff --git a/plugins/yolo/shinobi-yolo.js b/plugins/yolo/shinobi-yolo.js index 5c2c1c64..e04f67d9 100644 --- a/plugins/yolo/shinobi-yolo.js +++ b/plugins/yolo/shinobi-yolo.js @@ -27,7 +27,6 @@ var yolo = require('node-yolo-shinobi');//this is @vapi/node-yolo@1.2.4 without // var yolo = require('@vapi/node-yolo'); var detector = new yolo(__dirname + "/models", "cfg/coco.data", "cfg/yolov3.cfg", "yolov3.weights"); s.detectObject=function(buffer,d,tx,frameLocation){ - var timeStart = new Date() var detectStuff = function(frame,callback){ detector.detect(frame) .then(detections => { @@ -53,24 +52,10 @@ s.detectObject=function(buffer,d,tx,frameLocation){ reason:'object', matrices:matrices, imgHeight:parseFloat(d.mon.detector_scale_y), - imgWidth:parseFloat(d.mon.detector_scale_x), - time: (new Date()) - timeStart + imgWidth:parseFloat(d.mon.detector_scale_x) } }) - }else if (d.mon.detector_pam === '1' && d.mon.detector_always_record === '1' ) { - tx({ - f:'trigger', - id:d.id, - ke:d.ke, - details:{ - plug:config.plug, - name:'motion_before_yolo', - reason:'motion', - imgHeight:parseFloat(d.mon.detector_scale_y), - imgWidth:parseFloat(d.mon.detector_scale_x) - } - }) - } + } fs.unlink(frame,function(){ }) diff --git a/web/libs/js/dash2.monitoredit.js b/web/libs/js/dash2.monitoredit.js index dde9dace..2d2711ae 100644 --- a/web/libs/js/dash2.monitoredit.js +++ b/web/libs/js/dash2.monitoredit.js @@ -20,7 +20,7 @@ $.aM.generateDefaultMonitorSettings=function(){ "ext": "mp4", "protocol": "http", "fps": "1", - "details": "{\"max_keep_days\":\"\",\"notes\":\"\",\"dir\":\"\",\"rtmp_key\":\"\",\"auto_host_enable\":\"1\",\"auto_host\":\"\",\"rtsp_transport\":\"tcp\",\"muser\":\"\",\"mpass\":\"\",\"port_force\":\"0\",\"fatal_max\":\"0\",\"skip_ping\":null,\"is_onvif\":null,\"onvif_port\":\"\",\"primary_input\":null,\"aduration\":\"1000000\",\"probesize\":\"1000000\",\"stream_loop\":\"0\",\"sfps\":\"\",\"accelerator\":\"0\",\"hwaccel\":\"auto\",\"hwaccel_vcodec\":\"\",\"hwaccel_device\":\"\",\"use_coprocessor\":null,\"stream_type\":\"mp4\",\"stream_flv_type\":\"ws\",\"stream_flv_maxLatency\":\"\",\"stream_mjpeg_clients\":\"\",\"stream_vcodec\":\"copy\",\"stream_acodec\":\"no\",\"hls_time\":\"2\",\"hls_list_size\":\"3\",\"preset_stream\":\"ultrafast\",\"signal_check\":\"10\",\"signal_check_log\":\"0\",\"stream_quality\":\"15\",\"stream_fps\":\"2\",\"stream_scale_x\":\"\",\"stream_scale_y\":\"\",\"rotate_stream\":\"no\",\"svf\":\"\",\"tv_channel\":\"0\",\"tv_channel_id\":\"\",\"tv_channel_group_title\":\"\",\"stream_timestamp\":\"0\",\"stream_timestamp_font\":\"\",\"stream_timestamp_font_size\":\"\",\"stream_timestamp_color\":\"\",\"stream_timestamp_box_color\":\"\",\"stream_timestamp_x\":\"\",\"stream_timestamp_y\":\"\",\"stream_watermark\":\"0\",\"stream_watermark_location\":\"\",\"stream_watermark_position\":\"tr\",\"snap\":\"0\",\"snap_fps\":\"\",\"snap_scale_x\":\"\",\"snap_scale_y\":\"\",\"snap_vf\":\"\",\"vcodec\":\"copy\",\"crf\":\"1\",\"acodec\":\"no\",\"record_scale_y\":\"\",\"record_scale_x\":\"\",\"cutoff\":\"15\",\"rotate_record\":\"no\",\"vf\":\"\",\"timestamp\":\"0\",\"timestamp_font\":\"\",\"timestamp_font_size\":\"10\",\"timestamp_color\":\"white\",\"timestamp_box_color\":\"0x00000000@1\",\"timestamp_x\":\"(w-tw)/2\",\"timestamp_y\":\"0\",\"watermark\":\"0\",\"watermark_location\":\"\",\"watermark_position\":\"tr\",\"record_timelapse\":null,\"record_timelapse_mp4\":null,\"record_timelapse_fps\":null,\"record_timelapse_scale_x\":\"\",\"record_timelapse_scale_y\":\"\",\"record_timelapse_vf\":\"\",\"record_timelapse_watermark\":null,\"record_timelapse_watermark_location\":\"\",\"record_timelapse_watermark_position\":null,\"cust_input\":\"\",\"cust_stream\":\"\",\"cust_snap\":\"\",\"cust_record\":\"\",\"cust_detect\":\"\",\"cust_sip_record\":\"\",\"custom_output\":\"\",\"detector\":\"0\",\"detector_http_api\":null,\"detector_send_frames\":\"1\",\"detector_lock_timeout\":\"\",\"detector_save\":\"0\",\"detector_fps\":\"\",\"detector_scale_x\":\"640\",\"detector_scale_y\":\"480\",\"detector_record_method\":\"sip\",\"detector_trigger\":\"1\",\"detector_trigger_record_fps\":\"\",\"detector_timeout\":\"10\",\"detector_send_video_length\":\"\",\"watchdog_reset\":\"0\",\"detector_delete_motionless_videos\":\"0\",\"det_multi_trig\":null,\"group_detector_multi\":\"\",\"detector_webhook\":\"0\",\"detector_webhook_url\":\"\",\"detector_webhook_method\":null,\"detector_command_enable\":\"0\",\"detector_command\":\"\",\"detector_command_timeout\":\"\",\"detector_mail\":\"0\",\"detector_mail_timeout\":\"\",\"detector_discordbot\":null,\"detector_discordbot_send_video\":null,\"detector_discordbot_timeout\":\"\",\"use_detector_filters\":null,\"use_detector_filters_object\":null,\"cords\":\"[]\",\"detector_filters\":\"\",\"detector_pam\":\"1\",\"detector_show_matrix\":null,\"detector_sensitivity\":\"\",\"detector_max_sensitivity\":\"\",\"detector_threshold\":\"1\",\"detector_color_threshold\":\"\",\"detector_frame\":\"0\",\"detector_noise_filter\":null,\"detector_noise_filter_range\":\"\",\"detector_notrigger\":\"0\",\"detector_notrigger_mail\":\"0\",\"detector_notrigger_timeout\":\"\",\"detector_audio\":null,\"detector_audio_min_db\":\"\",\"detector_audio_max_db\":\"\",\"detector_use_detect_object\":\"0\",\"detector_send_frames_object\":null,\"detector_obj_region\":null,\"detector_use_motion\":\"1\",\"detector_always_record\":\"0\",\"detector_fps_object\":\"\",\"detector_scale_x_object\":\"\",\"detector_scale_y_object\":\"\",\"detector_lisence_plate\":\"0\",\"detector_lisence_plate_country\":\"us\",\"detector_buffer_vcodec\":\"auto\",\"detector_buffer_acodec\":null,\"detector_buffer_fps\":\"\",\"detector_buffer_hls_time\":\"\",\"detector_buffer_hls_list_size\":\"\",\"detector_buffer_start_number\":\"\",\"detector_buffer_live_start_index\":\"\",\"control\":\"0\",\"control_base_url\":\"\",\"control_url_method\":null,\"control_digest_auth\":null,\"control_stop\":\"0\",\"control_url_stop_timeout\":\"\",\"control_url_center\":\"\",\"control_url_left\":\"\",\"control_url_left_stop\":\"\",\"control_url_right\":\"\",\"control_url_right_stop\":\"\",\"control_url_up\":\"\",\"control_url_up_stop\":\"\",\"control_url_down\":\"\",\"control_url_down_stop\":\"\",\"control_url_enable_nv\":\"\",\"control_url_disable_nv\":\"\",\"control_url_zoom_out\":\"\",\"control_url_zoom_out_stop\":\"\",\"control_url_zoom_in\":\"\",\"control_url_zoom_in_stop\":\"\",\"groups\":\"[]\",\"loglevel\":\"warning\",\"sqllog\":\"0\",\"detector_cascades\":\"\",\"stream_channels\":\"\",\"input_maps\":\"\",\"input_map_choices\":\"\"}", + "details": "{\"max_keep_days\":\"\",\"notes\":\"\",\"dir\":\"\",\"rtmp_key\":\"\",\"auto_host_enable\":\"1\",\"auto_host\":\"\",\"rtsp_transport\":\"tcp\",\"muser\":\"\",\"mpass\":\"\",\"port_force\":\"0\",\"fatal_max\":\"0\",\"skip_ping\":null,\"is_onvif\":null,\"onvif_port\":\"\",\"primary_input\":null,\"aduration\":\"1000000\",\"probesize\":\"1000000\",\"stream_loop\":\"0\",\"sfps\":\"\",\"accelerator\":\"0\",\"hwaccel\":\"auto\",\"hwaccel_vcodec\":\"\",\"hwaccel_device\":\"\",\"use_coprocessor\":null,\"stream_type\":\"mp4\",\"stream_flv_type\":\"ws\",\"stream_flv_maxLatency\":\"\",\"stream_mjpeg_clients\":\"\",\"stream_vcodec\":\"copy\",\"stream_acodec\":\"no\",\"hls_time\":\"2\",\"hls_list_size\":\"3\",\"preset_stream\":\"ultrafast\",\"signal_check\":\"10\",\"signal_check_log\":\"0\",\"stream_quality\":\"15\",\"stream_fps\":\"2\",\"stream_scale_x\":\"\",\"stream_scale_y\":\"\",\"rotate_stream\":\"no\",\"svf\":\"\",\"tv_channel\":\"0\",\"tv_channel_id\":\"\",\"tv_channel_group_title\":\"\",\"stream_timestamp\":\"0\",\"stream_timestamp_font\":\"\",\"stream_timestamp_font_size\":\"\",\"stream_timestamp_color\":\"\",\"stream_timestamp_box_color\":\"\",\"stream_timestamp_x\":\"\",\"stream_timestamp_y\":\"\",\"stream_watermark\":\"0\",\"stream_watermark_location\":\"\",\"stream_watermark_position\":\"tr\",\"snap\":\"0\",\"snap_fps\":\"\",\"snap_scale_x\":\"\",\"snap_scale_y\":\"\",\"snap_vf\":\"\",\"vcodec\":\"copy\",\"crf\":\"1\",\"acodec\":\"no\",\"record_scale_y\":\"\",\"record_scale_x\":\"\",\"cutoff\":\"15\",\"rotate_record\":\"no\",\"vf\":\"\",\"timestamp\":\"0\",\"timestamp_font\":\"\",\"timestamp_font_size\":\"10\",\"timestamp_color\":\"white\",\"timestamp_box_color\":\"0x00000000@1\",\"timestamp_x\":\"(w-tw)/2\",\"timestamp_y\":\"0\",\"watermark\":\"0\",\"watermark_location\":\"\",\"watermark_position\":\"tr\",\"record_timelapse\":null,\"record_timelapse_mp4\":null,\"record_timelapse_fps\":null,\"record_timelapse_scale_x\":\"\",\"record_timelapse_scale_y\":\"\",\"record_timelapse_vf\":\"\",\"record_timelapse_watermark\":null,\"record_timelapse_watermark_location\":\"\",\"record_timelapse_watermark_position\":null,\"cust_input\":\"\",\"cust_stream\":\"\",\"cust_snap\":\"\",\"cust_record\":\"\",\"cust_detect\":\"\",\"cust_sip_record\":\"\",\"custom_output\":\"\",\"detector\":\"0\",\"detector_http_api\":null,\"detector_send_frames\":\"1\",\"detector_lock_timeout\":\"\",\"detector_save\":\"0\",\"detector_fps\":\"\",\"detector_scale_x\":\"640\",\"detector_scale_y\":\"480\",\"detector_record_method\":\"sip\",\"detector_trigger\":\"1\",\"detector_trigger_record_fps\":\"\",\"detector_timeout\":\"10\",\"detector_send_video_length\":\"\",\"watchdog_reset\":\"0\",\"detector_delete_motionless_videos\":\"0\",\"det_multi_trig\":null,\"group_detector_multi\":\"\",\"detector_webhook\":\"0\",\"detector_webhook_url\":\"\",\"detector_webhook_method\":null,\"detector_command_enable\":\"0\",\"detector_command\":\"\",\"detector_command_timeout\":\"\",\"detector_mail\":\"0\",\"detector_mail_timeout\":\"\",\"detector_discordbot\":null,\"detector_discordbot_send_video\":null,\"detector_discordbot_timeout\":\"\",\"use_detector_filters\":null,\"use_detector_filters_object\":null,\"cords\":\"[]\",\"detector_filters\":\"\",\"detector_pam\":\"1\",\"detector_show_matrix\":null,\"detector_sensitivity\":\"\",\"detector_max_sensitivity\":\"\",\"detector_threshold\":\"1\",\"detector_color_threshold\":\"\",\"detector_frame\":\"0\",\"detector_noise_filter\":null,\"detector_noise_filter_range\":\"\",\"detector_notrigger\":\"0\",\"detector_notrigger_mail\":\"0\",\"detector_notrigger_timeout\":\"\",\"detector_audio\":null,\"detector_audio_min_db\":\"\",\"detector_audio_max_db\":\"\",\"detector_use_detect_object\":\"0\",\"detector_send_frames_object\":null,\"detector_obj_region\":null,\"detector_use_motion\":\"1\",\"detector_fps_object\":\"\",\"detector_scale_x_object\":\"\",\"detector_scale_y_object\":\"\",\"detector_lisence_plate\":\"0\",\"detector_lisence_plate_country\":\"us\",\"detector_buffer_vcodec\":\"auto\",\"detector_buffer_acodec\":null,\"detector_buffer_fps\":\"\",\"detector_buffer_hls_time\":\"\",\"detector_buffer_hls_list_size\":\"\",\"detector_buffer_start_number\":\"\",\"detector_buffer_live_start_index\":\"\",\"control\":\"0\",\"control_base_url\":\"\",\"control_url_method\":null,\"control_digest_auth\":null,\"control_stop\":\"0\",\"control_url_stop_timeout\":\"\",\"control_url_center\":\"\",\"control_url_left\":\"\",\"control_url_left_stop\":\"\",\"control_url_right\":\"\",\"control_url_right_stop\":\"\",\"control_url_up\":\"\",\"control_url_up_stop\":\"\",\"control_url_down\":\"\",\"control_url_down_stop\":\"\",\"control_url_enable_nv\":\"\",\"control_url_disable_nv\":\"\",\"control_url_zoom_out\":\"\",\"control_url_zoom_out_stop\":\"\",\"control_url_zoom_in\":\"\",\"control_url_zoom_in_stop\":\"\",\"groups\":\"[]\",\"loglevel\":\"warning\",\"sqllog\":\"0\",\"detector_cascades\":\"\",\"stream_channels\":\"\",\"input_maps\":\"\",\"input_map_choices\":\"\"}", "shto": "[]", "shfr": "[]" } diff --git a/web/libs/js/main.dash2.js b/web/libs/js/main.dash2.js index 5d5d939a..4aca83af 100644 --- a/web/libs/js/main.dash2.js +++ b/web/libs/js/main.dash2.js @@ -3571,7 +3571,6 @@ $.aM.generateDefaultMonitorSettings=function(){ "detector_scale_x": "640", "detector_scale_y": "480", "detector_use_motion": "1", - "detector_always_record":"0", "detector_use_detect_object": "0", "detector_frame": "0", "detector_sensitivity": "",