derhuerst / derhuerst/ffprobe-static

Command from ffprobe-static Error

Open
#19 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
59
Forks
52
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the getMediaS3 Lambda handler and its ffprobe call, then compare the logged /var/task/node_modules/ffprobe-static/bin/linux/x64/ffprobe command with a local run against the same CloudFront URL. Inspect the deployed package, Lambda runtime, and ffprobe stderr and exit status. Done means the deployed invocation returns media metadata or the deployment-specific failure is reproducibly identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript, linux, node.js
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.