Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hasithaishere/aws-ffmpeg-lambda-layer
This repository hosts a custom AWS Lambda layer that includes static versions of FFmpeg and FFprobe utilities from the FFmpeg Linux package. These utilities are compatible with both Amazon Linux 2.x and Amazon Linux 1.x instances.
https://github.com/hasithaishere/aws-ffmpeg-lambda-layer
amazon-linux audio aws custom-layer ffmpeg ffprobe lambda media-processing serverless video
Last synced: 3 months ago
JSON representation
This repository hosts a custom AWS Lambda layer that includes static versions of FFmpeg and FFprobe utilities from the FFmpeg Linux package. These utilities are compatible with both Amazon Linux 2.x and Amazon Linux 1.x instances.
- Host: GitHub
- URL: https://github.com/hasithaishere/aws-ffmpeg-lambda-layer
- Owner: hasithaishere
- License: gpl-3.0
- Created: 2023-10-14T08:05:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-24T02:44:32.000Z (8 months ago)
- Last Synced: 2024-06-24T03:44:07.948Z (8 months ago)
- Topics: amazon-linux, audio, aws, custom-layer, ffmpeg, ffprobe, lambda, media-processing, serverless, video
- Language: Makefile
- Homepage:
- Size: 633 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README-SAR.md
- License: LICENSE
Awesome Lists containing this project
README
FFmpeg/FFprobe AWS Lambda Layer
(Based on Amazon Linux 2)This repository hosts a custom AWS Lambda layer that includes static versions of FFmpeg and FFprobe utilities from the FFmpeg Linux package. These utilities are compatible with both Amazon Linux 2.x and Amazon Linux 1.x instances.
#### Supported AWS
- nodejs18.x
- nodejs16.x
- nodejs14.x
- python3.11
- java17
- go1.x## Prerequisites
* Unix Make environment
* [SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html) tool## Deploying to AWS as a layer
This layer can deployed in the AWS using following commands:
For Build the layer please use the following command:
```sh
make build
```For Deploy the layer please use the following command:
```sh
make deploy AWS_REGION= STACK_NAME=
```By default, this uses `ffmpeg-lambda-layer` as the stack name. Provide a `STACK_NAME` variable when calling `make deploy` to use an alternative name.
And default region is `ap-southeast-1` if you want to deploy in different region please provide `AWS_REGION` variable.
The `ffmpeg` and `ffprobe` binaries will be in `/opt/bin/` after linking the layer to a Lambda function.
```sh
make deploy
```This package includes FFmpeg 6.0, packaged by John Van Sickle. Please consider supporting him for maintaining statically built FFmpeg packages. For more information, check out https://johnvansickle.com/ffmpeg/
### How to use
After deploy the layer, you can use the ARN of layer in your lambda function.
It return the latest layer ARN, please check following screenshot.```sh
arn:aws:lambda:ap-southeast-1::layer:ffmpeg-lambda-layer:1
```
You can use this ARN in your serverless function as following:
```yaml
Resources:
MediaConverterFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: media-converter/
Handler: app.lambdaHandler
Runtime: nodejs18.x
Timeout: 30
Layers:
- arn:aws:lambda:::layer:ffmpeg-lambda-layer:
```## Author
[Hasitha Gamage](https://hasitha.xyz)
## License
* These Repository Code: [GPL v3](https://opensource.org/licenses/MIT)
* FFmpeg: GPLv2.1 , John Van Sickle's static build GPL v3