kerberos-io / machinery

(DEPRECATED) An open source image processing framework, which uses your USB-, IP- or RPi-camera to recognize events (e.g. motion).
https://www.kerberos.io
489 stars 102 forks source link

Lag in saving captures between first and consecutive captures on motion detected #221

Open krakers09 opened 3 years ago

krakers09 commented 3 years ago

Describe the bug I realised that when motion is detected there is a 10-15s lag between 1st and consecutive captures in saving to the disk. There is no lag in taking captures, just in saving them. I can see the same applies to MQTT publishing (probably waiting to an image?).

Screenshot 2021-01-12 at 09 53 15

Even though there's 12s difference in file saving date, they are consecutive captures with 1s difference. The rest of captures are saved as they are captured. I don't know how to troubleshoot this issue?

Expected behavior Captures to be saved as they are captured.

Operating System and Device (please complete the following information):

Additional context Files are being saved to SSD drive.

krakers09 commented 3 years ago

I've found a log for this time, but it does not tell me much

12/01/2021 08:38:16.940 INFO [trivial] HullExpositor: activity detected from (1021,188) to (1046,221) 12/01/2021 08:38:16.940 INFO [trivial] Heuristic is valid; numberOfChanges: 32, Sequence duration: 2 12/01/2021 08:38:17.326 INFO [trivial] Executing IO devices for 1 detection(s) 12/01/2021 08:38:17.326 INFO [trivial] IoDisk: saving image 1610437096_6-940295_front_garage_1021-188-1046-221_32_535.jpg 12/01/2021 08:38:17.382 INFO [trivial] IoMQTT: sending message...sent 12/01/2021 08:38:17.514 INFO [trivial] HullExpositor: activity detected from (1001,138) to (1135,250) 12/01/2021 08:38:17.515 INFO [trivial] Heuristic is valid; numberOfChanges: 121, Sequence duration: 2 12/01/2021 08:38:18.131 INFO [trivial] HullExpositor: activity detected from (1011,122) to (1150,306) 12/01/2021 08:38:18.131 INFO [trivial] Heuristic is valid; numberOfChanges: 68, Sequence duration: 2 12/01/2021 08:38:18.731 INFO [trivial] HullExpositor: activity detected from (981,125) to (1187,382) 12/01/2021 08:38:18.731 INFO [trivial] Heuristic is valid; numberOfChanges: 473, Sequence duration: 2 12/01/2021 08:38:19.324 INFO [trivial] HullExpositor: activity detected from (978,123) to (1199,453) 12/01/2021 08:38:19.324 INFO [trivial] Heuristic is valid; numberOfChanges: 330, Sequence duration: 2 12/01/2021 08:38:19.917 INFO [trivial] HullExpositor: activity detected from (960,108) to (1161,470) 12/01/2021 08:38:19.917 INFO [trivial] Heuristic is valid; numberOfChanges: 569, Sequence duration: 2 12/01/2021 08:38:20.516 INFO [trivial] HullExpositor: activity detected from (942,106) to (1071,461) 12/01/2021 08:38:20.516 INFO [trivial] Heuristic is valid; numberOfChanges: 1649, Sequence duration: 2 12/01/2021 08:38:21.132 INFO [trivial] HullExpositor: activity detected from (850,96) to (999,430) 12/01/2021 08:38:21.132 INFO [trivial] Heuristic is valid; numberOfChanges: 3345, Sequence duration: 2 12/01/2021 08:38:21.723 INFO [trivial] HullExpositor: activity detected from (710,88) to (978,396) 12/01/2021 08:38:21.723 INFO [trivial] Heuristic is valid; numberOfChanges: 4362, Sequence duration: 2 12/01/2021 08:38:22.315 INFO [trivial] HullExpositor: activity detected from (609,78) to (869,369) 12/01/2021 08:38:22.315 INFO [trivial] Heuristic is valid; numberOfChanges: 922, Sequence duration: 2 12/01/2021 08:38:22.953 INFO [trivial] HullExpositor: activity detected from (533,71) to (821,367) 12/01/2021 08:38:22.953 INFO [trivial] Heuristic is valid; numberOfChanges: 5452, Sequence duration: 2 12/01/2021 08:38:23.530 INFO [trivial] HullExpositor: activity detected from (430,66) to (702,343) 12/01/2021 08:38:23.530 INFO [trivial] Heuristic is valid; numberOfChanges: 5217, Sequence duration: 2 12/01/2021 08:38:24.118 INFO [trivial] HullExpositor: activity detected from (324,76) to (611,316) 12/01/2021 08:38:24.118 INFO [trivial] Heuristic is valid; numberOfChanges: 881, Sequence duration: 2 12/01/2021 08:38:24.717 INFO [trivial] HullExpositor: activity detected from (248,73) to (643,301) 12/01/2021 08:38:24.717 INFO [trivial] Heuristic is valid; numberOfChanges: 4347, Sequence duration: 2 12/01/2021 08:38:25.335 INFO [trivial] HullExpositor: activity detected from (200,77) to (533,301) 12/01/2021 08:38:25.335 INFO [trivial] Heuristic is valid; numberOfChanges: 4835, Sequence duration: 2 12/01/2021 08:38:25.928 INFO [trivial] HullExpositor: activity detected from (244,87) to (436,308) 12/01/2021 08:38:25.928 INFO [trivial] Heuristic is valid; numberOfChanges: 2649, Sequence duration: 2 12/01/2021 08:38:26.517 INFO [trivial] HullExpositor: activity detected from (87,81) to (351,297) 12/01/2021 08:38:26.517 INFO [trivial] Heuristic is valid; numberOfChanges: 2966, Sequence duration: 2 12/01/2021 08:38:27.149 INFO [trivial] HullExpositor: activity detected from (168,83) to (276,266) 12/01/2021 08:38:27.149 INFO [trivial] Heuristic is valid; numberOfChanges: 1333, Sequence duration: 2 12/01/2021 08:38:29.887 INFO [trivial] Executing IO devices for 17 detection(s) 12/01/2021 08:38:29.887 INFO [trivial] IoDisk: saving image 1610437097_6-515234_front_garage_1001-138-1135-250_121_282.jpg 12/01/2021 08:38:29.947 INFO [trivial] IoMQTT: sending message...sent 12/01/2021 08:38:30.448 INFO [trivial] IoDisk: saving image 1610437098_6-132034_front_garage_1011-122-1150-306_68_623.jpg 12/01/2021 08:38:31.009 INFO [trivial] IoDisk: saving image 1610437098_6-731608_front_garage_981-125-1187-382_473_623.jpg 12/01/2021 08:38:31.144 INFO [trivial] IoMQTT: sending message...sent