File sources now keep STATE_FILE on graceful shutdown (EOF or SIGTERM):
the final batch snapshot is written instead of deleted, so the dashboard's
/api/current-batch still shows the recount result after the process exits.
On startup, STATE_FILE is cleared unless a live instance is detected via a
/proc cmdline scan (rtsp/http source in argv or config). Live sources keep
the old resume-at-start / delete-on-finish behavior.
SPEC: V19, T21, B2. AGENTS: STATE_FILE lifecycle section.
OpenCV FFMPEG build buffer (CAP_PROP_BUFFERSIZE=1) on file sources was
landing mid-file, so the first decoded frame could show an ~11s-later
camera clock than the source's true frame 0. Gate BUFFERSIZE to live
sources only and seek file sources to CAP_PROP_POS_FRAMES=0. Log
pos_frames/pos_msec/frame_count/fps once on first successful read.
SPEC: B1, V18, T20. AGENTS: capture setup notes.