Motion - Bug Report 2005x 01x 23x 133554

BUG: Timelapse rollover at midnight does not always happen

From IRC #Motion 23-Jan-2005
[13:53] <moonaddict> I am (happily!) using motion 3.1.17. the timelapse mpegs sometimes do not rotate at midnight  each day, but keep going in the same file for up to 72 hours... any ideas?
[13:55] <Lavr> How have you setup the filename?
[13:59] <moonaddict> wait
[14:00] <moonaddict> timelapse_filename %Y%m%d-timelapse
[14:00] <moonaddict> and
[14:00] <moonaddict> ffmpeg_timelapse_mode daily
[14:02] <Lavr> Hmm. That should work. Maybe if the machine is very busy at midnight Motion misses the event.
[14:02] <Lavr> If this is the case it is a real bug in Motion
[14:03] <moonaddict> Lavr: the busy thing could be a problem as cron & co do lots of stuff right then.
[14:04] <moonaddict> still - it happens sporadically
[14:04] <moonaddict> it's no big deal though
[14:05] <moonaddict> by the way: when monitoring axis 205 cameras, they get stuck after a few hours/days. so in my setup, I have scripted to reboot them regularily, so everything keeps working. as I've seen that with 6 205 cams so far, could be worth mentioning in the wiki somewhere...
[14:08] <Lavr> I will release  3.1.18_snap11 within the hour. It may have resolved all of this. Right Sack? :-)
[14:09] <moonaddict> woooo-hoo :)
[14:11] <Lavr> What framerate do you use?
[14:11] <Lavr> And do you run lowcpu?
[14:15] <moonaddict> framerate 2
[14:15] <moonaddict> low_cpu 0
[14:16] <moonaddict> but on another machine, it's low_cpu 1 -> same behaviour
[14:16] <Lavr> I can see in the code that if Motion misses a few frames because of high load from for example a cron job, it will wait till the next day. I need to make this more robust.
[14:17] <Lavr> if (cnt->currenttime->tm_min == 0 && cnt->currenttime->tm_sec == 0 && cnt->shots == 0) {
[14:18] <Lavr> If the code misses the single frame where this is valid it misses the timelapse reset
[14:19] <Lavr> I need to make sure it only gets valid ONCE and in a way so this long IF does not have to run all for each frame captured.
[14:20] <Lavr> But on the other hand make sure that if the event was missed it will catch it a few seconds later
[14:21] <moonaddict> hmm
[14:21] <Lavr> bbl. I will think about a fix for this. Maybe it will be in the snap11. it should not be too difficult to resolve.
[14:21] <moonaddict> that explains it.
[14:21] <moonaddict> :)

Test case

Environment

Motion version: 3.1.17
ffmpeg version: N/A
Shared libraries: N/A
Server OS: N/A

-- KennethLavrsen - 23 Jan 2005

Follow up

Fix record

A more robust method for both the timelapse event and the rollover event has been implemented.

Released in MotionRelease3x1x18snap11
Topic revision: r3 - 30 Jan 2005, KennethLavrsen
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.