date: 2026-11-24 ; ffmpeg: ffmpeg version 6.1.1-3ubuntu5 == inputs (constructed from LibriVox speech; true recorder head start 1.400 s; true clap at 3.000 s in camera file) clap in camera.mp4: 3.007 s ; flash frame in camera.mp4: 3.000 s ; clap in recorder.wav: 4.409 s offset (recorder clap minus camera clap): 1.402 s == CONTROL 1: the camera file's own sound against its own flash (known answer: about 0) error camera.mp4: +0.007 s == trim and replace exit=0 trim tool finished in 0.4 s saved out/replaced.mp4 replaced.mp4: clap 3.007 s, flash 3.000 s, error +0.007 s == CONTROL 2: untrimmed recorder track through the same tool (known answer: about +1.4 s) tool finished in 0.4 s saved out/untrimmed.mp4 untrimmed.mp4: clap 4.402 s, flash 3.000 s, error +1.402 s == picture untouched? md5 of the decoded-copy video stream in/camera.mp4 MD5=ffa0902db6dd99b459917d49d9afae06 out/replaced.mp4 MD5=ffa0902db6dd99b459917d49d9afae06 out/untrimmed.mp4 MD5=ffa0902db6dd99b459917d49d9afae06 == EDGE: recorder started 1.0 s AFTER the camera (negative offset), padded with adelay recorder-late clap 2.009 s ; offset -0.998 s exit=0 pad 998 ms tool finished in 0.6 s saved out/replaced-late.mp4 replaced-late.mp4: clap 3.007 s, flash 3.000 s, error +0.007 s == durations in/camera.mp4 20.000000 s video=20.000000 s out/replaced.mp4 20.000000 s video=20.000000 s out/untrimmed.mp4 20.000000 s video=20.000000 s out/replaced-late.mp4 20.000000 s video=20.000000 s DONE == CONTROL 3: is the replaced sound the recorder track? mean level above 4 kHz (camera track was low-passed at 3 kHz) in/camera.mp4 mean_volume: -55.1 dB out/replaced.mp4 mean_volume: -39.2 dB in/recorder.wav mean_volume: -39.2 dB == ffmpeg route (cmds/replaced.mp4): clap 3.007 s, flash 3.000 s == streams of out/replaced.mp4 h264,video,3661402 aac,audio,179668 == fix round 1 (2026-11-24): lengths and the ffmpeg route with a shorter recorder track cmds/recorder-trimmed.wav 20.598 s (recorder.wav 22.000 s, camera.mp4 20.000 s) ffmpeg route, recorder track cut to 12.000 s, no apad: output 12.000 s (picture cut) ffmpeg route, same track, -af apad: output 20.000 s, video MD5=ffa0902db6dd99b459917d49d9afae06 ffmpeg route, trimmed track (20.598 s), -af apad: output 20.000 s, video MD5=ffa0902db6dd99b459917d49d9afae06 untrimmed.mp4 clap 4.402 s against 4.409 s in recorder.wav: 7 ms, not explained levels above 4 kHz: ffmpeg -i FILE -af highpass=f=4000,volumedetect -vn -f null - (commands.log) resolution: one frame at 25 fps = 0.040 s; clap length 0.012 s; so differences under about 0.04 s are not resolved