Page 1 of 1

time lapse?

Posted: Sat Feb 29, 2020 9:45 pm
by alabamatoy
Does anyone have a working time lapse solution?

Re: time lapse?

Posted: Sun Mar 01, 2020 4:11 pm
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?

Re: time lapse?

Posted: Sun Mar 01, 2020 7:55 pm
by alabamatoy
Real time. Store an image from monitor X every specified amount of time.

Re: time lapse?

Posted: Mon Mar 02, 2020 1:33 am
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

Re: time lapse?

Posted: Thu Mar 05, 2020 3:11 pm
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.

Re: time lapse?

Posted: Mon Mar 09, 2020 2:28 pm
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.

Re: time lapse?

Posted: Mon Mar 09, 2020 3:12 pm
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).

Re: time lapse?

Posted: Mon Mar 09, 2020 5:32 pm
by alabamatoy
I couldnt figure out how to make it work.

Re: time lapse?

Posted: Mon Mar 09, 2020 7:11 pm
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.

Re: time lapse?

Posted: Thu Mar 12, 2020 2:57 pm
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.

Re: time lapse?

Posted: Thu Mar 12, 2020 3:08 pm
by Bluemax
Clone the camera for timelapse. Or do it externally.
Edit: Nvm, i see you've found a solution already.