QUOTE(WildChai @ Oct 16 2023, 09:23 AM)
I'm actually starting to look into it. Will be integrated with HA also. From initial guide review... Yes... Looks complicated. Any luck on your side getting it up? What's the roadblock you faced?
Are you planning on getting a tpu to go with it?
I already bought the Coral TPU USB version from Amazon.
Wish there was a Config GUI larh like Scrypted.
So far i did manage to get it running yesterday and its running for a couple cameras right now (waiting for my larger POE switch to arrive so that i can migrate from NVR for the rest). Having to set what to detect and where you want to focus on (masking and zones) all involved a lot of tweaking and customization.
Still need to play around to get MQTT to send motion event to Scrypted so that i dont have to waste resources for second round of motion detection. I attached my current code, still need to tweak stuff but this for now works, i will enable full 24/7 recording but now for testing i am just using clips and i do get them and can see them in the webUI.
CODE
mqtt:
enabled: False
detectors: # <---- add detectors
coral:
type: edgetpu
device: usb
ffmpeg:
hwaccel_args: preset-nvidia-h264
detect:
# Optional: width of the frame for the input with the detect role (default: shown below)
width: 640
# Optional: height of the frame for the input with the detect role (default: shown below)
height: 360
# Optional: desired fps for your camera for the input with the detect role (default: shown below)
# NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.
fps: 7
# Optional: enables detection for the camera (default: True)
enabled: True
# Optional: Number of frames without a detection before Frigate considers an object to be gone. (default: 5x the frame rate)
max_disappeared: 35
# Optional: Configuration for stationary object tracking
stationary:
# Optional: Frequency for confirming stationary objects (default: shown below)
# When set to 0, object detection will not confirm stationary objects until movement is detected.
# If set to 10, object detection will run to confirm the object still exists on every 10th frame.
interval: 0
# Optional: Number of frames without a position change for an object to be considered stationary (default: 10x the frame rate or 10s)
threshold: 50
# Optional: Define a maximum number of frames for tracking a stationary object (default: not set, track forever)
# This can help with false positives for objects that should only be stationary for a limited amount of time.
# It can also be used to disable stationary object tracking. For example, you may want to set a value for person, but leave
# car at the default.
# WARNING: Setting these values overrides default behavior and disables stationary object tracking.
# There are very few situations where you would want it disabled. It is NOT recommended to
# copy these values from the example config into your config unless you know they are needed.
max_frames:
# Optional: Default for all object types (default: not set, track forever)
default: 3000
# Optional: Object specific values
objects:
person: 1000
objects:
# Optional: list of objects to track from labelmap.txt (default: shown below)
track:
- person
- car
- dog
- cat
record:
# Optional: Enable recording (default: shown below)
# WARNING: If recording is disabled in the config, turning it on via
# the UI or MQTT later will have no effect.
enabled: True
# Optional: Number of minutes to wait between cleanup runs (default: shown below)
# This can be used to reduce the frequency of deleting recording segments from disk if you want to minimize i/o
expire_interval: 60
# Optional: Retention settings for recording
retain:
# Optional: Number of days to retain recordings regardless of events (default: shown below)
# NOTE: This should be set to 0 and retention should be defined in events section below
# if you only want to retain recordings of events.
days: 0
# Optional: Mode for retention. Available options are: all, motion, and active_objects
# all - save all recording segments regardless of activity
# motion - save all recordings segments with any detected motion
# active_objects - save all recording segments with active/moving objects
# NOTE: this mode only applies when the days setting above is greater than 0
mode: all
# Optional: Event recording settings
events:
# Optional: Number of seconds before the event to include (default: shown below)
pre_capture: 5
# Optional: Number of seconds after the event to include (default: shown below)
post_capture: 5
# Optional: Objects to save recordings for. (default: all tracked objects)
objects:
- person
- car
# Optional: Restrict recordings to objects that entered any of the listed zones (default: no required zones)
# Optional: Retention settings for recordings of events
retain:
# Required: Default retention days (default: shown below)
default: 1
# Optional: Mode for retention. (default: shown below)
# all - save all recording segments for events regardless of activity
# motion - save all recordings segments for events with any detected motion
# active_objects - save all recording segments for event with active/moving objects
#
# NOTE: If the retain mode for the camera is more restrictive than the mode configured
# here, the segments will already be gone by the time this mode is applied.
# For example, if the camera retain mode is "motion", the segments without motion are
# never stored, so setting the mode to "all" here won't bring them back.
mode: motion
# Optional: Per object retention days
objects:
person: 2
go2rtc:
rtsp:
username: ""
password: ""
streams:
Road_Camera:
- "ffmpeg:http://192.168.0.70/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=1&password=1#video=copy#audio=copy#audio=opus"
Road_Camera_sub:
- "ffmpeg:http://192.168.0.70/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=1&password=1"
Gate_Camera:
- "ffmpeg:http://192.168.0.70/flv?port=1935&app=bcs&stream=channel1_main.bcs&user=1&password=1#video=copy#audio=copy#audio=opus"
Gate_Camera_sub:
- "ffmpeg:http://192.168.0.70/flv?port=1935&app=bcs&stream=channel1_ext.bcs&user=1&password=1"
webrtc:
candidates:
- 192.168.0.10:8555
- stun:8555
cameras:
Gate_Camera:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/Gate_Camera?video=copy&audio=aac
input_args: preset-rtsp-restream
roles:
- record
- path: rtsp://127.0.0.1:8554/Gate_Camera_sub?video=copy
input_args: preset-rtsp-restream
roles:
- detect
motion:
mask:
- 0,185,365,111,610,109,592,360,0,360
live:
stream_name: Gate_Camera_sub
Road_Camera:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/Road_Camera?video=copy&audio=aac
input_args: preset-rtsp-restream
roles:
- record
- path: rtsp://127.0.0.1:8554/Road_Camera_sub?video=copy
input_args: preset-rtsp-restream
roles:
- detect
live:
stream_name: Road_Camera_sub