{"id":15490644,"url":"https://github.com/sammarks/cloudformation-audio-metadata","last_synced_at":"2026-01-07T01:54:43.793Z","repository":{"id":43982551,"uuid":"244952846","full_name":"sammarks/cloudformation-audio-metadata","owner":"sammarks","description":"Generates metadata (currently just duration) information for an audio file uploaded to a S3 bucket.","archived":false,"fork":false,"pushed_at":"2023-01-05T09:04:12.000Z","size":1353,"stargazers_count":0,"open_issues_count":14,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T09:19:31.356Z","etag":null,"topics":["audio","aws","aws-lambda","cloudformation","cloudformation-template","metadata-extraction","sam","serverless","serverless-application-model"],"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":"2020-03-04T16:44:53.000Z","updated_at":"2020-03-04T16:59:01.000Z","dependencies_parsed_at":"2023-02-03T22:01:24.727Z","dependency_job_id":null,"html_url":"https://github.com/sammarks/cloudformation-audio-metadata","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fcloudformation-audio-metadata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fcloudformation-audio-metadata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fcloudformation-audio-metadata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fcloudformation-audio-metadata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sammarks","download_url":"https://codeload.github.com/sammarks/cloudformation-audio-metadata/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246061873,"owners_count":20717517,"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","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":["audio","aws","aws-lambda","cloudformation","cloudformation-template","metadata-extraction","sam","serverless","serverless-application-model"],"created_at":"2024-10-02T07:22:52.684Z","updated_at":"2026-01-07T01:54:43.753Z","avatar_url":"https://github.com/sammarks.png","language":"JavaScript","readme":"![][header-image]\n\n[![CircleCI](https://img.shields.io/circleci/build/github/sammarks/cloudformation-audio-metadata/master)](https://circleci.com/gh/sammarks/cloudformation-audio-metadata)\n[![Coveralls](https://img.shields.io/coveralls/sammarks/cloudformation-audio-metadata.svg)](https://coveralls.io/github/sammarks/cloudformation-audio-metadata)\n[![Dev Dependencies](https://david-dm.org/sammarks/cloudformation-audio-metadata/dev-status.svg)](https://david-dm.org/sammarks/cloudformation-audio-metadata?type=dev)\n[![Donate](https://img.shields.io/badge/donate-paypal-blue.svg)](https://paypal.me/sammarks15)\n\n`cloudformation-audio-metadata` is an AWS SAM + CloudFormation template designed to ingest audio\nfiles from an input S3 bucket and grab metadata information (currently just duration) from them.\nIt sends this result through an SNS topic for consumption by another Lambda function, email, etc.\n\nIt utilizes [serverlesspub's ffmpeg-aws-lambda-layer package](https://github.com/serverlesspub/ffmpeg-aws-lambda-layer) for easily packaging ffmpeg with the Lambda function.\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=audio-metadata\u0026templateURL=https://sammarks-cf-templates.s3.amazonaws.com/audio-metadata/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 audio inputs. |\n| DebugLevel | No | `\u003cempty string\u003e` | The `DEBUG` environment variable for the Lambda. Set to `cloudformation-audio-metadata` to enable debug messages. |\n\n### Outputs\n\n| Output | Description |\n| --- | --- |\n| InputBucket | The name of the bucket where audio files should be uploaded. |\n| InputBucketArn | The ARN for the bucket where audio files should be uploaded. |\n| Topic | The ARN for the SNS Topic to subscribe to for metadata 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/audio-metadata/VERSION/template.yaml\n    Parameters:\n      InputBucketName: test-input-bucket\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/audio-metadata/VERSION/template.yaml\n```\n\nbecomes this:\n\n```\nhttps://sammarks-cf-templates-us-east-2.s3.amazonaws.com/audio-metadata/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- One S3 buckets: one for audio input.\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 audio files.\n\n### How does it work?\n\nThe Lambda goes through the following process:\n\n- Grab the length of the audio file using `ffprobe`\n- Send a notification to SNS once we have the length of the audio file.\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/audio-metadata/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 determine the length of an audio file uploaded to a S3 bucket.\n- Reports the duration to a SNS topic.\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\nRight now this library just reports the duration of any audio file uploaded to a specific\nS3 bucket. Use this if you want to automatically calculate the length of a file yourself\ninstead of relying on clients to upload accurate information.\n\n[header-image]: https://raw.githubusercontent.com/sammarks/art/master/cloudformation-audio-metadata/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-audio-metadata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsammarks%2Fcloudformation-audio-metadata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammarks%2Fcloudformation-audio-metadata/lists"}