Remove Video Records
See also
There are two methods of video archive cleanup available in the system:
Regular cleanup
Manual cleanup via a console command
In this section:
Regular Video Cleanup
To configure the regular video cleanup, do the following:
Open the
/opt/findface-multi/configs/findface-multi-legacy/findface-multi-legacy.py
configuration file.sudo vi /opt/findface-multi/configs/findface-multi-legacy/findface-multi-legacy.py
Find the
SERVICES
section and set"vms_cleanup": True
.SERVICES = { "ffsecurity": { ... "vms_cleanup": True, } }
Find the
VMS_CLEANUP_SETTINGS
section and configure what video to remove, using the following parameters:'CLEANUP_BETWEEN_TRACKS'
: setTrue
to remove video intervals that do not contain recognition events'CLEANUP_ARCHIVE'
: setTrue
to remove the entire video archive older than a given number of days'ARCHIVE_CLEANUP_AGE'
: the maximum age of video archive in the system, days. Applicable if'CLEANUP_ARCHIVE': True
'CLEANUP_EVENTS_TYPES'
: event types that will be kept in the video archive, in the form of a dictionary, e.g., [‘face’, ‘body’, ‘car’]'KEEP_EVENT_BEFORE_AFTER'
: interval before and after a track with events, that won’t be removed in order to preserve meaningful information related to them, seconds. The value must be less thanCLEANUP_THRESHOLD
'CLEANUP_THRESHOLD'
: minimum interval between tracks with events, seconds. If the interval between tracks is shorter, it won’t be removedTip
See the RRULE calculator here.
'VMS_CLEANUP_SETTINGS': { 'CLEANUP_BETWEEN_TRACKS': True, 'CLEANUP_ARCHIVE': True, 'ARCHIVE_CLEANUP_AGE': 9, 'CLEANUP_EVENTS_TYPES': ['car'], # Add `safe_time_interval` in seconds to each `track` subject to delete # Prevents deletion of essential data. # Should be lower than CLEANUP_THRESHOLD 'KEEP_EVENT_BEFORE_AFTER': 10, # minimal allowed value # Threshold between `intervals` in seconds. # If duration between `tracks` < `CLEANUP_THRESHOLD` # interval between tracks will not be added to deletion tasks 'CLEANUP_THRESHOLD': 360, # minimal allowed value },
Find the
'VMS_CLEANUP_SERVICE_SCHEDULE'
parameter and specify a recurrence rule (RRULE) for scheduling video cleanup.Tip
See the RRULE calculator here.
# rrule (recurrence rule) for scheduling `vms_cleanup` service 'VMS_CLEANUP_SERVICE_SCHEDULE': 'RRULE:FREQ=HOURLY;INTERVAL=3;WKST=MO',
Restart the
findface-multi-findface-multi-legacy-1
container.sudo docker container restart findface-multi-findface-multi-legacy-1
Manual Video Cleanup
You can manually remove video chunks older than the given number of days by executing the command below. To set the number of days, use the –vms-videos-max-age argument.
sudo docker exec -it findface-multi-findface-multi-legacy-1 /opt/findface-security/bin/python3 /tigre_prototype/manage.py cleanup_vms --vms-videos-max-age=30