frigate icon indicating copy to clipboard operation
frigate copied to clipboard

[FR] Timelapse from the recorded footage

Open sakalauskas opened this issue 4 years ago • 9 comments

It would be really nice to have a feature on the web page to generate and store a speeded-up timelapse from the selected camera at the set timeframes and speed.

Now, I just copy the relevant files, concatenate them and generate time-lapse with this command:

for f in `ls -tUr  recordings/2021-01/25/**/camera_name/*.mp4`; do echo "file '$f'" >> tempfilelist.txt; done
ffmpeg -f concat -i tempfilelist.txt -c copy concatenated.mp4
ffmpeg -i concatenated.mp4 -filter:v "setpts=0.1*PTS" output.mp4

The way folders are structured/files are named, it can be a bit inconvenient to generate timelapse e.g. from 11.30 to 12.45.

Let me know if you'd be willing to merge this if I made a PR.

sakalauskas avatar Jan 26 '21 09:01 sakalauskas

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[bot] avatar Feb 25 '21 12:02 stale[bot]

This is still something I am considering.

blakeblackshear avatar Feb 25 '21 12:02 blakeblackshear

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[bot] avatar Mar 27 '21 12:03 stale[bot]

Maybe an option to record in timelapse.

umairyounus avatar Jul 06 '21 14:07 umairyounus

I am using motioneye to take snapshots and after that I will combine those to one timelapse video with this command. cd "$(\ls -1dt ./*/ | head -n 1)" && cat *.jpg | ffmpeg -framerate 30 -f image2pipe -vcodec mjpeg -i - -s hd720 -c:v h264 -crf 26 -preset faster -vf "tblend=average,format=yuv420p" -f mp4 /data/output/Timelapse/"timelapse_date +%Y-%m-%d-%H-%M-%S.mp4" image

It would be awesome if frigate could do that and I could use that extra motioneye raspberry for other things.

heebo1974 avatar Jul 11 '22 11:07 heebo1974

I assume that it would be quite easy to run ffmpeg to create a 1 minute video collected from 24h of recorded material? Well maybe it is too heavy compared to combining couple hundreds of still pictures.

heebo1974 avatar Jul 18 '22 18:07 heebo1974

Hi, Any chance this will be implemented?

gshlomi avatar Jul 23 '22 10:07 gshlomi

Hi,

Any chance this will be implemented?

It's a pinned issue so it's on the roadmap at some point

NickM-27 avatar Jul 23 '22 11:07 NickM-27

One thing that would be a nice variant/option of this that I've seen on synology devices:

Do a timelapse at 10x/20/50x speed until there's an event and then just splice the event video at regular speed in there. That way you can keep one 'full day' video that has details of all events with very little memory footprint.

rb2k avatar Sep 10 '22 11:09 rb2k

If it is not soon to be implemented by Frigate, do you guys know any existing solution which I could feed from Frigate recordings and generate such time-lapses? It's really a pain currently to review all-day recordings from multiple cameras.

There are many interesting approaches worth discussing mentioned already in the other topic like: https://towardsdatascience.com/build-a-motion-heatmap-videousing-opencv-with-python-fd806e8a2340 https://github.com/Askill/Video-Summary

For me, it would be nice even to have an option in the player to play like 16x or 32x when there is no motion and 1x with motion detected. Then I'd be able to fast forward the whole day.

grzywek avatar Mar 14 '23 10:03 grzywek

This is implemented for 0.13

NickM-27 avatar Jul 28 '23 22:07 NickM-27

That's awesome! I had a look at the release notes for 0.13 Beta 1 and the documentation but struggled to find something about timelapses. I'm interested in this feature just for fun, to take some timelapses of our garden. Will it be possible to take a photo once a day over a period of months and years?

ndbroadbent avatar Sep 18 '23 09:09 ndbroadbent

Timelapses are supported via the recordings export. It does not done via snapshots but via the recorded footage.

NickM-27 avatar Sep 18 '23 12:09 NickM-27

@NickM-27 used it today for the 1st time. The current implementation is not ideal IMO. For 1 day of footage, I get 55 minutes of Timelapse (8+ GB). I want like 2 mins maximum with 50MB max. The feature needs some possibility to pass specific parameters. Is there any way to pass specific parameters? I'm looking at the code atm and it seems like we have "timelapse_args". Maybe this could be an input of the export feature.

image

iursevla avatar Mar 12 '24 10:03 iursevla

@iursevla the feature already has the ability to tune the parameters in the config for each camera

NickM-27 avatar Mar 12 '24 10:03 NickM-27

Yeah, @NickM-27 seems like it. Thanks

I'll try to make it better by allowing the user to provide more parameters on the UI (like maximum time, maximum size in MB etc). I need this for a personal project that will be deployed remotely in a place with a low monthly bandwidth (only a few GB a month). If I succeed I'll create a PR here 🙏

iursevla avatar Mar 12 '24 11:03 iursevla

@iursevla I wouldn't recommend that. We are currently rewriting the UI and also we specifically chose not to make these UI configurable due to new features coming in 0.14

NickM-27 avatar Mar 12 '24 11:03 NickM-27

Okay, @NickM-27 I'll implement it for myself. Whenever the new UI comes I'll take a look and provide my findings in a discussion thread before attempting to make a PR.

Where can I follow the state of the new version?

iursevla avatar Mar 12 '24 11:03 iursevla