test: find-clap.py, flash.py and ffmpeg 6.1.1 on constructed files (LibriVox speech + synthetic clap), 2026-11-24 published: python3 find-clap.py camera.mp4 command as run: python3 find-clap.py camera.mp4 exit=0 edge: case run: main: camera file with the clap at 3 s output: 3.007 s (peak 2.5 times the loudest sound elsewhere) published: python3 find-clap.py recorder.wav command as run: python3 find-clap.py recorder.wav exit=0 edge: case run: main: recorder file with the clap at 4.4 s output: 4.409 s (peak 2.7 times the loudest sound elsewhere) published: python3 find-clap.py camera.mp4 command as run: python3 find-clap.py missing.mp4 exit=1 edge: case run: missing file output: find-clap: file not found: missing.mp4 published: python3 find-clap.py camera.mp4 command as run: python3 find-clap.py empty.wav exit=1 edge: case run: empty file output: find-clap: file is empty: empty.wav published: python3 find-clap.py camera.mp4 command as run: python3 find-clap.py silent.wav exit=1 edge: case run: 3 s of digital silence output: find-clap: the file is silent in the first 30 seconds published: python3 find-clap.py recorder.wav command as run: python3 find-clap.py 'запись интервью.wav' exit=0 edge: case run: non-ASCII file name output: 4.409 s (peak 2.7 times the loudest sound elsewhere) published: python3 find-clap.py recorder.wav command as run: python3 find-clap.py notaudio.wav exit=1 edge: case run: text file with Windows line breaks instead of audio output: find-clap: ffmpeg could not read audio from notaudio.wav: [in#0 @ 0x58e673a2ddc0] Error opening input: Invalid data found when processing input output: Error opening input file notaudio.wav. output: Error opening input files: Invalid data found when processing input published: ffmpeg -ss 1.402 -i recorder.wav -c:a pcm_s16le recorder-trimmed.wav command as run: ffmpeg -v error -y -ss 1.402 -i recorder.wav -c:a pcm_s16le recorder-trimmed.wav exit=0 edge: case run: main: recorder started 1.4 s before the camera output: published: ffmpeg -ss 1.402 -i recorder.wav -c:a pcm_s16le recorder-trimmed.wav command as run: ffmpeg -v error -y -ss 30 -i recorder.wav -c:a pcm_s16le trimmed-too-far.wav; ls -l trimmed-too-far.wav | awk '{print $5, "bytes"}' exit=0 edge: case run: offset 30 s is longer than the 22 s recording (ffmpeg writes a file with no audio) output: 272 bytes published: ffmpeg -i recorder-late.wav -af "adelay=998:all=1" -c:a pcm_s16le recorder-late-padded.wav command as run: ffmpeg -v error -y -i recorder-late.wav -af adelay=998:all=1 -c:a pcm_s16le recorder-late-padded.wav exit=0 edge: case run: main: recorder started 1.0 s after the camera output: published: ffmpeg -i recorder-late.wav -af "adelay=998:all=1" -c:a pcm_s16le recorder-late-padded.wav command as run: ffmpeg -v error -y -i empty.wav -af adelay=998:all=1 -c:a pcm_s16le x.wav exit=183 edge: case run: empty input file output: [in#0 @ 0x634052633dc0] Error opening input: Invalid data found when processing input output: Error opening input file empty.wav. output: Error opening input files: Invalid data found when processing input published: ffmpeg -i camera.mp4 -i recorder-trimmed.wav -map 0:v -map 1:a -c:v copy -c:a aac -b:a 192k -shortest replaced.mp4 command as run: ffmpeg -v error -y -i camera.mp4 -i recorder-trimmed.wav -map 0:v -map 1:a -c:v copy -c:a aac -b:a 192k -shortest replaced.mp4 exit=0 edge: case run: main: trimmed recorder track, ffmpeg route output: published: ffmpeg -i camera.mp4 -i recorder-trimmed.wav -map 0:v -map 1:a -c:v copy -c:a aac -b:a 192k -shortest replaced.mp4 command as run: ffmpeg -v error -y -i camera.mp4 -i recorder-late-padded.wav -map 0:v -map 1:a -c:v copy -c:a aac -b:a 192k -shortest replaced-late.mp4 exit=0 edge: case run: padded late recorder track output: published: ffmpeg -v error -i replaced.mp4 -map 0:v:0 -c copy -f md5 - command as run: ffmpeg -v error -i camera.mp4 -map 0:v:0 -c copy -f md5 - exit=0 edge: case run: main: camera file (same checksum expected) output: MD5=ffa0902db6dd99b459917d49d9afae06 published: ffmpeg -v error -i replaced.mp4 -map 0:v:0 -c copy -f md5 - command as run: ffmpeg -v error -i replaced.mp4 -map 0:v:0 -c copy -f md5 - exit=0 edge: case run: main: ffmpeg route result output: MD5=ffa0902db6dd99b459917d49d9afae06 published: ffmpeg -v error -i replaced.mp4 -map 0:v:0 -c copy -f md5 - command as run: ffmpeg -v error -i replaced-late.mp4 -map 0:v:0 -c copy -f md5 - exit=0 edge: case run: padded late recorder result output: MD5=ffa0902db6dd99b459917d49d9afae06 published: python3 find-clap.py replaced.mp4 command as run: python3 find-clap.py replaced.mp4 exit=0 edge: case run: main: ffmpeg route result, clap time output: 3.007 s (peak 2.6 times the loudest sound elsewhere) published: python3 flash.py replaced.mp4 command as run: python3 flash.py replaced.mp4 exit=0 edge: case run: main: ffmpeg route result, flash time output: 3.000 s published: python3 flash.py replaced.mp4 command as run: python3 flash.py missing.mp4 exit=1 edge: case run: missing file output: flash: file not found: missing.mp4 published: python3 flash.py replaced.mp4 command as run: python3 flash.py empty.wav exit=1 edge: case run: empty file output: flash: file is empty: empty.wav published: python3 flash.py replaced.mp4 command as run: python3 flash.py noflash.mp4 exit=1 edge: case run: clip with no white flash output: flash: no frame brighter than 230 found in noflash.mp4 published: python3 flash.py replaced.mp4 command as run: python3 flash.py 'запись интервью.wav' exit=1 edge: case run: non-ASCII file name, audio only (no video stream) output: flash: ffmpeg could not read video from запись интервью.wav: Stream map '0:v:0' matches no streams. output: To ignore this, add a trailing '?' to the map. output: Failed to set value '0:v:0' for option 'map': Invalid argument published: ffprobe -v error -show_entries format=duration -of csv=p=0 recorder-trimmed.wav command as run: ffprobe -v error -show_entries format=duration -of csv=p=0 recorder-trimmed.wav exit=0 edge: case run: main: trimmed recorder track (20.598 s) against the 20 s camera file output: 20.598000 published: ffprobe -v error -show_entries format=duration -of csv=p=0 recorder-trimmed.wav command as run: ffprobe -v error -show_entries format=duration -of csv=p=0 short.wav exit=0 edge: case run: recorder track trimmed to 12 s, shorter than the 20 s picture output: 12.000000 published: ffprobe -v error -show_entries format=duration -of csv=p=0 recorder-trimmed.wav command as run: ffprobe -v error -show_entries format=duration -of csv=p=0 empty.wav exit=1 edge: case run: empty file output: empty.wav: Invalid data found when processing input published: ffmpeg -i camera.mp4 -i recorder-trimmed.wav -map 0:v -map 1:a -c:v copy -af apad -c:a aac -b:a 192k -shortest replaced.mp4 command as run: ffmpeg -v error -y -i camera.mp4 -i recorder-trimmed.wav -map 0:v -map 1:a -c:v copy -af apad -c:a aac -b:a 192k -shortest r-apad-main.mp4; ffprobe -v error -show_entries format=duration -of csv=p=0 r-apad-main.mp4 exit=0 edge: case run: main: trimmed track longer than the picture, output duration printed output: 20.000000 published: ffmpeg -i camera.mp4 -i recorder-trimmed.wav -map 0:v -map 1:a -c:v copy -af apad -c:a aac -b:a 192k -shortest replaced.mp4 command as run: ffmpeg -v error -y -i camera.mp4 -i short.wav -map 0:v -map 1:a -c:v copy -af apad -c:a aac -b:a 192k -shortest r-apad.mp4; ffprobe -v error -show_entries format=duration -of csv=p=0 r-apad.mp4 exit=0 edge: case run: 12 s recorder track, apad keeps the full 20 s picture output: 20.000000 published: ffmpeg -i camera.mp4 -i recorder-trimmed.wav -map 0:v -map 1:a -c:v copy -af apad -c:a aac -b:a 192k -shortest replaced.mp4 command as run: ffmpeg -v error -y -i camera.mp4 -i short.wav -map 0:v -map 1:a -c:v copy -c:a aac -b:a 192k -shortest r-short.mp4; ffprobe -v error -show_entries format=duration -of csv=p=0 r-short.mp4 exit=0 edge: case run: the same 12 s track WITHOUT apad: picture cut to 12 s output: 12.000000 published: ffmpeg -i camera.mp4 -i recorder-trimmed.wav -map 0:v -map 1:a -c:v copy -af apad -c:a aac -b:a 192k -shortest replaced.mp4 command as run: ffmpeg -v error -y -i camera.mp4 -i empty.wav -map 0:v -map 1:a -c:v copy -af apad -c:a aac -shortest x.mp4 exit=183 edge: case run: empty recorder file output: [in#1 @ 0x5736771fd340] Error opening input: Invalid data found when processing input output: Error opening input file empty.wav. output: Error opening input files: Invalid data found when processing input published: ffmpeg -i replaced.mp4 -af highpass=f=4000,volumedetect -vn -f null - command as run: ffmpeg -hide_banner -i ../in/camera.mp4 -af highpass=f=4000,volumedetect -vn -f null - 2>&1 | grep mean_volume exit=0 edge: case run: main: camera file output: [Parsed_volumedetect_1 @ 0x6497a2b701c0] mean_volume: -55.1 dB published: ffmpeg -i replaced.mp4 -af highpass=f=4000,volumedetect -vn -f null - command as run: ffmpeg -hide_banner -i ../in/recorder.wav -af highpass=f=4000,volumedetect -vn -f null - 2>&1 | grep mean_volume exit=0 edge: case run: main: recorder file output: [Parsed_volumedetect_1 @ 0x599cac731ac0] mean_volume: -39.2 dB published: ffmpeg -i replaced.mp4 -af highpass=f=4000,volumedetect -vn -f null - command as run: ffmpeg -hide_banner -i replaced.mp4 -af highpass=f=4000,volumedetect -vn -f null - 2>&1 | grep mean_volume exit=0 edge: case run: main: output file output: [Parsed_volumedetect_1 @ 0x5acb3dda1ec0] mean_volume: -39.2 dB published: ffmpeg -i replaced.mp4 -af highpass=f=4000,volumedetect -vn -f null - command as run: ffmpeg -v error -i empty.wav -af highpass=f=4000,volumedetect -vn -f null - exit=183 edge: case run: empty file output: [in#0 @ 0x5fd5f187bdc0] Error opening input: Invalid data found when processing input output: Error opening input file empty.wav. output: Error opening input files: Invalid data found when processing input published: ffmpeg -i replaced.mp4 -af highpass=f=4000,volumedetect -vn -f null - command as run: ffmpeg -v error -i ../cmds/noflash.mp4 -af highpass=f=4000,volumedetect -vn -f null - exit=234 edge: case run: video with no audio stream (ffmpeg stops, exit 234) output: [out#0/null @ 0x5940e6d347c0] Output file does not contain any stream output: Error opening output file -. output: Error opening output files: Invalid argument published: ffmpeg -ss 1.402 -i recorder.wav -c:a pcm_s16le recorder-trimmed.wav command as run: ffmpeg -v error -y -ss -1 -i recorder.wav -c:a pcm_s16le neg.wav; ffprobe -v error -show_entries format=duration -of csv=p=0 neg.wav exit=0 edge: case run: negative -ss (wrong sign), accepted without a warning output: 22.000000