I'm using showfreqs and various other audio viz filters to create cool spectrum visualizations for my self-released music.

Going through the documentation, I see that there's a multitude of win_funcs you can use with showfreqs (and others): https://ffmpeg.org/ffmpeg-filters.html#showfreqs

I tried reading about these different windowing functions on wikipedia: https://en.wikipedia.org/wiki/Window_function

While I understand generally that you choose a windowing function based on how you want to handle spectral leakage, I can't really understand the math that's involved here... it's over my head.

So... my question really boils down to:

What's the right windowing function to use for visualizing music? Is there a best practice here?

hanning (the default) seems to work ok... I tried a few others but I'm having trouble actually observing what the differences are between them...

1 Answer 1


You be better off not care about window functions, no one pays attention to the rendered audio spectrum. Therefore you need not to be analytically correct so you can let spectral leakages happen and just use the rect window. Which is the identity window, simply put, FFmpeg doesn't do any windowing in this mode and performs plain STFT on the audio waveform slicing each in win_size sized blocks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.