I have an AWS Lambda layer containing nodejs ffmpeg-static. Calling "ffmpeg.path" will return the correct location of the ffmpeg executable in the layer.
But any call to ffmpeg will stop silently, making it impossible for me to know what caused the error. Here is my test function:
const exec = require( "child_process" ).exec
const ffmpeg = require( "ffmpeg-static" )
exports.handler = async (event, context, callback ) => {
console.log( ffmpeg.path ) // Outputs: "/opt/nodejs/node_modules/ffmpeg-static/bin/linux/x64/ffmpeg"
exec( ffmpeg.path + " -version",
function( error, stdout, stderr ) {
console.log( stdout ) // Nothing
console.log( stderr ) // Nothing
if ( error ) {
console.log( error ) // Nothing
}
}
)
The exec() callback is never triggered. How can I identify the problem ?