Overview
We all have our favorite characters in TV shows the we love. What if you could create the clips of the scenes when they appear? You can use it in your content creation, analysis workflow or simply observe how they talk, dress or act in an episode. VideoDB is the database for your AI applicaitons and enables it with ease. No need for fancy editing software or waiting around – you get to view your video right away. ⚡️
Workflow
Here’s a 15-minute video from HBO’s Silicon Valley show. We’ve already identified instances whenGilfoyle, Jian Yang, Erlich, Jared, Dinesh and Richard make appearances with the help of AWS Rekognition API.
We’ve pinpointed the timestamps of the characters’ appearances in the video and mapped out where they appear in persons_data
Next, we’ll upload the video to VideoDB and use these timestamps to clip the video. It’s as easy as querying a database⚡️
Setup
Installing VideoDB in your environment
VideoDB is available as a python package and npm package
Setting Up a connection
To connect to VideoDB, simply create aConnection object.
This can be done by either providing your VideoDB API key directly to the constructor or by setting the VIDEO_DB_API_KEY environment variable with your API key.
Get your API key from VideoDB Console. ( Free for first 50 uploads, No credit card required)
Timeline Data
Here’s the json we compiled with the timestamps of appearances of each character. The persons_data contains timeline for each character, representing the timestamps of shots when they were present in the video.Creating instant clips using VideoDB
The idea behindVideoDB is straightforward: it functions as a database specifically for videos. Similar to uploading tables or JSON data to a standard database, you can upload your videos to VideoDB.
You can also retrieve your videos through queries, much like accessing regular data from a database.
You can pass timeline of each person in video.generate_stream() and get the streaming link almost instantly.
Results
We effortlessly uploaded our video to VideoDB and generated clips for each character in just 30 seconds. Now, it’s time to check out our results. Let’s take a look at a clip featuringErlich Bachman (feel free to choose your favorite character by changing the name field below)
Explore Full Notebook
Open the complete implementation in Google Colab with all code examples.