{"id":15490401,"url":"https://github.com/sammarks/cloudformation-video-thumbnail","last_synced_at":"2026-02-07T21:04:05.525Z","repository":{"id":46062741,"uuid":"228860093","full_name":"sammarks/cloudformation-video-thumbnail","owner":"sammarks","description":"Generates a thumbnail for videos uploaded to a S3 bucket.","archived":false,"fork":false,"pushed_at":"2023-01-05T03:16:25.000Z","size":1430,"stargazers_count":0,"open_issues_count":15,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-06T11:43:08.113Z","etag":null,"topics":["aws","aws-lambda","cloudformation","cloudformation-template","sam","serverless","serverless-application-model","thumbnail","video"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/sammarks.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-12-18T14:43:04.000Z","updated_at":"2020-04-07T21:07:54.000Z","dependencies_parsed_at":"2023-02-03T08:16:25.668Z","dependency_job_id":null,"html_url":"https://github.com/sammarks/cloudformation-video-thumbnail","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/sammarks/cloudformation-video-thumbnail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fcloudformation-video-thumbnail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fcloudformation-video-thumbnail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fcloudformation-video-thumbnail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fcloudformation-video-thumbnail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sammarks","download_url":"https://codeload.github.com/sammarks/cloudformation-video-thumbnail/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fcloudformation-video-thumbnail/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29208176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T20:33:12.493Z","status":"ssl_error","status_checked_at":"2026-02-07T20:30:47.381Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","cloudformation","cloudformation-template","sam","serverless","serverless-application-model","thumbnail","video"],"created_at":"2024-10-02T07:20:58.007Z","updated_at":"2026-02-07T21:04:05.510Z","avatar_url":"https://github.com/sammarks.png","language":"JavaScript","readme":"![][header-image]\n\n[![CircleCI](https://img.shields.io/circleci/build/github/sammarks/cloudformation-video-thumbnail/master)](https://circleci.com/gh/sammarks/cloudformation-video-thumbnail)\n[![Coveralls](https://img.shields.io/coveralls/sammarks/cloudformation-video-thumbnail.svg)](https://coveralls.io/github/sammarks/cloudformation-video-thumbnail)\n[![Dev Dependencies](https://david-dm.org/sammarks/cloudformation-video-thumbnail/dev-status.svg)](https://david-dm.org/sammarks/cloudformation-video-thumbnail?type=dev)\n[![Donate](https://img.shields.io/badge/donate-paypal-blue.svg)](https://paypal.me/sammarks15)\n\n`cloudformation-video-thumbnail` is an AWS SAM + CloudFormation template designed to ingest videos\nfrom an input S3 bucket, generate thumbnails for them at predetermined points (or \"marks\") at the\noriginal resolution of the video, upload them back to a destination S3 bucket, and send an SNS\nnotification with the details of the process.\n\nThis template is basically just [benjaminadk's wonderful tutorial,](https://dev.to/benjaminadk/how-do-i-create-thumbnails-when-i-upload-a-video-aws-lambda-7l4) packaged as a CloudFormation template\nfor easy installation! It also utilizes [serverlesspub's ffmpeg-aws-lambda-layer package](https://github.com/serverlesspub/ffmpeg-aws-lambda-layer) for easily packaging ffmpeg with the Lambda function.\nI highly recommend you check out those packages if you're interested in how it works.\n\n## Get Started\n\nIt's simple! Click this fancy button:\n\n[![Launch Stack](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=github-sheets-sync\u0026templateURL=https://sammarks-cf-templates.s3.amazonaws.com/video-thumbnail/template.yaml)\n\nThen give the stack a name, and configure it:\n\n### Parameters\n\n| Parameter | Required | Default Value | Description |\n| --- | --- | --- | --- |\n| InputBucketName | **Yes** | | The name of the bucket to use for video inputs. |\n| Marks | No | `0.01,0.25,0.5,0.75,0.99` | A comma-separated list of the points at which to take thumbnail screenshots. |\n| DebugLevel | No | `\u003cempty string\u003e` | The `DEBUG` environment variable for the Lambda. Set to `cloudformation-video-thumbnail` to enable debug messages. |\n\n### Outputs\n\n| Output | Description |\n| --- | --- |\n| InputBucket | The name of the bucket where videos should be uploaded. |\n| InputBucketArn | The ARN for the bucket where videos should be uploaded. |\n| ThumbnailBucket | The name of the bucket where thumbnails are stored. |\n| ThumbnailBucketArn | The ARN for the bucket where thumbnails are stored. |\n| Topic | The ARN for the SNS Topic to subscribe to for pipeline notifications. |\n| S3Topic | The ARN for the SNS Topic to subscribe to for object creation notifications from the input bucket. |\n\n### Usage in Another Stack or Serverless\n\nAdd something like this underneath resources:\n\n```yaml\nvideoThumbnailStack:\n  Type: AWS::CloudFormation::Stack\n  Properties:\n    TemplateURL: https://sammarks-cf-templates.s3.amazonaws.com/video-thumbnail/VERSION/template.yaml\n    Parameters:\n      InputBucketName: test-input-bucket\n      Marks: '0.01,0.25,0.5,0.75,0.99'\n      DebugLevel: ''\n```\n\n**Note:** This stack will require the `CAPABILITY_AUTO_EXPAND` capability when deploying\nthe parent stack with CloudFormation. If you are using the Serverless framework, you can\n\"trick\" it into adding the required capabilities by adding this to your `serverless.yaml`:\n\n```yaml\nresources:\n  Transform: 'AWS::Serverless-2016-10-31' # Trigger Serverless to add CAPABILITY_AUTO_EXPAND\n  Resources:\n    otherResource: # ... all of your original resources\n```\n\n### Regions\n\n**A quick note on regions:** If you are deploying this stack in a region other than `us-east-1`,\nyou need to reference the proper region S3 bucket as we're deploying Lambda functions. Just\nadd the region suffix to the template URL, so this:\n\n```\nhttps://sammarks-cf-templates.s3.amazonaws.com/video-thumbnail/VERSION/template.yaml\n```\n\nbecomes this:\n\n```\nhttps://sammarks-cf-templates-us-east-2.s3.amazonaws.com/video-thumbnail/VERSION/template.yaml\n```\n\n### Subscribing to object creation events\n\nS3 does not allow two separate Lambda functions to be subscribed to the same\nevent types on a single bucket. Because of this, the template creates an SNS\ntopic to serve as the messenger for the S3 notifications, and the internal\nLambda function subscribes to that SNS topic.\n\nBecause of this, if you want to subscribe to the object creation events in your\nown Lambda functions, simply create a Lambda function that references the\n`S3Topic` output of this stack.\n\n### What's deployed?\n\n- Two S3 buckets: one for video input, one for video output.\n- A SNS topic for notifications.\n- A SNS topic for object created notifications for the input bucket.\n- A Lambda function to process the videos.\n\n### How does it work?\n\nThe Lambda goes through the following process:\n\n- Verify the video will work and get its length using ffprobe.\n- Get a signed URL for the video using S3.\n- Pass that signed URL to ffmpeg to get the thumbnails.\n- Upload the thumbnails to S3.\n- Send notifications to SNS along the way to indicate progress or errors.\n\n### Accessing Previous Versions \u0026 Upgrading\n\nEach time a release is made in this repository, the corresponding template is available at:\n\n```\nhttps://sammarks-cf-templates.s3.amazonaws.com/video-thumbnail/VERSION/template.yaml\n```\n\n**On upgrading:** I actually _recommend_ you lock the template you use to a specific version. Then, if you want to update to a new version, all you have to change in your CloudFormation template is the version and AWS will automatically delete the old stack and re-create the new one for you.\n\n## Features\n\n- Automatically generate thumbnails at predefined offsets for any video files uploaded to a S3 bucket.\n- Reports the duration of videos to SNS as well whenever it is found.\n- Send notifications about updates and error messages to a SNS topic.\n- Deploy with other CloudFormation-compatible frameworks (like the Serverless framework).\n- All functionality is self-contained within one CloudFormation template. Delete the template, and all of our created resources are removed.\n\n## Why use this?\n\nIf you need to generate thumbnails from videos uploaded to your service, why write your own\nimplementation (which takes time), or pay for AWS' ElementalMedia services (which cost money),\nwhen you can fire-and-forget an inexpensive CloudFormation template!\n\nIn my research, I had found plenty of examples for generating video thumbnails in the form of\ntutorials, but I hadn't found where someone had packed it up as a CloudFormation template.\n\n[header-image]: https://raw.githubusercontent.com/sammarks/art/master/cloudformation-video-thumbnail/header.jpg\n","funding_links":["https://paypal.me/sammarks15"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammarks%2Fcloudformation-video-thumbnail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsammarks%2Fcloudformation-video-thumbnail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammarks%2Fcloudformation-video-thumbnail/lists"}