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

Automatic Daily Recordings Export with Timelapse #11765

Closed
gorfreed opened this issue Jun 5, 2024 · 6 comments
Closed

Automatic Daily Recordings Export with Timelapse #11765

gorfreed opened this issue Jun 5, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@gorfreed
Copy link

gorfreed commented Jun 5, 2024

Yes, I am aware that this question was most likely asked a hundred times already, but I've been up and down all the documentation and simply cannot get a straight answer for this feature which is essential for a security cam system.

At the end of the day, I want my Frigate to export the daily recordings of a camera in the format configured in my config (as timelapse video). I can manually trigger this with an API call and the GUI on the web portal works terrific too. HOWEVER, it is not automatic and I have to sit there and wait until the process is complete.... For each camera.

Of course, that makes that feature completely useless in the day-to-day, so I want to ask you for how to create this daily export automatically. Possible the API call would be the easiest solution, but it requires the timestamp parameters by default:

POST /api/export//start//end/

How can I send the request simply for yesterday's 24 hours at the start of a new day?

@gorfreed gorfreed added the enhancement New feature or request label Jun 5, 2024
@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Jun 5, 2024

This can be done automatically with a system like home assistant, NodeRED, or even a simple bash script + cron job.

It is also worth mentioning that in the next version of frigate the UI supports scrubbing recordings quickly automatically which replaces the need of time-lapses for many users.

@NickM-27 NickM-27 closed this as completed Jun 5, 2024
@gorfreed
Copy link
Author

gorfreed commented Jun 5, 2024

@NickM-27 Could you please point me to a working example where a bash script + cron job combination is being used? I cannot find any and was unable to reproduce this setup so far.

@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Jun 5, 2024

https://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/ would be a good starting point. There's not much special about calling Frigate's api. Just need to get the start and end timestamp then make the api request in the script

@gorfreed
Copy link
Author

gorfreed commented Jun 6, 2024

@NickM-27 I think you misunderstood my issue completely. I have no troubles using cron or writing http requests. My problem is that the specific endpoint of frigate I am aiming at expects/requires date parameter in unix that I don't know how to produce if said export is supposed to run daily for the last 24 hours (hence the unix parameter would always be different).

POST /api/export/<camera>/start/<start-timestamp>/end/<end-timestamp>

@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Jun 6, 2024

You just need to get the epoch time https://stackoverflow.com/questions/1092631/get-current-time-in-seconds-since-the-epoch-on-linux-bash and add 24 hours (in seconds) to it

@gorfreed
Copy link
Author

gorfreed commented Jun 6, 2024

I see. I guess that means I don't get around coming up with some kind of script/backend that does that calculation for each call then? I cannot simply have it triggered by other tools that are only capable of sending out requests as configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants