I am building a lambda function that requires ffmpeg. The error that I am getting is:
ERROR :: Error: Cannot find ffmpeg
Relevant code to the problem is below...
process.env['PATH'] = process.env['PATH'] + "/" + process.env['LAMBDA_TASK_ROOT']
process.env['PATH'] = process.env['PATH'] + ':/tmp/'
var ffmpeg = require('fluent-ffmpeg')
exports.handler = (event, context, callback) => {
var proc = new ffmpeg();
proc.addInput('testfile.mp4)
.on('start', function(ffmpegCommand) {
})
.on('progress', function(data) {
})
.on('end', function() {
})
.on('error', function(error) {
/// ERROR IS HERE
})
.outputOptions(['-hls_time 10'])
.output(fileName + '.m3u8')
.run();
}
Here's my ZIP structure:
./ffmpeg
./ffprobe
./index.js
./node_modules
./node_modules/aws-sdk
./node_modules/ffmpeg
./node_modules/fluent-ffmpeg
./package.json
I've read around and have seen people mention chmod
-ing ffmpeg and ffprobe, and I tried that using chmod 755
on both executables, and that didn't work.
Also read about having to change the path. I tried what I could, and was unsuccessful again. I am not sure where to turn from here, or how to further diagnose what I am doing wrong. Any help would be greatly appreciated. Thanks!