mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
allow specifying labels to save clips for
This commit is contained in:
parent
50e568b84c
commit
780ae7cd4f
@ -190,6 +190,11 @@ cameras:
|
||||
# Number of seconds before the event to include in the clips
|
||||
#########
|
||||
pre_capture: 30
|
||||
#########
|
||||
# Objects to save clips for. Defaults to all tracked object types.
|
||||
#########
|
||||
# objects:
|
||||
# - person
|
||||
|
||||
################
|
||||
# Configuration for the snapshots in the debug view and mqtt
|
||||
|
@ -147,12 +147,19 @@ class EventProcessor(threading.Thread):
|
||||
|
||||
self.refresh_cache()
|
||||
|
||||
save_clips_config = self.config[camera].get('save_clips', {})
|
||||
|
||||
# if specific objects are listed for this camera, only save clips for them
|
||||
if 'objects' in save_clips_config:
|
||||
if not event_data['label'] in save_clips_config['objects']:
|
||||
continue
|
||||
|
||||
if event_type == 'start':
|
||||
self.events_in_process[event_data['id']] = event_data
|
||||
|
||||
if event_type == 'end':
|
||||
if self.config[camera].get('save_clips', {}).get('enabled', False) and len(self.cached_clips) > 0 and not event_data['false_positive']:
|
||||
self.create_clip(camera, event_data, self.config[camera].get('save_clips', {}).get('pre_capture', 30))
|
||||
if save_clips_config.get('enabled', False) and len(self.cached_clips) > 0 and not event_data['false_positive']:
|
||||
self.create_clip(camera, event_data, save_clips_config.get('pre_capture', 30))
|
||||
del self.events_in_process[event_data['id']]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user