From a31235576a5fb843bd04c335021737dd48e195e5 Mon Sep 17 00:00:00 2001 From: thinktik Date: Fri, 29 Aug 2025 10:23:04 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + README.md | 37 +++++++++++++++++++++++++++++-------- template.yaml | 25 +++++++++++++------------ 3 files changed, 43 insertions(+), 20 deletions(-) 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/README.md b/README.md index 8a576d7..1518ddc 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,28 @@ # 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... @@ -19,7 +33,8 @@ For manual deployments and custom builds, read below... ## 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 4.1.3, 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 +46,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= @@ -50,8 +68,11 @@ Gojko Adzic ## 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..2a34843 100644 --- a/template.yaml +++ b/template.yaml @@ -1,10 +1,10 @@ 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 @@ -13,11 +13,12 @@ Resources: 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 LicenseInfo: GPL-2.0-or-later RetentionPolicy: Retain @@ -30,13 +31,13 @@ Metadata: AWS::ServerlessRepo::Application: Name: ffmpeg-lambda-layer Description: > - Static build of FFmpeg/FFprobe for Amazon Linux 2, + Static build of FFmpeg/FFprobe for Amazon Linux 2023, packaged as a Lambda layer. Bundles FFmpeg 4.1.3 - Author: Gojko Adzic + 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 + 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 From fa702888ccef1e839ea1d9798aa6ae94b21cc163 Mon Sep 17 00:00:00 2001 From: thinktik Date: Fri, 29 Aug 2025 10:56:24 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E5=92=8C=E6=89=93=E5=8C=85=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- README-SAR.md | 8 ++++---- README.md | 8 +++++++- 3 files changed, 12 insertions(+), 6 deletions(-) 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..637b15d 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 diff --git a/README.md b/README.md index 1518ddc..21fc34e 100644 --- a/README.md +++ b/README.md @@ -29,11 +29,17 @@ 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 +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. From b72dd5f3c3cce6112599f4cc69ad344455c6a610 Mon Sep 17 00:00:00 2001 From: thinktik Date: Fri, 29 Aug 2025 10:56:57 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E8=AE=BE=E7=BD=AElayer=E7=9A=84=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E7=9A=84CPU=E6=9E=B6=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/template.yaml b/template.yaml index 2a34843..9d80914 100644 --- a/template.yaml +++ b/template.yaml @@ -9,7 +9,7 @@ Resources: LambdaLayer: Type: AWS::Serverless::LayerVersion Properties: - LayerName: ffmpeg + LayerName: ffmpeg Description: FFMPEG for AWS Lambda ContentUri: build/layer CompatibleRuntimes: @@ -19,6 +19,8 @@ Resources: - python3.12 - java21 - provided.al2023 + CompatibleArchitectures: + - x86_64 LicenseInfo: GPL-2.0-or-later RetentionPolicy: Retain @@ -36,8 +38,8 @@ Metadata: Author: ThinkTik SpdxLicenseId: GPL-2.0-or-later LicenseUrl: LICENSE.txt - ReadmeUrl: README-SAR.md - Labels: ['layer', 'lambda', 'ffmpeg', 'ffprobe'] + 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/thinktik/ffmpeg-aws-lambda-layer From 0c5d4f704a2d16480ac8d4ee2226f54fdcfc0a09 Mon Sep 17 00:00:00 2001 From: thinktik Date: Fri, 29 Aug 2025 19:37:45 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-SAR.md | 4 ++-- README.md | 10 +++++----- template.yaml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README-SAR.md b/README-SAR.md index 637b15d..17da2f6 100644 --- a/README-SAR.md +++ b/README-SAR.md @@ -6,5 +6,5 @@ This application provides a single output, `LayerVersion`, which points to a 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 21fc34e..8fe5aaa 100644 --- a/README.md +++ b/README.md @@ -30,10 +30,10 @@ For manual deployments and custom builds, read below... * Unix Make environment -| OS | version | arch | -|--------------|---------|--------| -| Amazon Linux | 2023.x | x86_64 | -| Rocky Linux | 9.x | x86_64 | + | OS | version | arch | + |--------------|---------|--------| + | Amazon Linux | 2023.x | x86_64 | + | Rocky Linux | 9.x | x86_64 | * AWS command line utilities (just for deployment) @@ -69,7 +69,7 @@ For more information on using FFmpeg and FFprobe, check out +[ThinkTik](https://github.com/thinktik) ## License diff --git a/template.yaml b/template.yaml index 9d80914..602c8f7 100644 --- a/template.yaml +++ b/template.yaml @@ -34,7 +34,7 @@ Metadata: Name: ffmpeg-lambda-layer Description: > Static build of FFmpeg/FFprobe for Amazon Linux 2023, - packaged as a Lambda layer. Bundles FFmpeg 4.1.3 + packaged as a Lambda layer. Bundles FFmpeg 7.0.2 Author: ThinkTik SpdxLicenseId: GPL-2.0-or-later LicenseUrl: LICENSE.txt From 579289c4e9814dc097fa7853c5e4fbff117e0f00 Mon Sep 17 00:00:00 2001 From: thinktik Date: Mon, 1 Sep 2025 16:08:03 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++---- template.yaml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8fe5aaa..c12aa92 100644 --- a/README.md +++ b/README.md @@ -30,10 +30,10 @@ For manual deployments and custom builds, read below... * Unix Make environment - | OS | version | arch | - |--------------|---------|--------| - | Amazon Linux | 2023.x | x86_64 | - | Rocky Linux | 9.x | x86_64 | +| OS | version | arch | +|--------------|---------|--------| +| Amazon Linux | 2023.x | x86_64 | +| Rocky Linux | 9.x | x86_64 | * AWS command line utilities (just for deployment) diff --git a/template.yaml b/template.yaml index 602c8f7..5780770 100644 --- a/template.yaml +++ b/template.yaml @@ -9,7 +9,7 @@ Resources: LambdaLayer: Type: AWS::Serverless::LayerVersion Properties: - LayerName: ffmpeg + LayerName: ffmpeg-7 Description: FFMPEG for AWS Lambda ContentUri: build/layer CompatibleRuntimes: