forked from Github/frigate
Compare commits
7 Commits
v0.10.0-be
...
v0.10.0-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
889835a59b | ||
|
|
ee01396b36 | ||
|
|
334e28fe54 | ||
|
|
6b2bae040c | ||
|
|
95ab22d411 | ||
|
|
4e52461aa9 | ||
|
|
7934f8699f |
@@ -162,8 +162,8 @@ detect:
|
|||||||
# Optional: Frequency for running detection on stationary objects (default: shown below)
|
# Optional: Frequency for running detection on stationary objects (default: shown below)
|
||||||
# When set to 0, object detection will never be run on stationary objects. If set to 10, it will be run on every 10th frame.
|
# When set to 0, object detection will never be run on stationary objects. If set to 10, it will be run on every 10th frame.
|
||||||
stationary_interval: 0
|
stationary_interval: 0
|
||||||
# Optional: Number of frames without a position change for an object to be considered stationary (default: shown below)
|
# Optional: Number of frames without a position change for an object to be considered stationary (default: 10x the frame rate or 10s)
|
||||||
stationary_threshold: 10
|
stationary_threshold: 50
|
||||||
|
|
||||||
# Optional: Object configuration
|
# Optional: Object configuration
|
||||||
# NOTE: Can be overridden at the camera level
|
# NOTE: Can be overridden at the camera level
|
||||||
|
|||||||
@@ -167,13 +167,17 @@ cameras:
|
|||||||
roles:
|
roles:
|
||||||
- detect
|
- detect
|
||||||
- rtmp
|
- rtmp
|
||||||
- record # <----- Add role
|
- path: rtsp://10.0.10.10:554/high_res_stream # <----- Add high res stream
|
||||||
|
roles:
|
||||||
|
- record
|
||||||
detect: ...
|
detect: ...
|
||||||
record: # <----- Enable recording
|
record: # <----- Enable recording
|
||||||
enabled: True
|
enabled: True
|
||||||
motion: ...
|
motion: ...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you don't have separate streams for detect and record, you would just add the record role to the list on the first input.
|
||||||
|
|
||||||
By default, Frigate will retain video of all events for 10 days. The full set of options for recording can be found [here](/configuration/index#full-configuration-reference).
|
By default, Frigate will retain video of all events for 10 days. The full set of options for recording can be found [here](/configuration/index#full-configuration-reference).
|
||||||
|
|
||||||
### Step 8: Enable snapshots (optional)
|
### Step 8: Enable snapshots (optional)
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ Message published for each changed event. The first message is published when th
|
|||||||
"thumbnail": null,
|
"thumbnail": null,
|
||||||
"has_snapshot": false,
|
"has_snapshot": false,
|
||||||
"has_clip": false,
|
"has_clip": false,
|
||||||
|
"stationary": false, // whether or not the object is considered stationary
|
||||||
"motionless_count": 0, // number of frames the object has been motionless
|
"motionless_count": 0, // number of frames the object has been motionless
|
||||||
"position_changes": 2 // number of times the object has moved from a stationary position
|
"position_changes": 2 // number of times the object has moved from a stationary position
|
||||||
},
|
},
|
||||||
@@ -78,6 +79,7 @@ Message published for each changed event. The first message is published when th
|
|||||||
"thumbnail": null,
|
"thumbnail": null,
|
||||||
"has_snapshot": false,
|
"has_snapshot": false,
|
||||||
"has_clip": false,
|
"has_clip": false,
|
||||||
|
"stationary": false, // whether or not the object is considered stationary
|
||||||
"motionless_count": 0, // number of frames the object has been motionless
|
"motionless_count": 0, // number of frames the object has been motionless
|
||||||
"position_changes": 2 // number of times the object has changed position
|
"position_changes": 2 // number of times the object has changed position
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,7 +178,6 @@ class DetectConfig(FrigateBaseModel):
|
|||||||
ge=0,
|
ge=0,
|
||||||
)
|
)
|
||||||
stationary_threshold: Optional[int] = Field(
|
stationary_threshold: Optional[int] = Field(
|
||||||
default=10,
|
|
||||||
title="Number of frames without a position change for an object to be considered stationary",
|
title="Number of frames without a position change for an object to be considered stationary",
|
||||||
ge=1,
|
ge=1,
|
||||||
)
|
)
|
||||||
@@ -771,6 +770,11 @@ class FrigateConfig(FrigateBaseModel):
|
|||||||
if camera_config.detect.max_disappeared is None:
|
if camera_config.detect.max_disappeared is None:
|
||||||
camera_config.detect.max_disappeared = max_disappeared
|
camera_config.detect.max_disappeared = max_disappeared
|
||||||
|
|
||||||
|
# Default stationary_threshold configuration
|
||||||
|
stationary_threshold = camera_config.detect.fps * 10
|
||||||
|
if camera_config.detect.stationary_threshold is None:
|
||||||
|
camera_config.detect.stationary_threshold = stationary_threshold
|
||||||
|
|
||||||
# FFMPEG input substitution
|
# FFMPEG input substitution
|
||||||
for input in camera_config.ffmpeg.inputs:
|
for input in camera_config.ffmpeg.inputs:
|
||||||
input.path = input.path.format(**FRIGATE_ENV_VARS)
|
input.path = input.path.format(**FRIGATE_ENV_VARS)
|
||||||
|
|||||||
@@ -193,6 +193,8 @@ class TrackedObject:
|
|||||||
"box": self.obj_data["box"],
|
"box": self.obj_data["box"],
|
||||||
"area": self.obj_data["area"],
|
"area": self.obj_data["area"],
|
||||||
"region": self.obj_data["region"],
|
"region": self.obj_data["region"],
|
||||||
|
"stationary": self.obj_data["motionless_count"]
|
||||||
|
> self.camera_config.detect.stationary_threshold,
|
||||||
"motionless_count": self.obj_data["motionless_count"],
|
"motionless_count": self.obj_data["motionless_count"],
|
||||||
"position_changes": self.obj_data["position_changes"],
|
"position_changes": self.obj_data["position_changes"],
|
||||||
"current_zones": self.current_zones.copy(),
|
"current_zones": self.current_zones.copy(),
|
||||||
|
|||||||
@@ -78,9 +78,9 @@ class ObjectTracker:
|
|||||||
}
|
}
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# if there are less than stationary_threshold entries for the position, add the bounding box
|
# if there are less than 10 entries for the position, add the bounding box
|
||||||
# and recompute the position box
|
# and recompute the position box
|
||||||
if len(position["xmins"]) < self.detect_config.stationary_threshold:
|
if len(position["xmins"]) < 10:
|
||||||
position["xmins"].append(xmin)
|
position["xmins"].append(xmin)
|
||||||
position["ymins"].append(ymin)
|
position["ymins"].append(ymin)
|
||||||
position["xmaxs"].append(xmax)
|
position["xmaxs"].append(xmax)
|
||||||
|
|||||||
@@ -184,10 +184,7 @@ class BirdsEyeFrameManager:
|
|||||||
if self.mode == BirdseyeModeEnum.continuous:
|
if self.mode == BirdseyeModeEnum.continuous:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if (
|
if self.mode == BirdseyeModeEnum.motion and motion_box_count > 0:
|
||||||
self.mode == BirdseyeModeEnum.motion
|
|
||||||
and object_box_count + motion_box_count > 0
|
|
||||||
):
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if self.mode == BirdseyeModeEnum.objects and object_box_count > 0:
|
if self.mode == BirdseyeModeEnum.objects and object_box_count > 0:
|
||||||
@@ -418,7 +415,7 @@ def output_frames(config: FrigateConfig, video_output_queue):
|
|||||||
):
|
):
|
||||||
if birdseye_manager.update(
|
if birdseye_manager.update(
|
||||||
camera,
|
camera,
|
||||||
len(current_tracked_objects),
|
len([o for o in current_tracked_objects if not o["stationary"]]),
|
||||||
len(motion_boxes),
|
len(motion_boxes),
|
||||||
frame_time,
|
frame_time,
|
||||||
frame,
|
frame,
|
||||||
|
|||||||
@@ -507,8 +507,8 @@ def process_frames(
|
|||||||
stationary_object_ids = [
|
stationary_object_ids = [
|
||||||
obj["id"]
|
obj["id"]
|
||||||
for obj in object_tracker.tracked_objects.values()
|
for obj in object_tracker.tracked_objects.values()
|
||||||
# if there hasn't been motion for N frames
|
# if there hasn't been motion for 10 frames
|
||||||
if obj["motionless_count"] >= detect_config.stationary_threshold
|
if obj["motionless_count"] >= 10
|
||||||
# and it isn't due for a periodic check
|
# and it isn't due for a periodic check
|
||||||
and (
|
and (
|
||||||
detect_config.stationary_interval == 0
|
detect_config.stationary_interval == 0
|
||||||
|
|||||||
@@ -29,12 +29,8 @@ function Camera({ name, conf }) {
|
|||||||
const { payload: snapshotValue, send: sendSnapshots } = useSnapshotsState(name);
|
const { payload: snapshotValue, send: sendSnapshots } = useSnapshotsState(name);
|
||||||
const href = `/cameras/${name}`;
|
const href = `/cameras/${name}`;
|
||||||
const buttons = useMemo(() => {
|
const buttons = useMemo(() => {
|
||||||
const result = [{ name: 'Events', href: `/events?camera=${name}` }];
|
return [{ name: 'Events', href: `/events?camera=${name}` }, { name: 'Recordings', href: `/recording/${name}` }];
|
||||||
if (conf.record.enabled) {
|
}, [name]);
|
||||||
result.push({ name: 'Recordings', href: `/recording/${name}` });
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}, [name, conf.record.enabled]);
|
|
||||||
const icons = useMemo(
|
const icons = useMemo(
|
||||||
() => [
|
() => [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ describe('Cameras Route', () => {
|
|||||||
|
|
||||||
expect(screen.queryByLabelText('Loading…')).not.toBeInTheDocument();
|
expect(screen.queryByLabelText('Loading…')).not.toBeInTheDocument();
|
||||||
|
|
||||||
expect(screen.queryAllByText('Recordings')).toHaveLength(1);
|
expect(screen.queryAllByText('Recordings')).toHaveLength(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('buttons toggle detect, clips, and snapshots', async () => {
|
test('buttons toggle detect, clips, and snapshots', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user