Can someone give me an ffmpeg audio filter that will reduce the hum in this clip to, let's say, -66 dB? This is for silence detection purposes so it should not significantly reduce the volume of music or speech, were there any.
This is the kind of thing I love seeing on Mastodon (assuming you get the correct answer, and few if any “I didn't actually try this but here's what I think the man page says”).
#ffmpeg can do audio processing? If the hum is from mains power, it is probably at 60Hz, with strong overtones at (odd) multiples of that, plus this high whine.
@mrblissett yes thanks, that was misleading. I didn’t know that, and figured if you do, you know what you want. In any case you want a notch filter at those frequencies, i.e. very narrow (high-Q) bandreject filter with gain to -inf or as low as it goes, maybe only -20dB for the overtones. You can do multiple filters more easily with [an]equalizer. Also checkout aspectralstats.
Content warning: I wonder who knows that off the top of their head. No need to be so harsh to a potential helper. I still don’t know what exactly you’re missing.
I then couldn't get anything with "afftdn=nr=66:nf=-80:tn=1" which should 'Reduce white noise by 66dB, also set initial noise floor to -80dB and enable automatic tracking of noise floor so noise floor will gradually change during processing'.
@wnd if it’s actual white noise it probably doesn’t compress well, so you could use ffmpeg with an audio compression codec and use output file size of audio chunks as a predictor of noise.
Paul Hoffman
in reply to jwz • • •jwz
in reply to Paul Hoffman • • •Paul Hoffman
in reply to jwz • • •joes⚠️
in reply to jwz • • •jwz
in reply to joes⚠️ • • •Matthew
in reply to jwz • • •I think they're asking IF ffmpeg can audio process, or maybe they didn't see ffmpeg in the sentence 🤷♂️
joes⚠️
in reply to Matthew • • •yes thanks, that was misleading. I didn’t know that, and figured if you do, you know what you want. In any case you want a notch filter at those frequencies, i.e. very narrow (high-Q) bandreject filter with gain to -inf or as low as it goes, maybe only -20dB for the overtones. You can do multiple filters more easily with [an]equalizer. Also checkout aspectralstats.
jwz
in reply to joes⚠️ • • •joes⚠️
in reply to jwz • • •jwz
in reply to joes⚠️ • • •joes⚠️
in reply to jwz • • •Content warning: I wonder who knows that off the top of their head. No need to be so harsh to a potential helper. I still don’t know what exactly you’re missing.
jwz
in reply to joes⚠️ • • •Matthew
in reply to jwz • • •https://ffmpeg.org/ffmpeg-filters.html#silencedetect
https://ffmpeg.org/ffmpeg-filters.html#silenceremove
jwz
in reply to Matthew • • •Will Deakin
in reply to jwz • • •I'm struggling with this as the hum is pretty much white noise up to 10kHz. I tried a couple of simple low and high pass filters using
$ ffmpeg -i hum.mp3 -af "highpass=6000" highpass.mp3
Or combinations of:
$ ffmpeg -i hum.mp3 -af "highpass=10000, lowpass=100" highpass.mp3
Which just flattens everything.
The spectrum .png was generated using:
$ fmpeg -i hum.mp3 -lavfi showspectrumpic=s=1024x1024 hum.png
Will Deakin
in reply to Will Deakin • • •I then couldn't get anything with "afftdn=nr=66:nf=-80:tn=1" which should 'Reduce white noise by 66dB, also set initial noise floor to -80dB and enable automatic tracking of noise floor so noise floor will gradually change during processing'.
meh
jwz
in reply to Will Deakin • • •jwz
in reply to Will Deakin • • •divx
in reply to jwz • • •Will Deakin
in reply to jwz • • •you can tune a highpass filter from mostly to completely removes the noise and gives a more or less a silent track.
The problem is the second bit, as if you apply the same filter to music you end up with the high-hat tsss.
(I combined Res by Underworld with the hum and ran the filter. I got great high-energy "tss tss tss" vibes for eight minutes but not much else.)
Equally I'm just messing. I have used ffmpeg filters but it's just a hobby. An expert may know how to get a better result.