Expand description
ANR (Automatic Network Replenishment) edge re-fill.
Many IP cameras keep their own onboard SD/NVR recording that survives a network outage. When the
kernel loses the live RTSP stream the indexer records a recording_gaps
row; this loop (spawned from main only when HELDAR_ANR_ENABLED) tries to re-fetch the missed
footage from the camera’s onboard storage by recording its REPLAY stream into the camera’s normal
recordings dir (so the indexer then folds it back into the timeline).
It is BEST-EFFORT and CAMERA-DEPENDENT: it only works when the camera retained the footage and
exposes a replay/playback endpoint. The replay URL comes from the per-camera
anr_replay_url_template (or the default Hikvision RTSP playback endpoint) — see
crate::camera_url::anr_replay_url. The re-filled file is named by the gap’s START time (UTC
strftime, matching the recorder) so it lands at the right place on the timeline rather than “now”.