我正在Heroku上托管一个Discord音乐机器人,但似乎无法播放音乐,因为找不到FFMPEG。这是可以理解的,因为FFMPEG只能在我的PC上使用,而无法在外部云上使用。我该如何在Heroku上安装FFMPEG?
以下是我自己的解决方案,希望分享我所发现的内容:
Heroku支持将ffmpeg作为构建包添加到您的应用程序中。只需打开您的应用程序设置,在 https://dashboard.heroku.com/apps/[app-name]/settings
中向下滚动到构建包,然后添加 https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git 到其中。
或者您也可以运行CLI命令:
$ heroku buildpacks:add https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git
https://elements.heroku.com/buildpacks/jonathanong/heroku-buildpack-ffmpeg-latest
heroku buildpacks:add --index 1 https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git
。 - stevec