ffmpeg's silencedetect Found Nothing at -40 dB: Finding the Noises in a Long Recording
A phone left recording overnight hands you a file far longer than anyone will listen to. Something made a noise at some point, and you want the timestamps, not the eight hours. ffmpeg's silencedetect filter logs where the audio goes quiet, so everything between those quiet stretches is when something happened. I built two ten-minute test recordings with three known sounds in each and ran…
In a test of the ffmpeg silencedetect filter, three synthetic audio recordings were created, each ten minutes long and comprised of random noise at -50 dB RMS with three distinct sounds at known times. The first recording had three tonal bursts at 100 seconds, peaking near -10 dB, followed by a 40 ms click at 250 seconds, and two seconds of speech-band noise at 400 seconds.
The second recording added a constant 60 Hz hum at -26 dB to the first recording. The silencedetect filter was then applied to each recording at various threshold levels, from -40 dB to -36 dB, to identify any moments of silence. The filter reported no events at -40 dB, but failed to find the room quiet at any point, as the background noise averaged -51 dB but peaked at -37.1 dB.
The filter's threshold behaved like a test against the peaks, with -38 dB yielding 143 stretches of activity and -36 dB yielding the correct three events. A constant fan hum reduced the working range of thresholds from at least 16 dB to about 4, and a 300 Hz high-pass filter restored it. The duration setting of 0.2 seconds caused a bark-like burst to split into three events, while a duration of 1 second counted it as one event.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.