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似乎不能够工作。

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

猜你喜欢

转载自blog.51cto.com/14021402/2313579