1
votes

I'm trying to include the ffmpeg library with AWS.

drwxrwxrwx 2 root root        0 Dec 22 13:04 bin
    -rwxrwxrwx 1 root root 40166912 Dec 22 11:50 ffmpeg.exe
    -rwxrwxrwx 1 root root       30 Dec 22 13:04 version.sh

drwxrwxrwx 2 root root        0 Dec 22 16:35 node_modules
-rwxrwxrwx 1 root root      594 Dec 22 13:03 package.json
-rwxrwxrwx 1 root root      818 Dec 30 11:04 SplitFrames.js

Below is what's in the main js file, SplitFrames.js

var execute = require('lambduh-execute');
var validate = require('lambduh-validate');

process.env['PATH'] = process.env['PATH'] + ':/tmp/:' + process.env['LAMBDA_TASK_ROOT']

exports.handler = function(event, context, callback) {
    var exec = require('child_process').exec;
    var cmd = 'ffmpeg -version';

    exec(cmd, function(error, stdout, stderr) {
        console.log(stdout);
        callback(null, stdout);
    }); 
}

I test the function in lambda and it outputs nothing. Wondering how to include the ffmpeg library with AWS and node js. Any help is greatly appreciated.

1

1 Answers

1
votes

It's unclear what problem are you trying to solve, could you please add it to your question?

From the extension it seems your are using wrong platforms binary there -rwxrwxrwx 1 root root 40166912 Dec 22 11:50 ffmpeg.exe, Lambda is using Linux kernel version – 4.4.35-33.55.amzn1.x86_64 (http://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html).

Instead of that you could use this node module https://github.com/eugeneware/ffmpeg-static which should contain all three big platforms, Linux, Windows included (installing binaries from 3rd party sites isn't good practice).

Make sure you get the execution path correct.