如何使用ffmpeg / libavfilter输出原始频率(fft)数据

huangapple go评论56阅读模式
英文:

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

问题

我正在尝试编写libavfilter的绑定以将任意音频文件转换为原始频率(频谱)数据,以进行后续音频分析。是否有ffmpeg或libavfilter内置的功能可输出二进制频率数据,而不是正确的音频/视频文件?

FFmpeg有一些内置滤镜可以执行FFT,例如afftfiltshowfreqs,但是这些滤镜总是将输出转换回视频或音频。我需要的是类似afftfilt滤镜,但它会转储原始FFT数据,而不是重新编码为PCM。

英文:

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.

答案1

得分: 1

根据您需要FFT的精确度以及是否需要虚部,您可以从showspectrum滤镜的输出中创建一些东西 - 将其输出为原始位图并将其视为字节数组。

英文:

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.

huangapple
  • 本文由 发表于 2020年1月3日 21:19:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/59579303.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定