diff --git a/.gitignore b/.gitignore index 24690de..00aa2f0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ build *.pdf *.png *.svg +.idea \ No newline at end of file diff --git a/Makefile b/Makefile index 8eb1cf7..d9959be 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ clean: build/layer/bin/ffmpeg: mkdir -p build/layer/bin rm -rf build/ffmpeg* - cd build && curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz | tar x + cd build && curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz | tar xJ mv build/ffmpeg*/ffmpeg build/ffmpeg*/ffprobe build/layer/bin build/output.yaml: template.yaml build/layer/bin/ffmpeg diff --git a/README-SAR.md b/README-SAR.md index 7415028..17da2f6 100644 --- a/README-SAR.md +++ b/README-SAR.md @@ -1,10 +1,10 @@ -# FFmpeg/FFprobe Lambda Layer for Amazon Linux 2 AMIs +# FFmpeg/FFprobe Lambda Layer for Amazon Linux 2023 AMIs -Static build of FFmpeg/FFprobe for Amazon Linux 2, packaged as a Lambda layer. Bundles FFmpeg 4.1.3. +Static build of FFmpeg/FFprobe for Amazon Linux 2023, packaged as a Lambda layer. Bundles FFmpeg 7.0.2. This application provides a single output, `LayerVersion`, which points to a -Lambda Layer ARN you can use with Lambda runtimes based on Amazon Linux 2 (such -as the `nodejs10.x` runtime). +Lambda Layer ARN you can use with Lambda runtimes based on Amazon Linux 2023 (such +as the `nodejs22.x` runtime). -For an example of how to use the layer, check out - +For an example of how to use the layer, check +out: [ffmpeg-aws-lambda-layer example](https://github.com/thinktik/ffmpeg-aws-lambda-layer/tree/master/example) diff --git a/README.md b/README.md index 8a576d7..c12aa92 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,46 @@ # FFmpeg/FFprobe for AWS Lambda -A Lambda layer containing a static version of FFmpeg/FFprobe utilities from the [`FFmpeg`](https://www.ffmpeg.org/) Linux package, compatible with Amazon Linux 2.x and Amazon Linux 1.x instances (including the `nodejs10.x` runtime, and the updated 2018.03 Amazon Linux 1 runtimes). +A Lambda layer containing a static version of FFmpeg/FFprobe utilities from the [FFmpeg](https://www.ffmpeg.org/) +Linux package, compatible with Amazon Linux 2023 and newer. + +including the runtime: + +- `nodejs20.x` +- `nodejs22.x` +- `python3.13` +- `python3.12` +- `java21` +- `provided.al2023` ## Usage -Absolutely the easiest way of using this is to pull it directly from the AWS Serverless Application repository into a CloudFormation/SAM application, or deploy directly from the Serverless Application Repository into your account, and then link as a layer. +Absolutely the easiest way of using this is to pull it directly from the AWS Serverless Application repository into a +CloudFormation/SAM application, or deploy directly from the Serverless Application Repository into your account, and +then link as a layer. The `ffmpeg` and `ffprobe` binaries will be in `/opt/bin/` after linking the layer to a Lambda function. -For more information, check out the [ffmpeg-lambda-layer](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:145266761615:applications~ffmpeg-lambda-layer) application in the Serverless App Repository. +For more information, check out +the [ffmpeg-lambda-layer](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:145266761615:applications~ffmpeg-lambda-layer) +application in the Serverless App Repository. For manual deployments and custom builds, read below... ## Prerequisites * Unix Make environment + +| OS | version | arch | +|--------------|---------|--------| +| Amazon Linux | 2023.x | x86_64 | +| Rocky Linux | 9.x | x86_64 | + * AWS command line utilities (just for deployment) ## Deploying to AWS as a layer -This package includes FFmpeg 4.1.3, packaged by John Van Sickle. Please consider supporting him for maintaining statically built FFmpeg packages. For more information, check out +This package includes FFmpeg 7.0.2, packaged by John Van Sickle. Please consider supporting him for maintaining +statically built FFmpeg packages. For more information, check out The output will be in the `result` dir. @@ -31,11 +52,14 @@ make deploy DEPLOYMENT_BUCKET= ### configuring the deployment -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. +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. ### example usage -An example project is in the [example](example) directory. It sets up two buckets, and listens to file uploads on the first bucket to convert and generate thumbnails from uploaded video files. You can deploy it from the root Makefile using: +An example project is in the [example](example) directory. It sets up two buckets, and listens to file uploads on the +first bucket to convert and generate thumbnails from uploaded video files. You can deploy it from the root Makefile +using: ``` make deploy-example DEPLOYMENT_BUCKET= @@ -45,13 +69,16 @@ For more information on using FFmpeg and FFprobe, check out +[ThinkTik](https://github.com/thinktik) ## License * These scripts: [MIT](https://opensource.org/licenses/MIT) -* FFmpeg: GPLv2.1 , John Van Sickle's static build GPL v3 +* FFmpeg: GPLv2.1 , John Van Sickle's static build GPL + v3 ## LGPL version -* [Giuseppe Battista](http://github.com/giusedroid) created a build that contains only LGPL components, for organisations that are concerned about GPL licensing. See it at +* [Giuseppe Battista](http://github.com/giusedroid) created a build that contains only LGPL components, for + organisations that are concerned about GPL licensing. See it + at diff --git a/template.yaml b/template.yaml index 8dc95e4..5780770 100644 --- a/template.yaml +++ b/template.yaml @@ -1,23 +1,26 @@ AWSTemplateFormatVersion: 2010-09-09 Transform: AWS::Serverless-2016-10-31 Description: > - Static build of FFmpeg/FFprobe for Amazon Linux 2 + Static build of FFmpeg/FFprobe for Amazon Linux 2023 + + Check out https://github.com/thinktik/ffmpeg-aws-lambda-layer for more information. - Check out https://github.com/serverlesspub/ffmpeg-aws-lambda-layer - for more information. Resources: LambdaLayer: Type: AWS::Serverless::LayerVersion Properties: - LayerName: ffmpeg + LayerName: ffmpeg-7 Description: FFMPEG for AWS Lambda ContentUri: build/layer CompatibleRuntimes: - - nodejs10.x - - python3.6 - - ruby2.5 - - java8 - - go1.x + - nodejs22.x + - nodejs20.x + - python3.13 + - python3.12 + - java21 + - provided.al2023 + CompatibleArchitectures: + - x86_64 LicenseInfo: GPL-2.0-or-later RetentionPolicy: Retain @@ -30,13 +33,13 @@ Metadata: AWS::ServerlessRepo::Application: Name: ffmpeg-lambda-layer Description: > - Static build of FFmpeg/FFprobe for Amazon Linux 2, - packaged as a Lambda layer. Bundles FFmpeg 4.1.3 - Author: Gojko Adzic + Static build of FFmpeg/FFprobe for Amazon Linux 2023, + packaged as a Lambda layer. Bundles FFmpeg 7.0.2 + Author: ThinkTik SpdxLicenseId: GPL-2.0-or-later LicenseUrl: LICENSE.txt - ReadmeUrl: README-SAR.md - Labels: ['layer', 'lambda', 'ffmpeg', 'ffprobe'] - HomePageUrl: https://github.com/serverlesspub/ffmpeg-aws-lambda-layer + ReadmeUrl: README-SAR.md + Labels: [ 'layer', 'lambda', 'ffmpeg', 'ffprobe' ] + HomePageUrl: https://github.com/thinktik/ffmpeg-aws-lambda-layer SemanticVersion: 1.0.0 - SourceCodeUrl: https://github.com/serverlesspub/ffmpeg-aws-lambda-layer + SourceCodeUrl: https://github.com/thinktik/ffmpeg-aws-lambda-layer