Git Product home page Git Product logo

lambda-thumbnail-generation's Introduction

Lambda Thumbnail Generation

๐Ÿš€ What is this?

This is the complete source code to accompany the article here.

โญ What does it do?

It takes a video that was uploaded to an S3 bucket and generates n number of thumbnails from it.

๐Ÿ’จ How do I use it?

Create a Lambda and use the files in the src/ folder. You need to read the article to see how it ties in the AWS infrastructure, but basically:

  • Create an S3 bucket
  • Create a trigger event to run a Lambda whenever an .mp4 file is uploaded to that bucket
  • That event triggers the Lambda (created from this source code) which uses FFmpeg to generate n thumbnails
  • Those thumbnails are then uploaded to another S3 bucket

๐ŸŽฒ Why would I use this over AWS Transcoder?

You wouldn't, necessarily. AWS Transcoder is good but very expensive compared to doing it yourself in Lambda. I have processed a few hundred short videos using the above source code / technique laid out in the article; the cost has been $0.00. AWS Transcoder costs around $0.45 per 60 minutes of video processed.


Changelog:

13th February 2023:

AWS has begun defaulting Lambdas to v18 of Node. The code has been updated to use v18, which includes:

  • Using ESM syntax rather than CJS (export default rather than module.exports)
  • Using the .mjs extension rather than .js
  • Assuming V3 of the AWS-SDK rather than V2

lambda-thumbnail-generation's People

Contributors

marknorrapscm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.