I'm using a library called 'fluent-ffmpeg' on my Nodejs server that makes it easier to use an audio/video editing tool called FFmpeg, which is downloaded locally on my computer.
When running on my computer, I point fluent-ffmpeg to the local executable files of FFmpeg and FFprobe on my computer, like so:
import ffmpeg from "fluent-ffmpeg";
// When running locally, set FFmpeg and FFprobe path to the local executable files
ffmpeg.setFfmpegPath("C:/Program Files/FFMPEG/ffmpeg.exe");
ffmpeg.setFfprobePath("C:/Program Files/FFMPEG/ffprobe.exe");
When deploying to Heroku, I must use an FFmpeg 'buildpack'.
I've tried two:
- https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest
- https://github.com/HasibulKabir/heroku-buildpack-ffmpeg-ffprobe
Neither have worked for me. Whenever I use an FFmpeg command, I get the following error in my heroku logs:
2021-07-24T15:22:52.970990+00:00 app[web.1]: code: 'ENOENT',
2021-07-24T15:22:52.970990+00:00 app[web.1]: syscall: 'spawn C:/Program Files/FFMPEG/',
2021-07-24T15:22:52.970990+00:00 app[web.1]: path: 'C:/Program Files/FFMPEG/',
2021-07-24T15:22:52.970991+00:00 app[web.1]: spawnargs: [
2021-07-24T15:22:52.970991+00:00 app[web.1]: '-show_streams',
2021-07-24T15:22:52.970991+00:00 app[web.1]: '-show_format',
2021-07-24T15:22:52.970992+00:00 app[web.1]: 'temp/cf3b5f1ae270df824921364573a4366b'
2021-07-24T15:22:52.970992+00:00 app[web.1]: ]
2021-07-24T15:22:52.970992+00:00 app[web.1]: }
How can I go about using fluent-ffmpeg in my Nodejs server when deploying to Heroku?
Thank you for the help in advance!