Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added documentation for time-lapse export #9802

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
c80b814
increment version
blakeblackshear Jan 31, 2024
cfda531
Write a low resolution low fps stream from decoded frames (#8673)
NickM-27 Dec 3, 2023
c716e4b
Ensure final frame in preview is not duplicated
NickM-27 Dec 4, 2023
b1cd5f0
Add external sub label as timeline entry (#8855)
NickM-27 Dec 5, 2023
696434b
Initial framework for new UI with React/Typescript (#8885)
hawkeye217 Dec 8, 2023
d2d1278
Remove rtmp (#8941)
NickM-27 Dec 12, 2023
0e6528a
Add export page in to new web UI (#8929)
NickM-27 Dec 12, 2023
c1f14e2
Support config editor in new webUI (#8928)
NickM-27 Dec 12, 2023
4524d94
Add initial implementation of history view in new webui framework (#8…
NickM-27 Dec 13, 2023
1961a0a
Support storage page in new ui (#8948)
NickM-27 Dec 14, 2023
fbe5865
Improve review grid (#8953)
NickM-27 Dec 14, 2023
e3387de
Add live views to new webui (#8970)
NickM-27 Dec 15, 2023
3a33090
Review grid playback (#8971)
NickM-27 Dec 16, 2023
a2c6f45
Camera dashboard (#8981)
NickM-27 Dec 16, 2023
bdebb99
Use new UI (#8983)
blakeblackshear Dec 16, 2023
f8d114c
Webui cleanups (#8991)
NickM-27 Dec 20, 2023
1a27c7d
Fix birdseye memory leak (#8992)
NickM-27 Dec 20, 2023
2236ae5
Add jsmpeg support to new webUI and make birdseye default for live pa…
NickM-27 Dec 20, 2023
7bec162
Scrubber UI component (#9036)
hawkeye217 Dec 21, 2023
feb3ee0
Allow deletion of history items (#9030)
NickM-27 Dec 21, 2023
a1e5c65
Add support for filtering history page and add support for creating t…
NickM-27 Dec 21, 2023
d430b99
Autotracking: better handle objects that touch frame edges (#9062)
hawkeye217 Dec 28, 2023
928dbd8
Update dashboard cameras dynamically (#9100)
NickM-27 Dec 29, 2023
15f79d9
Remove deprecated RTMP port 1935 (#9137)
baylanger Dec 31, 2023
9efb6b1
Add mse live view (#9117)
NickM-27 Dec 31, 2023
9a0dfa7
Add logs to new webui (#9118)
NickM-27 Dec 31, 2023
a946a8f
Refactor history viewer to show player / timeline for full hour and …
NickM-27 Dec 31, 2023
0ee81c7
Automatically detect hwaccel args (#9142)
NickM-27 Jan 1, 2024
160e331
Improve desktop timeline view (#9150)
NickM-27 Jan 1, 2024
d2ab44c
Reactify MSE player component (#9163)
hawkeye217 Jan 3, 2024
6dd9d54
UI Fixes (#9177)
NickM-27 Jan 3, 2024
9c4b691
Add graph showing motion and object activity to history timeline desk…
NickM-27 Jan 3, 2024
af3f6da
Improve graph using pandas (#9234)
NickM-27 Jan 31, 2024
c581947
Web & ffmpeg bug fixes (#9525)
NickM-27 Feb 1, 2024
2d0864c
Adjust kalman filter used for norfair tracker (#9538)
NickM-27 Feb 2, 2024
3df8b58
Small autotracking changes (#9571)
hawkeye217 Feb 2, 2024
f431086
WebUI Improvements and fixes (#9613)
NickM-27 Feb 5, 2024
92a0705
show version in production builds (#9602)
hawkeye217 Feb 5, 2024
f6a4c2a
bump go2rtc to 1.8.5 (#9487)
sylv3rblade Feb 5, 2024
64988c9
Streamline live view (#9772)
NickM-27 Feb 10, 2024
44d8cdb
AMD GPU support with the rocm detector and YOLOv8 pretrained model do…
harakas Feb 10, 2024
2d22800
Set aspect ratios on live display (#9780)
hawkeye217 Feb 10, 2024
cad7cdf
download-models: fix startup failure caused by unset variable (#9781)
harakas Feb 10, 2024
cd5f4b1
detectors/edgetpu: yolov8 support (#9782)
harakas Feb 10, 2024
9de09f6
fix tooltips on mobile and make 2-row cameras full height (#9787)
hawkeye217 Feb 11, 2024
bcbea8d
Create API to create gif from previews and show instead of still thum…
NickM-27 Feb 11, 2024
b9e20fc
Fix gif creation and add better error handling (#9797)
NickM-27 Feb 11, 2024
d59886d
Added documentation for time-lapse export
mike2307 Feb 11, 2024
3984b7b
Write a low resolution low fps stream from decoded frames (#8673)
NickM-27 Dec 3, 2023
7232ec7
Ensure final frame in preview is not duplicated
NickM-27 Dec 4, 2023
f68de5a
Add external sub label as timeline entry (#8855)
NickM-27 Dec 5, 2023
3ea00e3
Initial framework for new UI with React/Typescript (#8885)
hawkeye217 Dec 8, 2023
e1dd4c8
Remove rtmp (#8941)
NickM-27 Dec 12, 2023
dbd628f
Add export page in to new web UI (#8929)
NickM-27 Dec 12, 2023
ac5642c
Support config editor in new webUI (#8928)
NickM-27 Dec 12, 2023
3aaa8ae
Add initial implementation of history view in new webui framework (#8…
NickM-27 Dec 13, 2023
f35a232
Support storage page in new ui (#8948)
NickM-27 Dec 14, 2023
33fcca2
Improve review grid (#8953)
NickM-27 Dec 14, 2023
27906e5
Add live views to new webui (#8970)
NickM-27 Dec 15, 2023
5006ecc
Review grid playback (#8971)
NickM-27 Dec 16, 2023
e2cac05
Camera dashboard (#8981)
NickM-27 Dec 16, 2023
76767ec
Use new UI (#8983)
blakeblackshear Dec 16, 2023
5beb7da
Webui cleanups (#8991)
NickM-27 Dec 20, 2023
bd2721a
Fix birdseye memory leak (#8992)
NickM-27 Dec 20, 2023
1e00dc6
Add jsmpeg support to new webUI and make birdseye default for live pa…
NickM-27 Dec 20, 2023
9f679ff
Scrubber UI component (#9036)
hawkeye217 Dec 21, 2023
876bfc4
Allow deletion of history items (#9030)
NickM-27 Dec 21, 2023
44e0c3d
Add support for filtering history page and add support for creating t…
NickM-27 Dec 21, 2023
bd3822f
Autotracking: better handle objects that touch frame edges (#9062)
hawkeye217 Dec 28, 2023
039c96a
Update dashboard cameras dynamically (#9100)
NickM-27 Dec 29, 2023
4fd146c
Remove deprecated RTMP port 1935 (#9137)
baylanger Dec 31, 2023
ed34857
Add mse live view (#9117)
NickM-27 Dec 31, 2023
bacd839
Add logs to new webui (#9118)
NickM-27 Dec 31, 2023
5ccb52d
Refactor history viewer to show player / timeline for full hour and …
NickM-27 Dec 31, 2023
ba67337
Automatically detect hwaccel args (#9142)
NickM-27 Jan 1, 2024
b0d534d
Improve desktop timeline view (#9150)
NickM-27 Jan 1, 2024
cfc5516
Reactify MSE player component (#9163)
hawkeye217 Jan 3, 2024
67f801b
UI Fixes (#9177)
NickM-27 Jan 3, 2024
df19e13
Add graph showing motion and object activity to history timeline desk…
NickM-27 Jan 3, 2024
21e982b
Improve graph using pandas (#9234)
NickM-27 Jan 31, 2024
45be364
Web & ffmpeg bug fixes (#9525)
NickM-27 Feb 1, 2024
9dafab8
Adjust kalman filter used for norfair tracker (#9538)
NickM-27 Feb 2, 2024
bd88782
Small autotracking changes (#9571)
hawkeye217 Feb 2, 2024
3aa6abd
WebUI Improvements and fixes (#9613)
NickM-27 Feb 5, 2024
380cc45
show version in production builds (#9602)
hawkeye217 Feb 5, 2024
29f564c
bump go2rtc to 1.8.5 (#9487)
sylv3rblade Feb 5, 2024
f2bd8e6
Streamline live view (#9772)
NickM-27 Feb 10, 2024
cb38d20
AMD GPU support with the rocm detector and YOLOv8 pretrained model do…
harakas Feb 10, 2024
f95b86c
Set aspect ratios on live display (#9780)
hawkeye217 Feb 10, 2024
d5a076a
download-models: fix startup failure caused by unset variable (#9781)
harakas Feb 10, 2024
2beab66
detectors/edgetpu: yolov8 support (#9782)
harakas Feb 10, 2024
c20f2d8
fix tooltips on mobile and make 2-row cameras full height (#9787)
hawkeye217 Feb 11, 2024
5294ab2
Create API to create gif from previews and show instead of still thum…
NickM-27 Feb 11, 2024
8823818
Fix gif creation and add better error handling (#9797)
NickM-27 Feb 11, 2024
7f30087
Added documentation for time-lapse export
mike2307 Feb 11, 2024
404749c
Merge branch 'timelape-vaapi-file-size' of github.com:mike2307/frigat…
mike2307 Feb 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve graph using pandas (#9234)
* Ensure viewport is always full screen

* Protect against hour with no cards and ensure data is consistent

* Reduce grouped up image refreshes

* Include current hour and fix scrubbing bugginess

* Scroll initially selected timeline in to view

* Expand timelne class type

* Use poster image for preview on video player instead of using separate image view

* Fix available streaming modes

* Incrase timing for grouping timline items

* Fix audio activity listener

* Fix player not switching views correctly

* Use player time to convert to timeline time

* Update sub labels for previous timeline items

* Show mini timeline bar for non selected items

* Rewrite desktop timeline to use separate dynamic video player component

* Extend improvements to mobile as well

* Improve time formatting

* Fix scroll

* Fix no preview case

* Mobile fixes

* Audio toggle fixes

* More fixes for mobile

* Improve scaling of graph motion activity

* Add keyboard shortcut hook and support shortcuts for playback page

* Fix sizing of dialog

* Improve height scaling of dialog

* simplify and fix layout system for timeline

* Fix timeilne items not working

* Implement basic Frigate+ submitting from timeline
  • Loading branch information
NickM-27 authored and mike2307 committed Feb 11, 2024
commit 21e982b3908192c38fd019b8e9042b2a30253296
1 change: 1 addition & 0 deletions docker/main/requirements-wheels.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ numpy == 1.23.*
onvif_zeep == 0.2.12
opencv-python-headless == 4.7.0.*
paho-mqtt == 1.6.*
pandas == 2.1.4
peewee == 3.17.*
peewee_migrate == 1.12.*
psutil == 5.9.*
Expand Down
79 changes: 58 additions & 21 deletions frigate/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import cv2
import numpy as np
import pandas as pd
import pytz
import requests
from flask import (
Expand Down Expand Up @@ -404,6 +405,17 @@ def set_sub_label(id):
new_sub_label = json.get("subLabel")
new_score = json.get("subLabelScore")

if new_sub_label is None:
return make_response(
jsonify(
{
"success": False,
"message": "A sub label must be supplied",
}
),
400,
)

if new_sub_label and len(new_sub_label) > 100:
return make_response(
jsonify(
Expand All @@ -429,6 +441,7 @@ def set_sub_label(id):
)

if not event.end_time:
# update tracked object
tracked_obj: TrackedObject = (
current_app.detected_frames_processor.camera_states[
event.camera
Expand All @@ -438,6 +451,11 @@ def set_sub_label(id):
if tracked_obj:
tracked_obj.obj_data["sub_label"] = (new_sub_label, new_score)

# update timeline items
Timeline.update(
data=Timeline.data.update({"sub_label": (new_sub_label, new_score)})
).where(Timeline.source_id == id).execute()

event.sub_label = new_sub_label

if new_score:
Expand Down Expand Up @@ -753,41 +771,59 @@ def hourly_timeline_activity(camera_name: str):

# set initial start so data is representative of full hour
hours[int(key.timestamp())].append(
{
"date": key.timestamp(),
"count": 0,
"type": "motion",
}
[
key.timestamp(),
0,
False,
]
)

for recording in all_recordings:
if recording.start_time > check:
hours[int(key.timestamp())].append(
{
"date": (key + timedelta(hours=1)).timestamp(),
"count": 0,
"type": "motion",
}
[
(key + timedelta(minutes=59, seconds=59)).timestamp(),
0,
False,
]
)
key = key + timedelta(hours=1)
check = (key + timedelta(hours=1)).timestamp()
hours[int(key.timestamp())].append(
{
"date": key.timestamp(),
"count": 0,
"type": "motion",
}
[
key.timestamp(),
0,
False,
]
)

data_type = "motion" if recording.objects == 0 else "objects"
data_type = recording.objects > 0
count = recording.motion + recording.objects
hours[int(key.timestamp())].append(
{
"date": recording.start_time + (recording.duration / 2),
"count": recording.motion,
"type": data_type,
}
[
recording.start_time + (recording.duration / 2),
0 if count == 0 else np.log2(count),
data_type,
]
)

# resample data using pandas to get activity on minute to minute basis
for key, data in hours.items():
df = pd.DataFrame(data, columns=["date", "count", "hasObjects"])

# set date as datetime index
df["date"] = pd.to_datetime(df["date"], unit="s")
df.set_index(["date"], inplace=True)

# normalize data
df = df.resample("T").mean().fillna(0)

# change types for output
df.index = df.index.astype(int) // (10**9)
df["count"] = df["count"].astype(int)
df["hasObjects"] = df["hasObjects"].astype(bool)
hours[key] = df.reset_index().to_dict("records")

return jsonify(hours)


Expand Down Expand Up @@ -1854,6 +1890,7 @@ def recordings(camera_name):
Recordings.segment_size,
Recordings.motion,
Recordings.objects,
Recordings.duration,
)
.where(
Recordings.camera == camera_name,
Expand Down
21 changes: 12 additions & 9 deletions frigate/timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from multiprocessing.synchronize import Event as MpEvent

from frigate.config import FrigateConfig
from frigate.const import ALL_ATTRIBUTE_LABELS
from frigate.events.maintainer import EventTypeEnum
from frigate.models import Timeline
from frigate.util.builtin import to_relative_box
Expand Down Expand Up @@ -85,12 +84,13 @@ def handle_object_detection(
"""Handle object detection."""
save = False
camera_config = self.config.cameras[camera]
event_id = event_data["id"]

timeline_entry = {
Timeline.timestamp: event_data["frame_time"],
Timeline.camera: camera,
Timeline.source: "tracked_object",
Timeline.source_id: event_data["id"],
Timeline.source_id: event_id,
Timeline.data: {
"box": to_relative_box(
camera_config.detect.width,
Expand All @@ -107,6 +107,16 @@ def handle_object_detection(
"attribute": "",
},
}

# update sub labels for existing entries that haven't been added yet
if (
prev_event_data != None
and prev_event_data["sub_label"] != event_data["sub_label"]
and event_id in self.pre_event_cache.keys()
):
for e in self.pre_event_cache[event_id]:
e[Timeline.data]["sub_label"] = event_data["sub_label"]

if event_type == "start":
timeline_entry[Timeline.class_type] = "visible"
save = True
Expand All @@ -129,13 +139,6 @@ def handle_object_detection(
event_data["attributes"].keys()
)[0]
save = True
elif not prev_event_data.get("sub_label") and event_data.get("sub_label"):
sub_label = event_data["sub_label"][0]

if sub_label not in ALL_ATTRIBUTE_LABELS:
timeline_entry[Timeline.class_type] = "sub_label"
timeline_entry[Timeline.data]["sub_label"] = sub_label
save = True
elif event_type == "end":
timeline_entry[Timeline.class_type] = "gone"
save = True
Expand Down
2 changes: 1 addition & 1 deletion frigate/util/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def auto_detect_hwaccel() -> str:
try:
cuda = False
vaapi = False
resp = requests.get("https://192.168.50.106:1984/api/ffmpeg/hardware", timeout=3)
resp = requests.get("https://127.0.0.1:1984/api/ffmpeg/hardware", timeout=3)

if resp.status_code == 200:
data: dict[str, list[dict[str, str]]] = resp.json()
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/Wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type TWrapperProps = {
};

const Wrapper = ({ children }: TWrapperProps) => {
return <main className="flex flex-col max-h-screen">{children}</main>;
return <main className="flex flex-col h-screen">{children}</main>;
};

export default Wrapper;
Loading