#5550·mediamtx

Ignore time drift

Author: AlexandreLemonnierCreated Mar 5, 2026Updated Sep 7, 2026

Describe the feature

In v1.15.5 an improvement has been added:

recorder: reset when absolute time drifts from stream time (https://github.com/bluenviron/mediamtx/issues/4778) (https://github.com/bluenviron/mediamtx/pull/5239) the server now detects when system time changes too much and restarts recordings when that happens.

Here is my use case: My camera is used for security purpose and, on motion detection, sends a buffer of 5 seconds quickly + real time stream for X seconds. That way my alert video file has 5 seconds of content before the motion occured. With this update I now get an error about time drifting:

detected drift between recording duration and absolute time, resetting

Could an option be added to ignore drift? Or change the threshold? From what I understood it has been developped to prevent significant time drifting (user mentionned 1 day drifting in ticket #4778). A 5 seconds time drift is not as much.