derhuerst / ffprobe-static

Static binaries for ffprobe
MIT License
55 stars 50 forks source link

Command from ffprobe-static Error #19

Open PortugalNeto opened 2 years ago

PortugalNeto commented 2 years ago

Hello, everyone! I really hope you can help me with this issue:

I have an app that was built with microservices. One of them use ffprobe and ffprobe-static, just as follows:

 const getMediaS3 = async (event) => {
  const s3 = new S3();
  const params = {
    Bucket: event.Records[0].s3.bucket.name,
    Key: event.Records[0].s3.object.key
  };
  logger(`# getVideoInfo() - Getting video information`)
  await ffprobe(`https://${getEnv('CLOUDFRONT')}.cloudfront.net/${params.Key}`, { path: ffprobeStatic.path }, function (err, info) {
  if (err) {
    throw err;
  };
  const video = info.streams.find(s => s.codec_type === "video");
    const rotate = video.tags.rotate;
    if (rotate && (rotate === "90" || rotate === "270")) {
      width = video.height; 
      height = video.width;
    } else {
      width = video.width; 
      height = video.height;
    };
  }).catch(logger('It wasn't possible to catch video dimensions!'))

Locally it works just fine but when I deploy it I'm having this issue when the lambda function is called:

2022-09-27T20:21:03.463Z c4a0c5f5-ff06-4d00-861d-f61769b3f43b INFO # getVideoInfo() - Getting video information

2022-09-27T20:21:04.104Z c4a0c5f5-ff06-4d00-861d-f61769b3f43b ERROR Invoke Error
{ "errorType": "Error", "errorMessage": "Command failed: /var/task/node_modules/ffprobe-static/bin/linux/x64/ffprobe -v quiet -print_format json -show_format -show_streams https://########.cloudfront.net/media/videos/temp/1664310055808.mp4\n", "code": 1, "killed": false, "signal": null, "cmd": "/var/task/node_modules/ffprobe-static/bin/linux/x64/ffprobe -v quiet -print_format json -show_format -show_streams https://########.cloudfront.net/media/videos/temp/1664310055808.mp4", "stack": [ "Error: Command failed: /var/task/node_modules/ffprobe-static/bin/linux/x64/ffprobe -v quiet -print_format json -show_format -show_streams https://########.cloudfront.net/media/videos/temp/1664310055808.mp4", "", " at ChildProcess.exithandler (child_process.js:308:12)", " at ChildProcess.emit (events.js:314:20)", " at ChildProcess.EventEmitter.emit (domain.js:483:12)", " at maybeClose (internal/child_process.js:1022:16)", " at Socket. (internal/child_process.js:444:11)", " at Socket.emit (events.js:314:20)", " at Socket.EventEmitter.emit (domain.js:483:12)", " at Pipe. (net.js:675:12)" ] } PS. I've omitted my cloudfront distribution id; Node version of the Lamda is 12.x. ffprobe-static: 3.1.0 Do you need any further informations?

willbattel commented 1 year ago

This looks to possibly be a similar or the same issue as reported here: https://github.com/SavageCore/node-ffprobe-installer/issues/121

No solution found yet.