Adding AI Generated Voiceovers with VideoDB and LOVO
Case: Automatically Creating a Fun & Chirpy Voiceover for Silent Footage of the Underwater World
Overview
Crafting AI content and blending results from multiple tools can be super-difficult and time-intensive. Manual execution of these tasks is even more challenging. But what if you could accomplish everything with just a few lines of code?
Unlock the full potential of VideoDB's seamless integration with leading AI technologies like OpenAI and LOVO to effortlessly create engaging AI generated voiceovers. This tutorial showcases the powerful technical capabilities of VideoDB platform to streamline the process of adding dynamic AI generated narrations to a silent footage.
Let’s experience the ease of use and limitless possibilities as you begin a fun experiment to create an exciting narration for
. ( Free for first 50 uploads, No credit card required ) 🎉
import os
os.environ["OPENAI_API_KEY"]=""
os.environ["LOVO_API_KEY"]=""
os.environ["VIDEO_DB_API_KEY"]=""
Note for Free-tier Users of LOVO
Users without a paid plan of LOVO might face some issues while using API. Please reach out to their support team in case of issues with the LOVO API malfunction.
🎙️ LOVO's Speaker ID
You will also need LOVO's SpeakerID of a Voice that you want to use.
For this demo, we’ll choose a cheerful voice from Lovo's Voice Library. You can choose this based on the style of voiceovers you wish to create.
Begin by establishing a connection to VideoDB using your API key:
from videodb import connect
# Connect to VideoDB using your API key
conn =connect()
coll = conn.get_collection()
🎥 Step 2: Upload Video
# Upload a video by URL (replace the url with your video)
video = conn.upload(url='https://youtu.be/RcRjY5kzia8')
🔍 Step 3: Analyze Scenes and Generate Scene Descriptions
Start by analyzing the scenes within your Video using VideoDB's scene indexing capabilities. This will provide context for generating the script prompt.
video.index_scenes()
Let's view the description of first scene from the video
The image presents a close-up, textured pattern reminiscent of organic forms. Dominated by a cool color palette of blue and turquoise hues, it gives the impression of looking at a magnified cluster of cells, crystalline structures, or perhaps a zoomed-in portion of aquatic flora. The shapes appear irregular yet symmetrical, like petals or leaves clustered tightly together. Light and shadow play across the surfaces, creating a dynamic interplay that suggests depth and complexity. The overall effect is one of natural beauty, with a soothing, almost hypnotic visual rhythm. The image is abstract enough to allow for multiple interpretations, depending on the viewer's perspective.
🎤 Step 4: Create Voiceover Script with LLM
Combine scene descriptions with a script prompt, instructing LLM to create a playful narration suitable for kids.
This script prompt can be refined and tweaked to generate the most suitable output. Check out
script_prompt ="Here's the data from a scene index for a video about the underwater world. Study this and then generate a synced script based on the description below. Make sure the script is in the language, voice and style of Santa Claus"