英文:
How to output raw frequency (fft) data using ffmpeg / libavfilter
问题
我正在尝试编写libavfilter的绑定以将任意音频文件转换为原始频率(频谱)数据,以进行后续音频分析。是否有ffmpeg或libavfilter内置的功能可输出二进制频率数据,而不是正确的音频/视频文件?
FFmpeg有一些内置滤镜可以执行FFT,例如afftfilt和showfreqs,但是这些滤镜总是将输出转换回视频或音频。我需要的是类似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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论