Feature Request: Priorities when motion detected
Description
Hi,
I was wondering if it would be possible to manage priorities for roundrobin cameras ?
You would declare some of them more important than the others ; then they would be scanned at the same pace, but as soon as motion is detected, the priorities would be taken in account, so that you would get more captures for the critical ones.
For example, say you have 3 priorities : High, Medium and Low ; with camera 1 (prio = high), camera 2 (prio = medium) and camera 3 (prio = low) detecting motion at the same time, motion would compute 3/6 of cam1 frames, 2/6 of cam2 frames and 1/6 of cam3 frames...
Hope you'll find this useful :o)
BTW, motion is a great product and I love it !
--
JujuSL - 30 Jun 2008
Follow up
round robin feature is managed by only one thread as long as motion uses a thread per video source, implement what you propose it is not possible, but
set frame to capture per input :
"motion would compute 3/6 of cam1 frames, 2/6 of cam2 frames and 1/6 of cam3 frames"
that could be implemented using a different way to setup round robind :
Capture 3 frames + skip 1
Capture 2 frames + skip 1
Capture 1 frames + skip 1
roundrobin_frames 3,2,1
roundrobin_skip 1
Change number of frame to capture from each input based in motion detection could be a mess ...
- input 3 (low priority) motion detected , then change to capture from 1 to 3 frames ( input 2 become medium priority and 2 low priority ) ?
ummm i don't see clear this option .
but static solutioni proposed won't hurt motion.
Maybe i'm wrong and you have already a good approach to this feature .
Thoughts ?
--
AngelCarpintero - 01 Jul 2008
Well, this is an interesting point of vue ; you're more aware than me about the way motion runs.
If I understand well, changing dynamically the number of frames captured is not possible because only 1 thread is launched for 1 capture device.
Just to explain a little bit more my thougths : - cam 1 to 3 scan at the same pace, say 2 frames/sec each ; let's say they all together can capture up to 18 frames/sec in "motion alert" mode - cam3 (low) detects motion : you capture up to 14 frames/sec, always living 2 frames/sec for cam1 and cam2 -cam1 (high) detects motion : you capture 11 frames/sec for cam1, 5 frames/sec for cam3, and leave 2 frames/sec for cam2 -cam2 (low) detects motion : you capture 9 frames/sec for cam1, 6 frames/sec form cam2 and 3 frames/sec for cam3
Maybe easier to explain (not sure :o) ) than to make...
But your proposal can be a good beginning while keeping things simple.
--
JujuSL - 02 Jul 2008
As I see it, you would like to miss out some frames from cameras which are round-robin (ie. attached to multiple input capture cards), and Motion at the moment only supports 1 frame per motion main loop.
There is some code in
StatisticsDataPatch which handles throttling of netcams - but only for netcams.
Perhaps someone could make use of the Throttling logic code (which was quite difficult to write - it _evenly_spaces out frames to be missed out of a stream to achieve a desired lower fps ) to give a throttling effect on a capture-card camera under round-robin. Different method of getting the frames, but same principle? And then, when motion is detected, simply disable the throttling until the event ends.
StatisticsDataPatch has not made it into mainline Motion yet - its rather specialised Statistics page and also the incorporated Throttling patch make it a large patch. Having said that, I'm still using it 24/7 to throttle a DCS-900 netcam from 12fps to ~5fps, and observe the Motion statistics from the Internet (through a firewall machine).
Simon.
--
SimonW - 07 Aug 2008