{"id":31534076,"url":"https://github.com/deek87/lamba-thumbnailer","last_synced_at":"2025-10-04T05:17:01.949Z","repository":{"id":32957694,"uuid":"146585776","full_name":"deek87/lamba-thumbnailer","owner":"deek87","description":"AWS S3 Video Thumbnailer with Lambda","archived":false,"fork":false,"pushed_at":"2023-01-07T23:58:32.000Z","size":16782,"stargazers_count":25,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-13T19:10:59.371Z","etag":null,"topics":["aws","aws-lambda","aws-s3","image","lambda","lambda-function","lambda-functions","s3","serverless","serverless-functions","thumbnail","thumbnail-generator","thumbnail-images","thumbnailer","thumbnails","typescript","video","video-thumbnail","video-thumbnail-generator","webp"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deek87.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-29T10:47:03.000Z","updated_at":"2025-03-24T07:36:28.000Z","dependencies_parsed_at":"2023-01-14T22:49:55.609Z","dependency_job_id":null,"html_url":"https://github.com/deek87/lamba-thumbnailer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/deek87/lamba-thumbnailer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deek87%2Flamba-thumbnailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deek87%2Flamba-thumbnailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deek87%2Flamba-thumbnailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deek87%2Flamba-thumbnailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deek87","download_url":"https://codeload.github.com/deek87/lamba-thumbnailer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deek87%2Flamba-thumbnailer/sbom","scorecard":{"id":331754,"data":{"date":"2025-08-11","repo":{"name":"github.com/deek87/lamba-thumbnailer","commit":"655c027c2c5c3b9d6ea8b689344d7d207a691010"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/lintbuild.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lintbuild.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/deek87/lamba-thumbnailer/lintbuild.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lintbuild.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/deek87/lamba-thumbnailer/lintbuild.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/lintbuild.yml:21","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"10 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T03:48:27.127Z","repository_id":32957694,"created_at":"2025-08-18T03:48:27.127Z","updated_at":"2025-08-18T03:48:27.127Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278266896,"owners_count":25958733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","aws-s3","image","lambda","lambda-function","lambda-functions","s3","serverless","serverless-functions","thumbnail","thumbnail-generator","thumbnail-images","thumbnailer","thumbnails","typescript","video","video-thumbnail","video-thumbnail-generator","webp"],"created_at":"2025-10-04T05:17:00.344Z","updated_at":"2025-10-04T05:17:01.942Z","avatar_url":"https://github.com/deek87.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Build](https://github.com/deek87/lamba-thumbnailer/workflows/Build/badge.svg?branch=master)\n\n# IMPORTANT\n\nThis branch is currently under development and is provided as is\n\n# Roadmap for TypeScript\n\n- [x] Convert All Code to TypeScript (done)\n- [x] Use FFmpeg Layers for Lambda instead (done)\n- [ ] Make the thumbnailer more moduler (in-progress)\n- [ ] Implement Tests (to be done)\n\n# Table Of Contents\n\n- [Introduction](#Introduction)\n- [Getting Started](#Getting-Started)\n  - [Using in your own function](#Using-in-your-own-function)\n- [Thumbnail Configuration](#Thumbnail-Configuration)\n  - [Size](#Size)\n  - [Type](#Type)\n  - [Quality](#Quality)\n  - [Output Location](#Output-Location)\n- [Original Tutorial](#Original-Tutorial)\n\n- [License](#License)\n\n## Introduction\n\nThis package was created to automatically generate thumbnails from s3 video uploads.\n\n## Getting Started\n\nInstall this package using the following the command then require the package in your code.\n\n```sh\nnpm install lambda-video-thumbnailer\n```\n\n### Using in your own function\n\nYou can use [the provided s3example.js](examples/s3.js) to get you started.\nOr you can use the following code snippet for a lambda function.\n\n```js\n// Require the library\nconst lvt = require(\"lambda-video-thumbnailer\");\n\nexports.handler = function (event, context) {\n  // Returns a S3Thumbnailer Class\n  const t = new lvt.S3(event.Records[0].s3);\n  // Create a thumbnail will return promise\u003cstring\u003e\n  return t.createThumbnail({\n    width: 100,\n\n    height: 100,\n\n    time: \"00:00:05\",\n\n    type: \"webp\",\n  });\n};\n```\n\n## Thumbnail Configuration\n\n`createThumbnail()` takes a `thumbnailConfig` object with that has the following default options\n\n```json\n{\n  \"prefix\": \"thumbnails/\",\n  \"width\": 180,\n  \"height\": 180,\n  \"time\": \"00:00:05\",\n  \"type\": \"jpg\",\n  \"quality\": 2,\n  \"thumbnailOption\": \"default\"\n}\n```\n\n### Size\n\nTo configure the output size of thumbnails simply supply a width/height number. If you want to automatically calculate width or height based on the aspect ratio of the input, just use -1. For example:\n\n```json\n{\n  \"width\": 700,\n  \"height\": -1\n}\n```\n\nThis will produce a 700x300 image when the input aspect ratio is 21:9\n\nIf your output needs to be a multiple of n then supply -n and it will output an output that is scaled by the ratio and a multiple of -n. For example\n\n```json\n{\n  \"width\": -3,\n  \"height\": 250\n}\n```\n\nThis will produce a 441x250 image when the aspect raito is 21:9\n\n### Type\n\nTo configure the output type of thumbnails just set the type to `\"jpg\"`, `\"png\"` or `\"webp\"`\n\n```json\n{\n  \"type\": \"webp\"\n}\n```\n\nNOTE: ffmpeg with png tends to output very large filesizes even with -pred mixed\n\n### Quality\n\nThe output quality of the thumbnail is controlled by the `quality` property. It is controlled on a scale of 1-10 with 1 being the best quality and 10 being the worst quality.\n\n```json\n{\n  \"quality\": 1\n}\n```\n\n### Thumbnail Option\n\nThis option determines which filter to use for capturing thumbnails via ffmpeg. The options currently are `default`,`none`. The `default` option will set the filter to `thumbnail` this will look for the best frame within the select timeslot, this can be use quite a bit of memory on large files but will generally give the best screenshots. `none` will not use any filter and pick the first frame at the given timeslot.\n\n```json\n{\n  \"thumbnailOption\": \"none\"\n}\n```\n\n### Output Location\n\nThe output bucket is defined by the `outputBucket` thumbnail config option, by default this will output the files to the source bucket if left blank.\n\n```json\n{\n  \"outputBucket\": \"mybucket\"\n}\n```\n\nBy default the output file name will use the source file with the new type suffix. For example `movie_trailer.mp4` becomes `move_trailer.jpg` when used with the jpg type output.\nHowever you can customize it with the `outputKey` option in your thumbnail config. It will still attach the type or replace it `my_new_filename.hello` becomes `my_new_filename.jpg`\n\n```json\n{\n  \"outputKey\": \"my_new_filename\"\n}\n```\n\n## Setup the Lambda Function\n\nThis package requires a ffmpeg layer to function. You can use the following arns:\n\n- [Asia](#Asia)\n- [Europe](#Europe)\n- [Canada](#Canada)\n- [United States](#United-States)\n- [South America](#South-America)\n\nOr alternatively use the serverlesspub build (only available in ap-us-east-1)\narn:aws:lambda:us-east-1:145266761615:layer:ffmpeg:4 or build your own from their github repo [serverlesspub/ffmpeg-aws-lambda-layer](https://github.com/serverlesspub/ffmpeg-aws-lambda-layer)\n\nThen just go onto AWS Lambda create a new function and give it a trigger of put objects with a suffix filter of _.avi, _.mov etc..\n\nAlthough you don't need to do this it just reduces the number of invocations. Apply a policy of LambdaExecute to the IAM role (this gives read and write access to s3) then set the memory limit to the maximum\\* and set timeout for 30seconds (again it normally takes around 6 seconds but its good to be safe).\n\n\\*NOTE: I have never reached the maximum with this function, its normally around 700mb even for 4gb mov files\n\n## Lambda Layers\n\n### Asia\n\n- `arn:aws:lambda:ap-east-1:260572601982:layer:ffmpeg:1` - Hong Kong (AP East 1)\n- `arn:aws:lambda:ap-south-1:260572601982:layer:ffmpeg:1` - Mumbai (AP South 1)\n- `arn:aws:lambda:ap-northeast-2:260572601982:layer:ffmpeg:1` - Seoul (AP Northeast 2)\n- `arn:aws:lambda:ap-southeast-1:260572601982:layer:ffmpeg:1` - Singapore (AP Southeast 1)\n- `arn:aws:lambda:ap-southeast-2:260572601982:layer:ffmpeg:1` - Sydney (AP Southeast 2)\n- `arn:aws:lambda:ap-northeast-1:260572601982:layer:ffmpeg:1` - Tokyo (AP Northeast 1)\n\n### Europe\n\n- `arn:aws:lambda:eu-central-1:260572601982:layer:ffmpeg:1` - Frankfurt (EU Central 1)\n- `arn:aws:lambda:eu-west-1:260572601982:layer:ffmpeg:1` - Ireland (EU West 1)\n- `arn:aws:lambda:eu-west-2:260572601982:layer:ffmpeg:1` - London (EU West 2)\n- `arn:aws:lambda:eu-west-3:260572601982:layer:ffmpeg:1` - Paris (EU West 3)\n- `arn:aws:lambda:eu-north-1:260572601982:layer:ffmpeg:1` - Stockholm (EU North 1)\n\n### Canada\n\n- `arn:aws:lambda:ca-central-1:260572601982:layer:ffmpeg:1` - Central (CA Central 1)\n\n### South America\n\n- `arn:aws:lambda:sa-east-1:260572601982:layer:ffmpeg:1` - São Paulo (SA East 1)\n\n### United States\n\n- `arn:aws:lambda:us-east-1:260572601982:layer:ffmpeg:1` - North Viginia (US East 1)\n- `arn:aws:lambda:us-east-2:260572601982:layer:ffmpeg:1` - Ohio (US East 2)\n- `arn:aws:lambda:us-west-1:260572601982:layer:ffmpeg:1` - N. California (US West 1)\n- `arn:aws:lambda:us-west-2:260572601982:layer:ffmpeg:1` - Oregon (US West 2)\n\n## Original Tutorial\n\nOriginally this was a tutorial I wrote back in July 2017, I updated it a bit since then. The original also contained mediainfo. [Available Here](https://concrete5.co.jp/blog/creating-video-thumbnails-aws-lambda-your-s3-bucket)\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeek87%2Flamba-thumbnailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeek87%2Flamba-thumbnailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeek87%2Flamba-thumbnailer/lists"}