blakeblackshear / frigate

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

Download a custom length recording #2369

Closed mr6880 closed 1 year ago

mr6880 commented 2 years ago

This suggestion relates to recordings collected by Frigate and the ability to download them.

Frigate is great for detecting objects and allowing those detections to be downloaded. Frigate is also great for recording 24/7, and allowing a user to go to specific points of the 24/7 hour recording using its database of detections.

I've more than once found myself wanting to download footage from outside of the detection period. For example, the events leading up to a detection that cannot be detected by Frigate (lights turning on some time before an object emerges, screaming/shouting/tyre screeching audio in the distance before an object emerges etc) or if an object hides from the camera, and then re-emerges some time later.

Continuous, unbroken recordings may also be crucial for law enforcement purposes, if the Police required a continuous recording as evidence (although shamefully, the Police in my area tend to record the screen with their phone, rather than collecting raw footage).

My suggestion would be to somehow implement the ability to download specific parts of a 24/7 recording, or create custom events between specific times, which would then allow a user to download those recordings (perhaps a 10 minute clip, crossing between one hour and another). This would allow a user to save important evidence in a quick and efficient manner, directly from the Frigate GUI.

NickM-27 commented 8 months ago

It does work, but there is a maximum number of segments that can be included. In 0.13 the /export api can be used and this does not have any length limitations

troykelly commented 8 months ago

Thank's @NickM-27 - is there any documentation for that? I can't find it at https://docs.frigate.video/integrations/api/

NickM-27 commented 8 months ago

You need to check the beta docs. 0.13 is in beta

troykelly commented 8 months ago

Apologies @NickM-27 thankyou

RobertusIT commented 8 months ago

It does work, in my experience, but only for short clips. When you request an export the server spins up a few threads to create the file for download. If it's longer than a few minutes the overall process doesn't work. At the time I blamed it on the web request timing out. On Tue, 19 Dec 2023 at 09:20, Troy Kelly @.> wrote: there is an existing api for this https://docs.frigate.video/integrations/api#get-apieventsidclipmp4 But that endpoint doesn't work. Is there anything that works via the API to download video? — Reply to this email directly, view it on GitHub <#2369 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHWDUJH35VJ6DTIQ7BBQRTYKDFTFAVCNFSM5JIPWDUKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBWGE4DINBQGU2Q . You are receiving this because you commented.Message ID: @.>

Please can you share the automation in HA, to get from a Frigate Event, a clip, and save it in a folder ?

hs82h commented 8 months ago

I got a small part of what you maybe could use. I use it to send a notification to my mobile with a button. Pushing that button opens my browser with a 10s video of recording.

alias: Doorbell - Melding naar mobiels
variables:
  timestamp: "{{ now() }}"
  timestamp_readable: >-
    {{ timestamp | as_datetime | as_timestamp | timestamp_custom('%a %H:%M:%S')
    }}
  timestamp_filename: >-
    {{ timestamp | as_datetime | as_timestamp |
    timestamp_custom('%Y%m%d_%H%M%S') }}
  starttime: "{{ as_timestamp(timestamp) - 5 }}"
  endtime: "{{ as_timestamp(timestamp) + 5 }}"
sequence:
  - service: camera.snapshot
    data:
      filename: /config/www/camera_snapshots/deurbel/{{timestamp_filename}}.jpg
      entity_id: camera.reolink_video_doorbell_poe_sub
  - service: notify.mobile_app_android
    data:
      message: Deurbel! {{timestamp_readable}}
      data:
        image: >-
          https://domain/local/camera_snapshots/deurbel/{{timestamp_filename}}.jpg
        ttl: 0
        priority: high
        channel: Doorbell
        actions:
          - action: URI
            title: Snapshots
            uri: /lovelace/default_view
          - action: URI
            title: Clip
            uri: >-
              http://u2.lan:5000/api/doorbell/start/{{ starttime }}/end/{{
              endtime }}/clip.mp4
    enabled: true
mode: single
icon: mdi:doorbell-video