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

[FR] Detection Short Clip Option for Notification Service #307

Open
rjgrandy opened this issue Nov 20, 2020 · 10 comments
Open

[FR] Detection Short Clip Option for Notification Service #307

rjgrandy opened this issue Nov 20, 2020 · 10 comments
Labels
enhancement New feature or request pinned

Comments

@rjgrandy
Copy link

Would be nice to have an option to output just the first 10 seconds (or definable duration) (plus some prerecord) of video from a detection of an object to send to a notification service.

I think currently we have prerecord option, it looks like you are going to implement a postrecord option, but this is a bit different.

My use case is: currently I have the best image sent to telegram after detection of an object, then I tell Blue Iris to record the event in HD until detection is complete. Then I use ffmpeg to cut the first 10s and optimize for sending over telegram. This works relatively well as I get a short video of the start of each detection over telegram which is much more useful than a static image. However it seems like this could be easily and better implemented in Frigate vs doing it through a Node Red flow and shell commands.

@rjgrandy rjgrandy changed the title [FR] Detection Short Clip Option for Not [FR] Detection Short Clip Option for Notification Service Nov 20, 2020
@blakeblackshear
Copy link
Owner

Thanks for describing your use case. I will be looking at post processing for clips in a future release as some other users have requested similar functionality. In addition, the next version will have the ability to do full HD recording from a separate stream, so you won't need to use Blue Iris for that.

@rogerquake
Copy link

This would be a great feature to have. It looks like HomeAssistant supports MP4s in notifications: https://companion.home-assistant.io/docs/notifications/notification-attachments/

It would be great to include a small clip (maybe 2 seconds before the object is detected) as part of the Events HTTP endpoint that currently provides the object screenshot in the latest beta. On my Nest for example, a very short looped clip is presented in the iOS notification.

@stale
Copy link

stale bot commented Feb 22, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 22, 2021
@stale stale bot closed this as completed Feb 25, 2021
@blakeblackshear
Copy link
Owner

This is still something I am considering

@stale stale bot removed the stale label Feb 25, 2021
@rjgrandy
Copy link
Author

Still would love this feature. I do this manually right now and it works ok, but I would think if it would get integrated into Frigate, the clip could be generated much faster, like in real time which would be much nicer and useful, instead of having to wait until the end of a detection event.

@HSB-collab
Copy link

I am looking for something similar and have failed to get it working. I wrote it up in the Home Assistant community (https://community.home-assistant.io/t/frigate-video-via-telegram/286852) but I am not getting any response, so I apologise for putting the same query in 2 different places.
I am not sure if the latest version of Frigate (1.13) has implemented this feature or not, but I know it produces short videos of an incident and saves them in the /media/frigate/clips folder. I would like to be able to send the latest clip via Telegram when an event occurs. I have tried the following configuration file but I am getting the errors listed below:
Automation configuration file:

alias: Frigate alerts
description: Person/car detection in cameras from Frigate
trigger:
  - platform: mqtt
    topic: frigate/events
condition: []
action:
   - service: notify.camera_alert_telegram
    data:
      message: >-
        A {{trigger.payload_json["after"]["label"]}} was detected on
        {{trigger.payload_json["after"]["camera"]}} 
      data:
        video:
          - url: >-
              'https://ccab4aaf-frigate:5000/api/events/{{trigger.payload_json["after"]["id"]}}/{{trigger.payload_json["after"]["camera"]}}/clip.mp4'  
            caption: >-
              'Video of {{trigger.payload_json["after"]["label"]}} detected on
              {{ trigger.payload_json["after"]["camera"] }}'
mode: single

This gives the following errors:

Can't load data into ByteIO: No connection adapters were found for "'https://ccab4aaf-frigate:5000/api/events/1614904741.504328-knf1ic/Camera1/clip.mp4'"
Can't send file with kwargs: {'message': "'Video from person detected on Camera1'", 'url': "'https://ccab4aaf-frigate:5000/api/events/1614904741.504328-knf1ic/Camera1/clip.mp4'", 'caption': "'Video caption for person detected on Camera1'"}

Help would be greatly appreciated.
For completeness, I am running HassOS on a Raspberry Pi 4 with 4Gbyte of memory. My Home Assistant Core is version core-2021.3.0.

@blakeblackshear
Copy link
Owner

@HSB-collab your comment isn't really related to this feature request. Your url is wrong for the notification. Please see the notification docs again. The host should be your homeassistant address, not the frigate address. Please open a new issue rather than replying here if you are not able to resolve it.

@stale
Copy link

stale bot commented Apr 6, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 6, 2021
@stale stale bot removed the stale label Apr 6, 2021
@robertkieu
Copy link

I also cannot get the thumbnail from URL: https://kilaku.duckdns.org/api/frigate/notifications/1617859519.848163-9kas2f/floor_1/thumbnail.jpg

Error:
404: Not Found

@blakeblackshear
Copy link
Owner

I also cannot get the thumbnail from URL: https://kilaku.duckdns.org/api/frigate/notifications/1617859519.848163-9kas2f/floor_1/thumbnail.jpg

Error:
404: Not Found

For snapshots and thumbnails, remove the camera name from the path. It would be https://kilaku.duckdns.org/api/frigate/notifications/1617859519.848163-9kas2f/thumbnail.jpg

luoj1 pushed a commit to luoj1/frigate that referenced this issue Apr 29, 2023
* adding face detector

* added face detector

* feat: added test case for face detector udf

* fix: update transformation

* feat: added ocr extractor (based on easyocr)

* fix: requirements

* fix file copying -- ocr makes more sense for mnist

* fix: file name

* checkpoint

* feat: added feature extractor
@NickM-27 NickM-27 added the enhancement New feature or request label Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pinned
Projects
None yet
Development

No branches or pull requests

6 participants