time lapse?

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
alabamatoy
Posts: 349
Joined: Sun Jun 05, 2016 2:53 pm

time lapse?

Post by alabamatoy »

Does anyone have a working time lapse solution?
User avatar
iconnor
Posts: 2881
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: time lapse?

Post by iconnor »

Do you want to do this real-time as in have a monitor that just takes an image every minute, or do you want to do this in post-processing, as in create a time lapse video from these 24 hours of footage?
alabamatoy
Posts: 349
Joined: Sun Jun 05, 2016 2:53 pm

Re: time lapse?

Post by alabamatoy »

Real time. Store an image from monitor X every specified amount of time.
User avatar
iconnor
Posts: 2881
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: time lapse?

Post by iconnor »

I'm not sure how well this will work with ffmpeg monitor type.
Ideally you would use remote type, with a snapshot url source.
Set fps to some decimal representing the frequency of image captures. So every minute would be....1/60 = 0.016
alabamatoy
Posts: 349
Joined: Sun Jun 05, 2016 2:53 pm

Re: time lapse?

Post by alabamatoy »

What about using the API to arm the monitor, then immediately disarm it. Should be two simple calls, separated by a couple seconds. This could be done however often you want to pull the time lapse photo.

Then run a daily script that would pull the first image from each event and store it somewhere outside of ZM. Perhaps some event filtering may be necessary to ensure these events dont get intermixed with other events.

ffmpeg could then be used to make a video of the collected images. There's lots of tools out there to do that, like openshot.
alabamatoy
Posts: 349
Joined: Sun Jun 05, 2016 2:53 pm

Re: time lapse?

Post by alabamatoy »

I have this working, but its by no means polished. Its in 2 parts:

1 - a cron script that uses the API to create a 1second alarm on a regular schedule. Works, currently set for every 5 minutes.

2 - Another script that will run once per day that finds the first frame from each alarm, extracts a copy of that image to a specific location, named IAW the time the frame was captured (monitorID-year-MM-dd-hh-mm-ss.jpg) so that they are in order, then runs ffmpeg on the images to produce the timelapse video. (This could have been done via a filter, but I could not get it to work that way.) So currently I will be getting a video each day which is about 1 minute long. ffmpeg lets you set the frame rate, so the daily video length is adjustable. At some point I will add a filter to delete the events after the video is complete.

I just realized that I implemented this on an older version of zoneminder (1.30.0), so if this thread needs to be moved, please do so.
User avatar
Bluemax
Posts: 121
Joined: Wed Jun 12, 2019 5:15 pm

Re: time lapse?

Post by Bluemax »

What's wrong with iconnor's advice? Seems much easier (if it works).
I personally use an external bash script with snapshot url (independent from ZM).
alabamatoy
Posts: 349
Joined: Sun Jun 05, 2016 2:53 pm

Re: time lapse?

Post by alabamatoy »

I couldnt figure out how to make it work.
User avatar
Bluemax
Posts: 121
Joined: Wed Jun 12, 2019 5:15 pm

Re: time lapse?

Post by Bluemax »

alabamatoy wrote: Mon Mar 09, 2020 5:32 pm I couldnt figure out how to make it work.
Go to 'Defining Monitors' and set all three fps fields to '0.1' (i guess 10secs is a better start for testing) and don't use pass-through mode.
https://zoneminder.readthedocs.io/en/la ... onitor-tab

Then use 'record' mode to record permanently.

That's the theory. I did not test it yet.
alabamatoy
Posts: 349
Joined: Sun Jun 05, 2016 2:53 pm

Re: time lapse?

Post by alabamatoy »

Bluemax wrote: Mon Mar 09, 2020 7:11 pm Go to 'Defining Monitors' and set all three fps fields to '0.1'
This would wreck other things, but should work (in theory) if all I wanted was timelapse. Also, somewhere in the documentation it recommends setting FPS on the camera, not within ZM. All my cameras are set to 10FPS which has worked very well, minimizes load on the CPU while still giving pretty good motion video.

This effort is for a construction project. The Architect asked for a timelapse. My approach allows full motion to be viewed at any point either using the ZM web interface or zmninja without affecting the timelapse or the timelapse affecting the real time video.
User avatar
Bluemax
Posts: 121
Joined: Wed Jun 12, 2019 5:15 pm

Re: time lapse?

Post by Bluemax »

Clone the camera for timelapse. Or do it externally.
Edit: Nvm, i see you've found a solution already.
Post Reply