Aws Lambda Permission Denied When Trying to Use Ffmpeg

AWS Lambda permission denied when trying to use ffmpeg

AWS Lambda runs on Amazon Linux. It is a known issue. Try building (with static enabled) and check if it works on Amazon Linux and upload that binary. You do not have the privileges to chmod the files in /var/task/. Or try this solution that works:

  • Move ffmpeg to /tmp
  • chmod 755 /tmp/ffmpeg
  • Call /tmp/ffmpeg

See this discussion for more info.

AccessDenied executable in AWS Lambda Layer - FFMPEG

For anyone on Windows (like me) who finds this in future - Lambda file permissions are set outside of Lambda, and you'll need to boot a Linux VM (or a Mac) to change CHMOD stuff on files that will end up on Lambda.

How to Install ffmpeg on aws lambda machine?

You don't ever connect to the "machine" the Lambda is running on. There is no single machine the function runs on, and the function isn't even deployed until the first time it is called. The Lambda runs in one or more containers that are created and deleted on demand as requests come in. You have to include anything like ffmpeg in your Lambda's deployment package itself, so it will be there every time your function is deployed to a container.

Any binaries you include in your function's deployment package need to be built for Amazon Linux, which is the operating system Lambda runs on. You can either use an EC2 server to build the binaries or search for someone that has already packaged ffmpeg for Lambda and made it available.



Related Topics



Leave a reply



Submit