Code Monkey home page Code Monkey logo

amazon-rekognition-automate-video-editing-example's Introduction

Automate Video Editing by just taking in the snippets for a particular actor/speaker

For a whole video contaning many actors/speakers, we can just pull out snippets and create a video with those snippets so that it contains content from a single speaker/actor.

In this example, we are using this video: What is it like to be a Solution Architect and then we are extracting Lia's bit(snippets where she is present) by using her image. We have uploaded both(the video and Lia's image) in an s3 bucket and then use Amazon Rekognition to perform video editing.

Reference Architecture

Refernce Architecture

Pre-requisites:

  1. Have aws-cli installed

Setup and Deployment:

This is done in below Steps:

  1. Create an s3 bucket manually and give a name. eg we are naming it : my-rekognition-images

  2. Add the video and referenced image that need to be searched in the video in the above created bucket. For this example I am uploading a video SAs.mp4 and Lia.JPG

  3. Create an Elastic Transcoder Pipeline and provide the above s3 bucket as shown below: Create a Transcoder Pipeline

  4. Note the pipeline id by clicking the 'search icon' as shown below Pipeline-id

  5. Set up the infrastructure by launching the template in CloudFormation in your aws account and specify the pieline-id you got from step 3.

    • Note the SNSArn and RekognitionSNSPublishRoleArn from the Output section in the CloudFormation stack
  6. Run the below commands in aws-cli

    a. Create a collection

    aws rekognition create-collection --collection-id my-collection --region ap-southeast-2

    b. Add image/face to be indexed

    aws rekognition index-faces --collection-id my-collection --image "S3Object={Bucket=my-rekognition-images,Name=Lia.JPG}" --external-image -id Lia --region ap-southeast-2

    c. Start the face search in the video

    aws rekognition start-face-search --video "S3Object={Bucket=my-rekognition-images,Name=SAs.mp4}" --collection-id my-collection --notification-channel '{\"SNSTopicArn\":\"<sns-topic-arn-found-at-step-5>\", \"RoleArn\":\"<role-arn-found-at-step-5>\"}' --region ap-southeast-2

    This is an asyncronous process and once the job is done, Amazon Rekognition will trigger the SNS topic which in turn triggers the lambda function which will do the job for us and the output video output.mp4 will be uploaded in the my-rekognition-images s3 bucket

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

amazon-rekognition-automate-video-editing-example's People

Contributors

amazon-auto avatar smisriv avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

salmandjing

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.