[Question]: API Difference b/w /api/events and /api/events/summary #11343
-
What is your question:Not sure if this topic were previously covered. I would like to count detected objects during a day. Wondering what is the difference between API of events and events/summary. Here below are outputs of both. Any reason why outputs are different? Which API should I use to count the detected objects during a day? It seems sometime summary matches WebUI output but today's WebUI output doesn't match both of them.
my config.yml is like this. mqtt: go2rtc: ffmpeg: birdseye: detectors: record: cameras: objects:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Really confused at end of the day. $ date |
Beta Was this translation helpful? Give feedback.
-
time zone of docker of frigate and OS are same as below. Still confused which one should I use to count the objects. Does the period to search differ depending on the command (events/summary and events)? $ docker ps $ curl -s "http://localhost:5000/api/events/summary" | jq '[.[] | select(.day == "2024-05-19" and .camera == "CAM") | {day: .day, label: .label, count: .count}]' $ cat docker-compose.yml go2rtc: ffmpeg: birdseye: detectors: record: snapshots: timestamp_style: cameras: objects:
|
Beta Was this translation helpful? Give feedback.
-
Just decided to use just events API for last one hour instead of summary of the day as below. Somehow, it seems the output is accurate when it runs every 1 hour. http://localhost:5000/api/events?cameras=$CAM&after=$(date +%s -d '1 hour ago')&before=$(date +%s)" | jq -c --arg now "$(date +'%Y/%m/%d %H:%M:%S')" '[{"Date/Time": $now}] + (group_by(.label) | map({label: .[0].label, count: length}))' |
Beta Was this translation helpful? Give feedback.
Just decided to use just events API for last one hour instead of summary of the day as below. Somehow, it seems the output is accurate when it runs every 1 hour.
http://localhost:5000/api/events?cameras=$CAM&after=$(date +%s -d '1 hour ago')&before=$(date +%s)" | jq -c --arg now "$(date +'%Y/%m/%d %H:%M:%S')" '[{"Date/Time": $now}] + (group_by(.label) | map({label: .[0].label, count: length}))'