Pre_capture and Post_capture #18396
Describe the problem you are havingI'm tried to setup pre&post_capture in my Frigate config: and as local for camera: neither of these settings (nor both together) work. and this behavior applies to all cameras and all kinds of objects (Person, Car, Cat ..). Version0.15.0-6cb5cfb Frigate config file############################################################################
#============================== UI ========================================#
############################################################################
ui:
time_format: 24hour
############################################################################
#============================== MQTT ======================================#
############################################################################
mqtt:
enabled: true
host: 192.168.2.43
port: 1883
user: хх
password: хх
stats_interval: 60
############################################################################
#============================== LOGGER ====================================#
############################################################################
logger:
default: info
# Optional: Component specific logger overrides
#logs:
# frigate.object_detection: debug
# detector.coral: debug
# frigate.mqtt: debug
# frigate.event: debug
############################################################################
#====================== In-feed TIMESTAMP configuration ===================#
############################################################################
timestamp_style:
position: bl
format: '%d/%m/%Y %H:%M:%S'
color:
red: 255
green: 255
blue: 255
thickness: 2
effect: shadow #solid #shadow
############################################################################
#============================= BIRDSEYE ===================================#
############################################################################
birdseye:
enabled: false
mode: continuous
layout:
scaling_factor: 2.0
############################################################################
#================================= GO2RTC =================================#
############################################################################
go2rtc:
streams:
#---------- Recording -------------------------------------------------#
Cam-0-s:
- rtsp://хх@192.168.2.51:554/cam/realmonitor?channel=1&subtype=0
Cam-1-s:
- rtsp://хх@192.168.2.52/onvif/device_service
- ffmpeg:Cam-1-s#audio=aac
Cam-2-s:
- rtsp://хх@192.168.2.48/Streaming/Channels/101
Cam-3-s:
- rtsp://хх@192.168.2.47:554/cam/realmonitor?channel=1&subtype=0
Cam-4-s:
- rtsp://хх@192.168.2.35:554/cam/realmonitor?channel=1&subtype=0
Cam-5-s:
- rtsp://хх@192.168.2.49:554/cam/realmonitor?channel=1&subtype=0
############################################################################
#============================= VARIABLES ==================================#
############################################################################
environment_vars:
LIBVA_DRIVER_NAME: iHD
############################################################################
#============================== GLOBAL FFMPEG =============================#
############################################################################
ffmpeg:
# hwaccel_args:
# - -hwaccel
# - vaapi
# - -hwaccel_device
# - /dev/dri/renderD128
# - -hwaccel_output_format
# - yuv420p
hwaccel_args: preset-vaapi
############################################################################
#========================= GLOBAL SPANSHOTS ===============================#
############################################################################
snapshots:
enabled: true # Enable writing jpg snapshot to /media/frigate/clips
bounding_box: true
clean_copy: true
timestamp: true
crop: false
# height: 350
retain:
default: 10
objects:
person: 30
quality: 80
############################################################################
#============================ GLOBAL RECORD ===============================#
############################################################################
record:
sync_recordings: true
enabled: true
retain:
days: 10
mode: all
alerts:
retain:
days: 30
pre_capture: 10
post_capture: 15
detections:
retain:
days: 30
pre_capture: 10
post_capture: 15
############################################################################
#============================ DETECTORS ===================================#
############################################################################
detectors:
coral_pci:
type: edgetpu
device: pci
############################################################################
#============================== REWIEV ====================================#
############################################################################
review:
alerts:
labels:
- person
- cat
- car
- squirrel
############################################################################
# #
#============================== CAMERAS ===================================#
# #
############################################################################
cameras:
############################################################################
#============================== CAM-0 Main view from Entrance =============#
############################################################################
Cam-0:
#__________________________________________________________________________#
#------------------ Web Interface ----------------------------------------#
webui_url: http://192.168.2.51/
#__________________________________________________________________________#
#------------------ Cam-0 FFMPEG configuration ----------------------------#
ffmpeg:
inputs:
- path: rtsp://хх@192.168.2.51:554/cam/realmonitor?channel=1&subtype=0 # rtsp://127.0.0.1:8554/Cam-0-s
roles:
- record
- path: rtsp://хх@192.168.2.51:554/cam/realmonitor?channel=1&subtype=1
roles:
- detect
output_args:
record: preset-record-generic-audio-copy
#__________________________________________________________________________#
#------------------ Cam-0 OBJECTS configuration ---------------------------#
objects:
track:
- person
- cat
- car # size on road - 1319px
filters:
person:
min_area: 5000 # minimum width*height (def - 0)
max_area: 30000 # maximum width*height (def - 24 000 000 real tuned 16k-30k)
min_ratio: 0.2 # minimum width/height (def - 0)
max_ratio: 1.0 # maximum width/height (def - 24000000)
min_score: 0.4 # minimum score for the object (def - 0.5)
threshold: 0.7 # minimum decimal percentage for tracked object's (def - 0.7)
mask:
- 0.551,0.629,0.755,0.627,0.773,1,0.674,1,0.561,1
- 0.453,0.933,0.435,0.637,0.319,0.647,0.31,0.929,0.393,0.98
cat:
min_area: 200 # minimum width*height (def - 0)
max_area: 4000 # maximum width*height (def - 24000000)
min_ratio: 0.2 # minimum width/height (def - 0)
max_ratio: 4.0 # maximum width/height (def - 24000000)
min_score: 0.2 # minimum score for the object (def - 0.5)
threshold: 0.6 # minimum decimal percentage for tracked object's (def - 0.7)
#__________________________________________________________________________#
#------------------ Cam-0 MOTION configuration ----------------------------#
car:
mask:
- 0.167,0.104,0.433,0.093,0.443,0.284,0.569,0.286,0.562,0.427,0.181,0.428
- 0.727,0.174,1,0.182,1,0.47,0.72,0.466
motion:
threshold: 25
contour_area: 15
improve_contrast: true
mask: 0.314,0.192,0.537,0.158,1,0.286,1,0,0.391,0,0,0,0,0.2
detect:
enabled: true
width: 704
height: 576
fps: 5
#__________________________________________________________________________#
#------------------ Cam-0 LIVE View configuration -------------------------#
live:
stream_name: Cam-0-s
###########################################################################
############################################################################
#============================== CAM-1 MAIN CAMERA =========================#
############################################################################
Cam-1:
#__________________________________________________________________________#
#------------------ Web Interface ----------------------------------------#
webui_url: http://192.168.2.52/
#__________________________________________________________________________#
#------------------ Cam-1 ONVIF configuration ----------------------------#
onvif:
host: 192.168.2.52
port: 80
user: admin
password: _Hamster_2020
autotracking:
enabled: false
calibrate_on_startup: false
zooming: disabled
zoom_factor: 0.3
track:
- squirrel
- person
- cat
- car
return_preset: home
timeout: 10
#__________________________________________________________________________#
#------------------ Cam-1 FFMPEG configuration ----------------------------#
ffmpeg:
inputs:
- path: rtsp://хх@192.168.2.52/Streaming/Channels/103
roles:
- detect
- path: rtsp://127.0.0.1:8554/Cam-1-s
roles:
- record
output_args:
record: preset-record-generic-audio-copy
#__________________________________________________________________________#
#------------------ Cam-1 OBJECTS configuration --------------------------#
objects:
track:
- squirrel
- person
- cat
- car
filters:
person:
min_area: 25000 # minimum width*height
# max_area: 100000 # maximum width*height
min_ratio: 0.2 # minimum width/height
max_ratio: 2.0 # maximum width/height
min_score: 0.6 # minimum score for the object to initiate tracking (def - 0.5)
threshold: 0.7 # minimum decimal percentage for tracked object's (def - 0.7)
# mask: 0,0,1000,0,1000,200,0,200 # based on the bottom center of the bounding box
cat:
min_area: 6500 # minimum width*height
max_area: 15000 # maximum width*height
min_ratio: 0.2 # minimum width/height
max_ratio: 4.0 # maximum width/height
min_score: 0.6 # minimum score for the object to initiate tracking (def - 0.5)
threshold: 0.7 # minimum decimal percentage for tracked object's (def - 0.7)
squirrel:
min_area: 1000 # minimum width*height (def - 0)
max_area: 6000 # maximum width*height (def - 24000000)
min_ratio: 0.2 # minimum width/height (def - 0)
max_ratio: 4.0 # maximum width/height (def - 24000000)
min_score: 0.2 # minimum score for the object (def - 0.5)
threshold: 0.6 # minimum decimal percentage for tracked object's (def - 0.7)
car:
min_area: 6500 # minimum width*height
min_ratio: 0.2 # minimum width/height
max_ratio: 4.0 # maximum width/height
min_score: 0.6 # minimum score for the object to initiate tracking (def - 0.5)
threshold: 0.7 # minimum decimal percentage for tracked object's (def - 0.7)
#__________________________________________________________________________#
#------------------ Cam-1 MOTION configuration ---------------------------#
motion:
threshold: 25 # value between 1- more sensitive and 255 - less.
contour_area: 15
delta_alpha: 0.2
frame_alpha: 0.2
# frame_height: 100
mask: 1,0,1,0.146,0.617,0.146,0.361,0.131,0.325,0.136,0.196,0.161,0,0.211,0,0
improve_contrast: true
#__________________________________________________________________________#
#------------------ Cam-1 DETECT configuration ---------------------------#
detect:
enabled: true
width: 1280
height: 720
fps: 5
#__________________________________________________________________________#
#------------------ Cam-1 DETECT configuration ---------------------------#
record:
retain:
days: 0
mode: all
alerts:
retain:
days: 30
pre_capture: 10
post_capture: 15
detections:
retain:
days: 30
pre_capture: 10
post_capture: 15
live:
stream_name: Cam-1-s
############################################################################
#============================== CAM-2 GARAGE CAMERA =======================#
############################################################################
Cam-2:
#__________________________________________________________________________#
#------------------ Web Interface ----------------------------------------#
webui_url: http://192.168.2.48/
#__________________________________________________________________________#
#------------------ Cam-2 FFMPEG configuration ----------------------------#
ffmpeg:
inputs:
- path: rtsp://хх@192.168.2.48/Streaming/Channels/101
roles:
- record
- path: rtsp://хх@192.168.2.48/Streaming/Channels/102
roles:
- detect
output_args:
record: preset-record-generic-audio-copy
#__________________________________________________________________________#
#------------------ Cam-2 OBJECTS configuration ---------------------------#
objects:
track:
- person
filters:
person:
# min_area: 1000 # minimum width*height (def - 0)
# max_area: 70000 # maximum width*height (def - 24000000)
# min_ratio: 0.2 # minimum width/height (def - 0)
# max_ratio: 2.0 # maximum width/height (def - 24000000)
# min_score: 0.3 # minimum score for the object to initiate tracking (def - 0.5)
# threshold: 0.7 # minimum decimal percentage for tracked object's e (def - 0.7)
mask:
- 0.563,0.429,0.623,0.42,0.652,0.533,0.623,0.606,0.588,0.602
- 0.353,0.4,0.42,0.397,0.477,0.987,0.289,0.989
#__________________________________________________________________________#
#------------------ Cam-2 MOTION configuration ----------------------------#
motion:
threshold: 20
contour_area: 40
mask:
- 186,409,186,432,27,432,27,409
- 768,0,768,77,641,73,537,42,262,56,263,97,0,138,0,0
#__________________________________________________________________________#
#------------------ Cam-2 DETECT configuration ----------------------------#
detect:
enabled: true
width: 768
height: 432
fps: 5
#__________________________________________________________________________#
#------------------ Cam-2 LIVE View configuration -------------------------#
live:
stream_name: Cam-2-s
############################################################################
#============================== CAM-3 UTILITY ROOM ========================#
############################################################################
Cam-3:
#__________________________________________________________________________#
#------------------ Web Interface ----------------------------------------#
webui_url: http://192.168.2.47/
#__________________________________________________________________________#
#------------------ Cam-3 FFMPEG configuration ----------------------------#
ffmpeg:
inputs:
- path: rtsp://хх@192.168.2.47:554/cam/realmonitor?channel=1&subtype=0
roles:
- record
- path: rtsp://хх@192.168.2.47:554/cam/realmonitor?channel=1&subtype=1
roles:
- detect
output_args:
record: preset-record-generic-audio-copy
#__________________________________________________________________________#
#------------------ Cam-3 OBJECTS configuration ---------------------------#
objects:
track:
- person
#__________________________________________________________________________#
#------------------ Cam-3 MOTION configuration ----------------------------#
motion:
threshold: 25
contour_area: 50
mask: 0.326,0.055,0.325,0,0,0,0,0.054
detect:
enabled: true
width: 704
height: 576
fps: 5
#__________________________________________________________________________#
#------------------ Cam-3 LIVE View configuration -------------------------#
live:
stream_name: Cam-3-s
############################################################################
#============================== CAM-4 WORKSHOP ============================#
############################################################################
Cam-4: # <------ Camera 4 Workshop
#__________________________________________________________________________#
#------------------ Web Interface ----------------------------------------#
webui_url: http://192.168.2.35/
#__________________________________________________________________________#
#------------------ Cam-4 FFMPEG configuration ----------------------------#
ffmpeg:
inputs:
- path: rtsp://хх@192.168.2.35:554/cam/realmonitor?channel=1&subtype=0
roles:
- record
- path: rtsp://хх@192.168.2.35:554/cam/realmonitor?channel=1&subtype=1
roles:
- detect
output_args:
record: preset-record-generic-audio-copy
#__________________________________________________________________________#
#------------------ Cam-4 OBJECTS configuration ---------------------------#
objects:
track:
- person
- cat
filters:
person:
min_area: 4500 # minimum width*height (def - 0)
max_area: 30000 # maximum width*height (def - 24 000 000)
min_ratio: 0.2 # minimum width/height (def - 0)
max_ratio: 1.0 # maximum width/height (def - 24000000)
min_score: 0.4 # minimum score for the object (def - 0.5)
threshold: 0.7 # minimum decimal percentage for tracked object's (def - 0.7)
mask: 0.658,0.567,0.655,0.439,0.711,0.438,0.717,0.566 # mask to prevent object type from being detected
cat:
min_area: 200 # minimum width*height (def - 0)
max_area: 1000 # maximum width*height (def - 24000000)
min_ratio: 0.2 # minimum width/height (def - 0)
max_ratio: 4.0 # maximum width/height (def - 24000000)
min_score: 0.2 # minimum score for the object (def - 0.5)
threshold: 0.6 # minimum decimal percentage for tracked object's (def - 0.7)
# mask: 0,0,1000,0,1000,200,0,200 # mask to prevent this object type from being detected
#__________________________________________________________________________#
#------------------ Cam-4 MOTION configuration ----------------------------#
motion:
threshold: 25
contour_area: 10
mask:
- 1,0.066,1,0,0,0,0,0.066
- 0.637,0.374,0.735,0.374,0.737,0.566,0.642,0.567
- 0.665,0.066,0.665,0.305,0.858,0.349,0.997,0.366,0.998,0.069
- 0.251,0.066,0.259,0.381,0.398,0.374,0.386,0.064
- -0.001,0.344,0.256,0.338,0.254,0.064,0.002,0.066
improve_contrast: true
detect:
enabled: true
width: 704
height: 576
fps: 5
#__________________________________________________________________________#
#------------------ Cam-4 LIVE View configuration -------------------------#
live:
stream_name: Cam-4-s
############################################################################
#============================== CAM-5 STORAGE =============================#
############################################################################
Cam-5:
#__________________________________________________________________________#
#------------------ Web Interface ----------------------------------------#
webui_url: http://192.168.2.49/
#__________________________________________________________________________#
#------------------ Cam-5 FFMPEG configuration ----------------------------#
ffmpeg:
inputs:
- path: rtsp://хх@192.168.2.49:554/cam/realmonitor?channel=1&subtype=0
roles:
- record
- path: rtsp://хх@192.168.2.49:554/cam/realmonitor?channel=1&subtype=1
roles:
- detect
output_args:
record: preset-record-generic-audio-copy
#__________________________________________________________________________#
#------------------ Cam-5 OBJECTS configuration ---------------------------#
objects:
track:
- person
- cat
# filters:
# person:
# min_area: 5000 # minimum width*height (def - 0)
# max_area: 30000 # maximum width*height (def - 24 000 000)
# min_ratio: 0.2 # minimum width/height (def - 0)
# max_ratio: 1.0 # maximum width/height (def - 24000000)
# min_score: 0.4 # minimum score for the object (def - 0.5)
# threshold: 0.7 # minimum decimal percentage for tracked object's (def - 0.7)
# mask: 0,0,1000,0,1000,200,0,200 # mask to prevent object type from being detected
# cat:
# min_area: 200 # minimum width*height (def - 0)
# max_area: 4000 # maximum width*height (def - 24000000)
# min_ratio: 0.2 # minimum width/height (def - 0)
# max_ratio: 4.0 # maximum width/height (def - 24000000)
# min_score: 0.2 # minimum score for the object (def - 0.5)
# threshold: 0.6 # minimum decimal percentage for tracked object's (def - 0.7)
# mask: 0,0,1000,0,1000,200,0,200 # mask to prevent this object type from being detected
#__________________________________________________________________________#
#------------------ Cam-5 MOTION configuration ----------------------------#
motion:
threshold: 20
contour_area: 10
improve_contrast: true
mask:
- 199,189,372,132,704,363,704,0,275,0,0,0,0,134,0,269
#__________________________________________________________________________#
#------------------ Cam-5 DETECT configuration ----------------------------#
detect:
enabled: true
width: 704
height: 576
fps: 5
#__________________________________________________________________________#
#------------------ Cam-5 LIVE View configuration -------------------------#
live:
stream_name: Cam-5-s
###########################################################################
###########################################################################
# END OF CONFIG
version: 0.15-1Relevant Frigate log outputThere are no applicable log messagesRelevant go2rtc log outputThere are no applicable log messagesFrigate statsNo response Operating systemHome Assistant OS Install methodHome Assistant Add-on docker-compose file or Docker CLI command...Object DetectorCoral Screenshots of the Frigate UI's System metrics pagesAny other information that may be helpfulNo response |
Replies: 4 comments 4 replies
|
Where are you viewing the clips to know of the recordings were saved or not? |
|
Thanks!!! |
|
I have M.2 Coral now. |







While recordings are saved, the video times are still cut to when the object was detected as this is an object specific video. You can use the button in the top right to go to the history view for full access