Skip to content
videodb
VideoDB Documentation
  • Pages
    • Welcome to VideoDB Docs
    • Quick Start Guide
      • Video Indexing Guide
      • Semantic Search
      • How Accurate is Your Search?
      • Collections
      • Public Collections
      • Callback Details
      • Ref: Subtitle Styles
      • Language Support
      • Guide: Subtitles
    • Examples and Tutorials
      • Dubbing - Replace Soundtrack with New Audio
      • VideoDB x TwelveLabs: Real-Time Video Understanding
      • Beep curse words in real-time
      • Remove Unwanted Content from videos
      • Instant Clips of Your Favorite Characters
      • Insert Dynamic Ads in real-time
      • Adding Brand Elements with VideoDB
      • Eleven Labs x VideoDB: Adding AI Generated voiceovers to silent footage
      • Elevating Trailers with Automated Narration
      • Add Intro/Outro to Videos
      • Enhancing Video Captions with VideoDB Subtitle Styling
      • Audio overlay + Video + Timeline
      • Building Dynamic Video Streams with VideoDB: Integrating Custom Data and APIs
      • Adding AI Generated Voiceovers with VideoDB and LOVO
      • AI Generated Ad Films for Product Videography: Wellsaid, Open AI & VideoDB
      • Fun with Keyword Search
      • icon picker
        AWS Rekognition and VideoDB - Intelligent Video Clips
      • AWS Rekognition and VideoDB - Effortlessly Remove Inappropriate Content from Video
      • Overlay a Word-Counter on Video Stream
      • Generate Automated Video Outputs with Text Prompts | DALL-E + ElevenLabs + OpenAI + VideoDB
    • Visual Search and Indexing
      • Scene Extraction Algorithms
      • Custom Annotations
      • Scene-Level Metadata: Smarter Video Search & Retrieval
      • Advanced Visual Search Pipelines
      • Playground for Scene Extractions
      • Deep Dive into Prompt Engineering : Mastering Video Scene Indexing
    • Multimodal Search
      • Multimodal Search: Quickstart
      • Conference Slide Scraper with VideoDB
    • Real‑Time Video Pipeline
    • Meeting Recording SDK
    • Generative Media Quickstart
      • Generative Media Pricing
    • Realtime Video Editor SDK
      • Fit & Position: Aspect Ratio Control
      • Trimming vs Timing: Two Independent Timelines
      • Advanced Clip Control: The Composition Layer
      • Caption & Subtitles: Auto-Generated Speech Synchronization
      • Notebooks
    • Transcoding Quickstart
    • director-light
      Director - Video Agent Framework
      • Agent Creation Playbook
      • How I Built a CRM-integrated Sales Assistant Agent in 1 Hour
      • Make Your Video Sound Studio Quality with Voice Cloning
      • Setup Director Locally
    • github
      Open Source Tools
      • llama
        LlamaIndex VideoDB Retriever
      • PromptClip: Use Power of LLM to Create Clips
      • StreamRAG: Connect ChatGPT to VideoDB
    • zapier
      Zapier Integration
      • Auto-Dub Videos & Save to Google Drive
      • Create & Add Intelligent Video Highlights to Notion
      • Create GenAI Video Engine - Notion Ideas to Youtube
      • Automatically Detect Profanity in Videos with AI - Update on Slack
      • Generate and Store YouTube Video Summaries in Notion
      • Automate Subtitle Generation for Video Libraries
      • Solve customers queries with Video Answers
    • n8n
      N8N Workflows
      • AI-Powered Meeting Intelligence: Recording to Insights Automation
      • AI Powered Dubbing Workflow for Video Content
      • Automate Subtitle Generation for Video Libraries
      • Automate Interview Evaluations with AI
      • Turn Meeting Recordings into Actionable Summaries
      • Auto-Sync Sales Calls to HubSpot CRM with AI
      • Instant Notion Summaries for Your Youtube Playlist
    • mcp
      VideoDB MCP Server
    • Edge of Knowledge
      • Building Intelligent Machines
        • Part 1 - Define Intelligence
        • Part 2 - Observe and Respond
        • Part 3 - Training a Model
      • Society of Machines
        • Society of Machines
        • Autonomy - Do we have the choice?
        • Emergence - An Intelligence of the collective
      • From Language Models to World Models: The Next Frontier in AI
      • The Future Series
      • How VideoDB Solves Complex Visual Analysis Tasks
    • videodb
      Building World's First Video Database
      • Multimedia: From MP3/MP4 to the Future with VideoDB
      • Dynamic Video Streams
      • Why do we need a Video Database Now?
      • What's a Video Database ?
      • Enhancing AI-Driven Multimedia Applications
      • Misalignment of Today's Web
      • Beyond Traditional Video Infrastructure
      • Research Grants
    • Customer Love
    • Team
      • videodb
        Internship: Build the Future of AI-Powered Video Infrastructure
      • Ashutosh Trivedi
        • Playlists
        • Talks - Solving Logical Puzzles with Natural Language Processing - PyCon India 2015
      • Ashish
      • Shivani Desai
      • Gaurav Tyagi
      • Rohit Garg
      • VideoDB Acquires Devzery: Expanding Our AI Infra Stack with Developer-First Testing Automation

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 by AWS Rekognition API and VideoDB
image.png

Key components of this technique include:
AWS Rekognition API: The 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.

light
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.🚀

Setup

Install required packages:
boto3:
and
pytube: Download YouTube Videos.
videodb : VideoDB python SDK
!pip install boto3 pytube requests videodb

Helper functions

To work with AWS Rekognition API, we’ll need to download the video and image of persons we want to extract from that video.
download_video_yt : downloads a YouTube video at highest resolution, saving it with a specified filename.
download_file : downloads any file from a URL using wget, saving it with a specified name.

Downloading media

Let’s download a YouTube video and extract clips featuring a specific individual to create a new video focused on them. Here’s a from HBO's Silicon Valley show. Let’s download the video and image of Erlich Bachman GilFoyle using publicly available data.
Screenshot 2023-12-29 at 1.18.55 PM.jpg

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

Extracting Shots from Video

Preparing Timestamps

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 VideoDB Please follow next steps in this blog 👉

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.