wavesurfer fluent-ffmpeg提取音频

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了wavesurfer fluent-ffmpeg提取音频相关的知识,希望对你有一定的参考价值。

我试图得到一个视频音频文件wavesurfer所以可以显示波。 我用fluent-ffmpeg表达应用。

我已经得到了处理

app.get(‘/audio/:file‘, (req, res) => ffmpeg.audio(req, res))

const path = req.params.file
const file = path.replace(‘MP4‘, ‘wav‘)
ffmpeg(path)
.noVideo()
.withAudioCodec(‘copy‘)
.toFormat(‘wav‘)
.on(‘progress‘, console.log)
.on(‘error‘, console.log)
.on(‘end‘,()=> res.sendFile(file))
.save(file)
然后在wavesurfer

this.wavesurfer.load(encodeURI(${LOCAL_SERVER}/audio/${video.file}))
这似乎与较小的文件,但它不是与更大的文件。 我试流输出但是wavesurfer似乎不能够工作。

知道在这个最好的方法吗?

以上是关于wavesurfer fluent-ffmpeg提取音频的主要内容,如果未能解决你的问题,请参考以下文章

在 electron 中打开本地文件并在 wavesurfer.js 中渲染

由于 cookie,Wavesurfer 不会使用 CROS 错误绘制波浪

使用网络音频 api 和 wavesurfer.js 剪切和粘贴音频

vue 绘制波形图 wavesurfer.js (音频/视频) 实用教程

尝试将 wavesurfer.js 与 ReactNative 一起使用,但得到 Can't find variable: document

fluent-ffmpeg 常用函数