AWS Lambdaでビデオ処理スクリプトを実行しています。AWS Lambdaの 'Fluent-ffmpegモジュールが見つかりません'
それは(lambda-localを使用してテストした)完全にローカルで動作するように思えますが、それはラムダ上で実行したとき、私は奇妙な問題を抱えている:
{
"errorMessage": "Cannot find module 'fluent-ffmpeg'",
"errorType": "Error",
"stackTrace": [
"Function.Module._resolveFilename (module.js:338:15)",
"Function.Module._load (module.js:280:25)",
"Module.require (module.js:364:17)",
"require (module.js:380:17)",
"Object.<anonymous> (/var/task/processing.js:2:14)",
"Module._compile (module.js:456:26)",
"Object.Module._extensions..js (module.js:474:10)",
"Module.load (module.js:356:32)",
"Function.Module._load (module.js:312:12)",
"Module.require (module.js:364:17)"
]
}
私はアップロードには、以下のファイルが含まれていZIP:
を~$ find . -maxdepth 2
.
./bin
./bin/ffmpeg
./config.js
./event-samples
./event-samples/custom.js
./event-samples/dynamodb-update.js
./event-samples/kinesis.js
./event-samples/s3-put.js
./frames
./Gulpfile.js
./index.js
./node_modules
./node_modules/async
./node_modules/aws-sdk
./node_modules/fluent-ffmpeg
./node_modules/gulp
./node_modules/gulp-awslambda
./node_modules/gulp-zip
./package.json
./processing.js
./utils.js
(バギーが必要processing.jsに位置しています)
私はZIPを開くと、node_modules/fluent-ffmpeg/*
が存在します。
私が使用して、モジュールを含めることを試みた:
require("./node_modules/fluent-ffmpeg/index")
require(__dirname + "./node_modules/fluent-ffmpeg/index")
require(process.env.LAMBDA_TASK_ROOT + "/node_modules/fluent-ffmpeg/index")
をしかし、これらのどれも問題は解決しません。私はまた、マシンにノードとnpmを再インストールしようとしました。rm -rf node_modules
とnpm install
(まあまあです)。
ラムダはノード0.10.36を実行しているので、私はnpm install
を実行するために私のマシンでこのバージョンを使ってみましたが、何も変わりません。
ヘルプありがとうございます。
ありがとうございます!
代わりに[AWSフォーク代わりに](https://github.com/binoculars/aws-lambda-ffmpeg)を試してみてください。 – Andy
私が間違っていない限り、このライブラリはビデオサムネイルのサイズ変更と生成用です。その場合は、私がしなければならないこと(ビデオの各フレームを抽出する)には適用されません – christophetd
申し訳ありませんが、私はそれが同じライブラリだと思いました。 – Andy