Jeroen Ooms
Jeroen Ooms

Reputation: 32978

How to output raw frequency (fft) data using ffmpeg / libavfilter

I'm trying to write libavfilter bindings to convert an arbitrary audio file into a raw frequency (spectrum) data to do subsequent audio analysis. Is there anything built-in ffmpeg or libavfilter to output binary frequency data, rather than a proper audio/video file?

FFmpeg has a few built-in filters that perform an FFT such as afftfilt and showfreqs, however these filters always convert output back to video or audio. What I need is something like the afftfilt filter, but which dumps the raw FFT data, rather than recode it back to PCM.

Upvotes: 6

Views: 3045

Answers (1)

Sinus tentaclemonster
Sinus tentaclemonster

Reputation: 548

Depending on how accurate you need the FFT to be, and whether you need the imaginary part, you could macgyver something out of the showspectrum filter output - have it output to raw bitmaps and treat these as byte arrays.

Upvotes: 1

Related Questions