Closed k1x0r closed 2 months ago
Please use md_detect param in /metrics setting
More params:
# HELP md_rects_recv_total Number of rectangles returned by HW MD algorithm.
# TYPE md_rects_recv_total counter
md_rects_recv_total 0
# HELP md_rects_acc_total Number of rectangles fit into ROI.
# TYPE md_rects_acc_total counter
md_rects_acc_total 0
# HELP md_status Motion detect activation status.
# TYPE md_status gauge
md_status 0
The request is opened again because it becomes relevant and overlaps with others.
In the new Majestic dated 2023.10.24
If motion detect is enabled (for Hisilion/Goke, Ingenic and Sigmastar), the first check is for an executable file:
/etc/majestic_motion.sh
Then the following will be called:
/etc/majestic_motion.sh 1163 0 400 275 &
The usage is:
/etc/majestic_motion.sh [x coordinate] [y coordinate] [region width] [region height]
Example script:
#!/bin/sh
echo 0:[$0] 1:[$1] 2:[$2] 3:[$3] 4:[$4]
Final diagnosis
20:37:02 <SED_IVE_DETCTOR> [ motion] motion_update@155 Motion detected: [1163x0] -> [690x475]
20:37:02 <SED_IVE_DETCTOR> [ tools] motion_event@615 Execute motion script: /etc/majestic_motion.sh
0:[/etc/majestic_motion.sh] 1:[1163] 2:[0] 3:[690] 4:[475]
Updated the following 2023.11.02
Introduction
Currently it isn't possible to get the motion detection events from Majestic streamer from 3rd party applications. The solution of running a "motion-detect" example from Hi3516EV200 MPP alongside Majestic isn't possible, because of the implementation of the SDK. Having a 3rd-party app on the camera side would allow the user to send "motion detect" events to the server.
The suitable approach for this would be a linux pipe, because the implementation of sending "motion detect" event wouldn't depend on implementation in majestic. Analyzing such stream, a 3rd party app would send a request to the server, which will trigger the recording of the video on the server side.
Detailed design
The most straightforward approach is to create a pipe named e.g "/tmp/majestic_md" and send current motion detection status if it's changed. To keep the protocol simple, the pipe should output only '1' and '0' characters with the meaning: "Motion detection is present" and "Motion detection is absent".
A 'dummy' implementation for sending events to the pipe:
In order to test this sample, one should run the following command line: cat /tmp/majestic_md
And reading such pipe programmatically in blocking mode should also be also pretty straightforward: