I have 3 amcrest onvif cameras and a reolink doorbell doing ONVIF. They view and record. However, the resulting recordings seem to start at the detection event rather than the configured Pre-Detection Buffer. I've tried different lengths. It does seem to affect the length of the videos, but not the start relative to the event. I am currently running docker 0.37.2. I started with 0.36.6 and this issue seems present in all of them.
I currently have a pre-detection buffer of 30 seconds and a post-detection buffer of 5 seconds for my driveway. I can play a video, a car will be just off screen at the start and can cross the entire video frame in less than 15 seconds and nothing else happens. This full video will be 56-60 seconds.
I have the Default Buffer Strategy at auto. My Buffer Size (KB) is 1024000.
The logs to show
[2026-08-17 19:07:31.327] [INFO] [Detection] [Driveway] ONVIF motion detected (async thread, ts=1787008050)
[2026-08-17 19:07:31.328] [INFO] [Detection] [Driveway] Detection triggered, starting recording
[2026-08-17 19:07:31.328] [INFO] [Detection] [Driveway] Starting detection recording: /var/lib/lightnvr/data/recordings/mp4/Driveway/2026/08/17/detection_20260817_190731.mp4
[2026-08-17 19:07:31.328] [INFO] [Detection] Created MP4 writer for stream Driveway at /var/lib/lightnvr/data/recordings/mp4/Driveway/2026/08/17/detection_20260817_190731.mp4
[2026-08-17 19:07:31.328] [INFO] [Detection] Enabled audio recording for stream Driveway
[2026-08-17 19:07:31.329] [INFO] [Detection] [Driveway] Audio recording enabled for detection recording
[2026-08-17 19:07:31.329] [INFO] [Detection] [Driveway] AAC codec params prepared for MP4 header (eager init)
[2026-08-17 19:07:31.330] [INFO] [Detection] [Driveway] Added detection recording to database (ID: 6028) for file: /var/lib/lightnvr/data/recordings/mp4/Driveway/2026/08/17/detection_20260817_190731.mp4
[2026-08-17 19:07:31.330] [INFO] [Detection] [Driveway] Detection recording started successfully
[2026-08-17 19:07:31.330] [INFO] [Detection] [Driveway] Flushing pre-buffer to recording
[2026-08-17 19:07:31.330] [INFO] [Detection] [Driveway] Pre-buffer contains 540 packets (~15 seconds, 16471566 bytes)
[2026-08-17 19:07:31.330] [INFO] [Detection] Starting MP4 recording with keyframe for Driveway
[2026-08-17 19:07:31.330] [INFO] [Detection] Ensuring MP4 output directory exists: /var/lib/lightnvr/data/recordings/mp4/Driveway/2026/08/17
[2026-08-17 19:07:31.330] [INFO] [Detection] Initializing MP4 writer to output file: /var/lib/lightnvr/data/recordings/mp4/Driveway/2026/08/17/detection_20260817_190731.mp4
[2026-08-17 19:07:31.330] [INFO] [Detection] Audio recording enabled for stream Driveway (preserving configured setting)
[2026-08-17 19:07:31.330] [INFO] [Detection] H.264 video stream for Driveway — extradata (SPS/PPS) present (34 bytes)
[2026-08-17 19:07:31.331] [INFO] [Detection] Audio stream (AAC) declared at index 1 before header write for Driveway
[2026-08-17 19:07:31.331] [INFO] [Detection] Successfully initialized MP4 writer for stream Driveway at /var/lib/lightnvr/data/recordings/mp4/Driveway/2026/08/17/detection_20260817_190731.mp4
[2026-08-17 19:07:31.331] [INFO] [Detection] [Driveway] MP4 writer initialized on first keyframe
[2026-08-17 19:07:31.354] [INFO] [Detection] Flushed 540 packets from buffer for stream: Driveway
[2026-08-17 19:07:31.354] [INFO] [Detection] [Driveway] Flushed 540 packets to recording (534 written starting from keyframe)
[2026-08-17 19:07:31.355] [INFO] [Detection] [Driveway] Corrected recording start_time by -15s (pre-buffer, clamped from 15s)
I have 3 amcrest onvif cameras and a reolink doorbell doing ONVIF. They view and record. However, the resulting recordings seem to start at the detection event rather than the configured Pre-Detection Buffer. I've tried different lengths. It does seem to affect the length of the videos, but not the start relative to the event. I am currently running docker 0.37.2. I started with 0.36.6 and this issue seems present in all of them.
I currently have a pre-detection buffer of 30 seconds and a post-detection buffer of 5 seconds for my driveway. I can play a video, a car will be just off screen at the start and can cross the entire video frame in less than 15 seconds and nothing else happens. This full video will be 56-60 seconds.
I have the Default Buffer Strategy at auto. My Buffer Size (KB) is 1024000.
The logs to show
[2026-08-17 19:07:31.327] [INFO] [Detection] [Driveway] ONVIF motion detected (async thread, ts=1787008050)
[2026-08-17 19:07:31.328] [INFO] [Detection] [Driveway] Detection triggered, starting recording
[2026-08-17 19:07:31.328] [INFO] [Detection] [Driveway] Starting detection recording: /var/lib/lightnvr/data/recordings/mp4/Driveway/2026/08/17/detection_20260817_190731.mp4
[2026-08-17 19:07:31.328] [INFO] [Detection] Created MP4 writer for stream Driveway at /var/lib/lightnvr/data/recordings/mp4/Driveway/2026/08/17/detection_20260817_190731.mp4
[2026-08-17 19:07:31.328] [INFO] [Detection] Enabled audio recording for stream Driveway
[2026-08-17 19:07:31.329] [INFO] [Detection] [Driveway] Audio recording enabled for detection recording
[2026-08-17 19:07:31.329] [INFO] [Detection] [Driveway] AAC codec params prepared for MP4 header (eager init)
[2026-08-17 19:07:31.330] [INFO] [Detection] [Driveway] Added detection recording to database (ID: 6028) for file: /var/lib/lightnvr/data/recordings/mp4/Driveway/2026/08/17/detection_20260817_190731.mp4
[2026-08-17 19:07:31.330] [INFO] [Detection] [Driveway] Detection recording started successfully
[2026-08-17 19:07:31.330] [INFO] [Detection] [Driveway] Flushing pre-buffer to recording
[2026-08-17 19:07:31.330] [INFO] [Detection] [Driveway] Pre-buffer contains 540 packets (~15 seconds, 16471566 bytes)
[2026-08-17 19:07:31.330] [INFO] [Detection] Starting MP4 recording with keyframe for Driveway
[2026-08-17 19:07:31.330] [INFO] [Detection] Ensuring MP4 output directory exists: /var/lib/lightnvr/data/recordings/mp4/Driveway/2026/08/17
[2026-08-17 19:07:31.330] [INFO] [Detection] Initializing MP4 writer to output file: /var/lib/lightnvr/data/recordings/mp4/Driveway/2026/08/17/detection_20260817_190731.mp4
[2026-08-17 19:07:31.330] [INFO] [Detection] Audio recording enabled for stream Driveway (preserving configured setting)
[2026-08-17 19:07:31.330] [INFO] [Detection] H.264 video stream for Driveway — extradata (SPS/PPS) present (34 bytes)
[2026-08-17 19:07:31.331] [INFO] [Detection] Audio stream (AAC) declared at index 1 before header write for Driveway
[2026-08-17 19:07:31.331] [INFO] [Detection] Successfully initialized MP4 writer for stream Driveway at /var/lib/lightnvr/data/recordings/mp4/Driveway/2026/08/17/detection_20260817_190731.mp4
[2026-08-17 19:07:31.331] [INFO] [Detection] [Driveway] MP4 writer initialized on first keyframe
[2026-08-17 19:07:31.354] [INFO] [Detection] Flushed 540 packets from buffer for stream: Driveway
[2026-08-17 19:07:31.354] [INFO] [Detection] [Driveway] Flushed 540 packets to recording (534 written starting from keyframe)
[2026-08-17 19:07:31.355] [INFO] [Detection] [Driveway] Corrected recording start_time by -15s (pre-buffer, clamped from 15s)