AWS Rekognition and VideoDB - Intelligent Video Clips
Overview
👨🍳 Imagine effortlessly identifying individuals in videos and generating clips of them from episodes of a TV series or other videos. This is now achievable without manual effort, thanks to cutting-edge technology provided byAWS Rekognition API and VideoDB
endpoint scans the video and identifies the presence of individuals.
VideoDB: Designed specifically for videos, it stores videos, allowing extraction of clips and selective timeline streams effortlessly.
Most spicy thing about our dish 🌶️ ?
We have fully automated this process — it's accurate and fast. We gather timestamps of individuals’ appearances, extract video clips, and merge them seamlessly,without touching any video editor or manual effort.🚀
from HBO's Silicon Valley show. Let’s download the video and image of Erlich BachmanGilFoyle using publicly available data.
Configuration
VideoDB Configuration
To connect to VideoDB, simply create a Connection object.
AWS Configuration
Setup your AWS secrets: aws_secret_key_id, aws_secret_access_key and aws_reigon
user_id - This is the AWS user ID associated with the face we are indexing. You can assign a random UUID or select an ID of your choice for this purpose.
collection_id - This refers to the AWS collection in which we will store the indexed faces.
bucket_name - This is the name of the S3 bucket where the video will be stored.
Rekognition API Workflow
Create a collection for faces to store
Create a new user with given user_id
Index Face from image and store index in collection_id
Associate Index face with newly created user
Upload a video to S3 Bucket and Start face search using
When the Rekognition API detects indexed faces from a collection, it provides timestamps. Our goal is to merge timestamps that are part of the same scene. While the
is one way to do this, we'll use a simpler approach. If the interval between two timestamps is smaller than a specified threshold, they will be grouped as a single shot. Additionally, we will apply a padding on both the right and left sides of each shot for better context.
You can experiment with both variables threshold and padding to get a better result.
Now that we have the timestamps of our favourite artist’s appearance in a video, We can move on to create clip using VideoDBPlease follow next steps in this blog 👉