且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

node.js:如何管道-***到mp4到mp3

更新时间:2023-01-25 16:23:38

与其传递mp4文件的位置,不如传递ytdl流作为源,就像这样:

Instead of passing the location of mp4 file, pass in the ytdl stream as the source, like so:

stream = ytdl(url)

proc = new ffmpeg({source:stream})
proc.setFfmpegPath('/Applications/ffmpeg')
proc.saveToFile(mp3, (stdout, stderr)->
            return console.log stderr if err?
            return console.log 'done'
        )