blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
18.09k stars 1.65k forks source link

[RFC] Trigger Clips and Snapshots via API #1063

Closed herostrat closed 1 year ago

herostrat commented 3 years ago

Idea:

Allow triggering of clips and snapshots via external command.

Implementation:

Implement API endpoints for:

The configuration of the created object is according to the user config and therefore the same as triggered via internal detection.

Background/Usecases:

@blakeblackshear is this acceptable or according to the projects vision? I am interested in implementing this myself, so it is no FR

@all Additional ideas and suggestions?


Relevant Issues/Discussions: https://github.com/blakeblackshear/frigate/issues/1040 https://github.com/blakeblackshear/frigate/issues/926 https://github.com/blakeblackshear/frigate/issues/345 https://github.com/blakeblackshear/frigate/discussions/1008

NickM-27 commented 1 year ago

It's in draft PR, will he added in a future version. And yes it should solve what you're describing.

chrisella commented 1 year ago

Great, ok thanks I'll just be patient and wait then.

bagobones commented 1 year ago

Playing around with double-take the ability to force a snapshot / event when someone presses the door bell and is likely looking at it would be very nice for face detection / custom events based on specific people.

I am currently getting the walk up to the doorbell but since the event starts when the person is far away, face detection is very poor.

raintonr commented 1 year ago

I am currently getting the walk up to the doorbell but since the event starts when the person is far away, face detection is very poor.

Sounds like the detection target you have configured is 'person' but you really want a target of 'face'. Then you would also like the target 'face' to be further classified to the actual individual.

Seems like a new feature request and nothing to do with triggering via API.

scaytrase commented 1 year ago

Seems like a new feature request and nothing to do with triggering via API.

as far as I understand @bagobones he doesn't asks for built-in face recognition here, but for a way to make a clip\snapshot with trigger API for doing so (maybe in existing external software we don't know). so looks like relevant use case - trigger clip\snapshot by doorbell press.

bagobones commented 1 year ago

All I am asking for is to trigger an "event" and then integrations like double-take can add sub labels for faces

roger- commented 1 year ago

Adding a related request: ability to trigger a full object detection over the entire frame (perhaps respecting configured masks).

blakeblackshear commented 1 year ago

ability to trigger a full object detection over the entire frame

This might seem like it is related, but it's very different and it wouldn't make sense to do this at the same time as this feature as it would be implemented in completely different parts of the code base. I would open a different request.

NickM-27 commented 1 year ago

ability to trigger a full object detection over the entire frame

This might seem like it is related, but it's very different and it wouldn't make sense to do this at the same time as this feature as it would be implemented in completely different parts of the code base. I would open a different request.

That's my bad, misunderstood the other issue request as a duplicate

Guisin commented 1 year ago

Hello, is there any forecast for this implementation?

chrislauyp commented 1 year ago

@blakeblackshear @herostrat @stephengolub Hi there, Any update in the customer external event feature? Thanks

blakeblackshear commented 1 year ago

It might be a part of 0.13

hawkeye217 commented 1 year ago

It might be a part of 0.13

Would love to see this as part of 0.13, and I'd be happy to help test Nick's PR (or whatever implementation is decided upon) when committed. Dahua cameras do pretty decent AI detection and with the Dahua integration, it's pretty trivial to set up some Home Assistant automations to grab the event stream (which includes event start/stop and bounding box attributes) and then pass it on to create manual events in Frigate.

bagobones commented 1 year ago

Would be nice if the API / feature had several ways to operate

  1. Momentary event.. Record for a default time.. Maybe just depend on the existing pre_capture and post_capture event values or a new value custom_capture period. Very simple webhook to record a short clip.
  2. Momentary event with the recording time sent in the event. IE record for 30s is sent with the trigger.
  3. Two event triggers with an event ID of some kind? Requires sending both a start and stop event, should probably have a custom_max_caputure value to stop if the stop event is never seen.
NickM-27 commented 1 year ago

@bagobones all of that is already supported in this implementation

MrSiO commented 8 months ago

@bagobones all of that is already supported in this implementation

Hi Nick.

Can you identify in the documentation where this is explained? Eighter by MQTT or HTTP API, I cannot find how to manually trigger start/stop recording on a specified camera.

(I'm running latest Beta)

Thx

NickM-27 commented 8 months ago

Are you looking at beta or normal docs? https://deploy-preview-6262--frigate-docs.netlify.app/integrations/api#post-apieventscamera_namelabelcreate

bagobones commented 8 months ago

Do be clear the fictionally of the api does NOT trigger recording it triggers events.

As per the big warning in the beta doc if you are using motion recording you can end up with empty / deleted events.

"Recording retention config still applies to manual events, if frigate is configured with mode: motion then the manual event will only keep recording segments when motion occurred."

MrSiO commented 8 months ago

Are you looking at beta or normal docs? https://deploy-preview-6262--frigate-docs.netlify.app/integrations/api#post-apieventscamera_namelabelcreate

I was looking at Normal docs. Didn't realize there was a separate doc for Beta. It's bookmarked now.

Thx! Will implement asap!