Thanks for the update! This is a great script, and I'm happy to see it ported to Lua.
I'm looking for a bit of advice on the way to get the best performance out of a small change to the script.
I'd actually like to use this for a combined timelapse/motion detection script. The initial application is also the easiest to explain: timelapses of thunderstorms.
I'd like to have the MD script running in fast mode, but fire a shot anyway once per timeout. Then I can set the timeout to the desired timelapse interval, and get a timelapse movie that includes all the lightning.
I tried the naive implementation, adding
shoot() to the inner until() loop in
fast_md(). This works, but the total cycle time of that shot is about 4s. If I'm aiming for a 15s timelapse, that means there's only about a 70% chance of catching a motion event.
Is there a different strategy that will reduce the cycle time of the shot?
I suppose the ultimate answer to this would be a change to md_detect_motion to add a 'fire on timeout' flag, but that's probably beyond my ability. (I haven't looked at that code.)
Any suggestions would be appreciated.