Simplify highlight API for automation

This commit is contained in:
human insan
2026-08-27 23:09:15 +01:00
parent df4153a9dd
commit 890e40f3cf
2 changed files with 37 additions and 11 deletions
+8 -6
View File
@@ -85,23 +85,25 @@ To create a highlight in the player, play the recording, press **Mark start**,
move to the end of the interesting part, press **Mark end**, enter a name, and
press **Add highlight**. Highlights are saved in `media-mp4/highlights.json`.
The highlight API is intentionally simple. An AI or script can list highlights:
The highlight API is intentionally simple. An AI agent can list highlights:
```sh
curl http://127.0.0.1:8765/api/highlights
```
It can append a highlight with a date, seconds from midnight, and a label:
It can append one using normal date and clock values:
```sh
curl -X POST http://127.0.0.1:8765/api/highlights \
-H 'Content-Type: application/json' \
-d '{"date":"20260827","start":34000,"end":34120,"label":"Person at entrance"}'
-d '{"date":"2026-08-27","start_time":"09:26:40","end_time":"09:28:40","title":"Person at entrance"}'
```
The API stores the entry without changing any video. Times are seconds from
midnight, so `34000` means `09:26:40`. This makes it straightforward for an
AI to append detections, labels, or review segments programmatically.
The API stores the entry without changing any video. `start` and `end` may also
be used as seconds from midnight, and `duration` may be used instead of an end
time. For example, `{"start":"09:26:40","duration":120}` creates a
two-minute highlight. This makes it straightforward for an AI to append
detections, labels, or review segments programmatically.
## Custom Folders And Ports