You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PreTriggerBuffer initializes correctly at startup for both channels (5s duration, 5MB limit), but it is never consulted when a motion event triggers a recording. Motion-triggered clips start exactly at the moment motion is detected (or ~1 second later), with no pre-roll, despite recorder.prebuffer_enabled: true and recorder.prebuffer_seconds: 5 in prudynt.json.
Jun 22 14:03:36 prudynt[649]: [INFO:PreTriggerBuffer.cpp]: PreTriggerBuffer initialized: 5s duration, 5MB limit, max_capacity=300, keyframe_only=0
Jun 22 14:03:36 prudynt[649]: [INFO:VideoWorker.cpp]: PreTriggerBuffer initialized for channel 0
Jun 22 14:03:36 prudynt[649]: [INFO:PreTriggerBuffer.cpp]: PreTriggerBuffer initialized: 5s duration, 5MB limit, max_capacity=300, keyframe_only=0
Jun 22 14:03:36 prudynt[649]: [INFO:VideoWorker.cpp]: PreTriggerBuffer initialized for channel 1
Relevant log — actual motion trigger
Aug 15 13:30:27 prudynt[649]: [INFO:Motion.cpp]: Motion Start
Aug 15 13:30:27 prudynt[649]: [INFO:MP4ControlSocket.cpp]: MP4ControlSocket: raw command buffer ('START /tmp/motion_20260815_133027.mp4 10 0 ') length=43
Aug 15 13:30:27 prudynt[649]: [INFO:MP4ControlSocket.cpp]: MP4ControlSocket: parsed op='START'
Aug 15 13:30:27 prudynt[649]: [INFO:MP4ControlSocket.cpp]: MP4ControlSocket: START requested, path='/tmp/motion_20260815_133027.mp4' duration=10s channel=0
Aug 15 13:30:27 prudynt[649]: [INFO:MP4Muxer_simple.cpp]: SimpleMP4Muxer: audio enabled sample_rate=16000Hz channels=1 config_bytes=2
Aug 15 13:30:27 prudynt[649]: [INFO:MP4ControlSocket.cpp]: MP4ControlSocket: recorder started with avcC payload size=55 on channel 0
No PreTriggerBuffer log lines appear anywhere after initialization — not during this event or any other motion trigger in the session.
Analysis
The motion daemon (via motion.script_path → motion-mountguard) triggers recording by writing a plain START <path> <duration> <channel> command to the /run/prudynt/mp4ctl FIFO, handled by MP4ControlSocket/SimpleMP4Muxer. This protocol has no parameter for pulling frames from PreTriggerBuffer, and nothing in MP4ControlSocket.cpp appears to reference the buffer when starting a new recording. The buffer fills continuously in memory but is never read from.
Expected behavior
With prebuffer_enabled: true and prebuffer_seconds: 5, a motion-triggered clip should include ~5 seconds of buffered footage prior to the Motion Start timestamp.
Actual behavior
Clips start exactly at the Motion Start timestamp with zero pre-roll, even though PreTriggerBuffer is active and has frames available.
Environment
recorder.enabled: true, recorder.autostart: false (motion-only recording, no continuous recording)
Motion clips delivered via NFS (motion.send2storage: true)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I'm not sure if my finding is a bug or an issue, this is why I'm posting it here first. Here is what I'm struggling with:
Pre-trigger buffer not spliced into motion-triggered recordings
Build: prudynt-t 313414b92c (Jun 22 2026 18:03:14)
Firmware: thingino ciao+efc921c
Camera: Wyze Cam v3 (wyze_cam3_t31x_gc2053_atbm6031)
Description
PreTriggerBufferinitializes correctly at startup for both channels (5s duration, 5MB limit), but it is never consulted when a motion event triggers a recording. Motion-triggered clips start exactly at the moment motion is detected (or ~1 second later), with no pre-roll, despiterecorder.prebuffer_enabled: trueandrecorder.prebuffer_seconds: 5inprudynt.json.Config
Relevant log — startup
Jun 22 14:03:36 prudynt[649]: [INFO:PreTriggerBuffer.cpp]: PreTriggerBuffer initialized: 5s duration, 5MB limit, max_capacity=300, keyframe_only=0
Jun 22 14:03:36 prudynt[649]: [INFO:VideoWorker.cpp]: PreTriggerBuffer initialized for channel 0
Jun 22 14:03:36 prudynt[649]: [INFO:PreTriggerBuffer.cpp]: PreTriggerBuffer initialized: 5s duration, 5MB limit, max_capacity=300, keyframe_only=0
Jun 22 14:03:36 prudynt[649]: [INFO:VideoWorker.cpp]: PreTriggerBuffer initialized for channel 1
Relevant log — actual motion trigger
Aug 15 13:30:27 prudynt[649]: [INFO:Motion.cpp]: Motion Start
Aug 15 13:30:27 prudynt[649]: [INFO:MP4ControlSocket.cpp]: MP4ControlSocket: raw command buffer ('START /tmp/motion_20260815_133027.mp4 10 0 ') length=43
Aug 15 13:30:27 prudynt[649]: [INFO:MP4ControlSocket.cpp]: MP4ControlSocket: parsed op='START'
Aug 15 13:30:27 prudynt[649]: [INFO:MP4ControlSocket.cpp]: MP4ControlSocket: START requested, path='/tmp/motion_20260815_133027.mp4' duration=10s channel=0
Aug 15 13:30:27 prudynt[649]: [INFO:MP4Muxer_simple.cpp]: SimpleMP4Muxer: audio enabled sample_rate=16000Hz channels=1 config_bytes=2
Aug 15 13:30:27 prudynt[649]: [INFO:MP4ControlSocket.cpp]: MP4ControlSocket: recorder started with avcC payload size=55 on channel 0
No
PreTriggerBufferlog lines appear anywhere after initialization — not during this event or any other motion trigger in the session.Analysis
The motion daemon (via
motion.script_path→motion-mountguard) triggers recording by writing a plainSTART <path> <duration> <channel>command to the/run/prudynt/mp4ctlFIFO, handled byMP4ControlSocket/SimpleMP4Muxer. This protocol has no parameter for pulling frames fromPreTriggerBuffer, and nothing inMP4ControlSocket.cppappears to reference the buffer when starting a new recording. The buffer fills continuously in memory but is never read from.Expected behavior
With
prebuffer_enabled: trueandprebuffer_seconds: 5, a motion-triggered clip should include ~5 seconds of buffered footage prior to theMotion Starttimestamp.Actual behavior
Clips start exactly at the
Motion Starttimestamp with zero pre-roll, even thoughPreTriggerBufferis active and has frames available.Environment
recorder.enabled: true,recorder.autostart: false(motion-only recording, no continuous recording)motion.send2storage: true)stream0: 1920x1080, H264, 3000kbps, 30fpsAll reactions