将 ffmpeg 添加到 heroku buildpack nodejs
Adding ffmpeg to heroku buildback nodejs
我一直在尝试制作一个可以可视化音乐的服务器(This is what I have so far). That's been successful but I want to try and make it work with youtube videos, and I've found a lot of repositories on github for youtube video to audio conversion that make this reasonably doable, but in order to deploy a server on heroku that can host temporary audio files of youtube videos in the format that I want, I'd need to include ffmpeg
in a buildpack and I'm not sure how to go about doing that. This is the heroku buildpack for node.js但我不太明白它是如何工作的。
TL;DR:在 github 上分叉 heroku-buildpack-nodejs 存储库后我需要执行哪些步骤才能成功部署 node.js 服务器到 heroku 和 运行 这个代码?
var conversionProcess = child_process.spawn(
'ffmpeg',
['-i', 'some_youtube_audio.mp3', 'some_youtube_audio.webm'],
{
cwd: __dirname + '/tmp'
}
);
顺便说一句,此函数的文档在 node.js API 上。
你应该使用多件装 https://github.com/ddollar/heroku-buildpack-multi
然后使用节点 buildpack 以及 ffmpeg buildpack https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest
我一直在尝试制作一个可以可视化音乐的服务器(This is what I have so far). That's been successful but I want to try and make it work with youtube videos, and I've found a lot of repositories on github for youtube video to audio conversion that make this reasonably doable, but in order to deploy a server on heroku that can host temporary audio files of youtube videos in the format that I want, I'd need to include ffmpeg
in a buildpack and I'm not sure how to go about doing that. This is the heroku buildpack for node.js但我不太明白它是如何工作的。
TL;DR:在 github 上分叉 heroku-buildpack-nodejs 存储库后我需要执行哪些步骤才能成功部署 node.js 服务器到 heroku 和 运行 这个代码?
var conversionProcess = child_process.spawn(
'ffmpeg',
['-i', 'some_youtube_audio.mp3', 'some_youtube_audio.webm'],
{
cwd: __dirname + '/tmp'
}
);
顺便说一句,此函数的文档在 node.js API 上。
你应该使用多件装 https://github.com/ddollar/heroku-buildpack-multi
然后使用节点 buildpack 以及 ffmpeg buildpack https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest