Skip to content
videodb
VideoDB Documentation
  • Pages
    • Welcome to VideoDB Docs
    • Quick Start Guide
      • Video Indexing Guide
      • Semantic Search
      • Collections
      • Public Collections
      • Callback Details
      • icon picker
        Ref: Subtitle Styles
      • Language Support
      • Guide: Subtitles
      • How Accurate is Your Search?
    • 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 Visual Indexing
      • How VideoDB Solves Complex Visual Analysis Tasks
      • Multimodal Search: Quickstart
      • Conference Slide Scraper with VideoDB
    • Examples and Tutorials
      • Dubbing - Replace Soundtrack with New Audio
      • VideoDB: Adding AI Generated voiceovers to silent footage
      • 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
      • Elevating Trailers with Automated Narration
      • Add Intro/Outro to Videos
      • Audio overlay + Video + Timeline
      • Building Dynamic Video Streams with VideoDB: Integrating Custom Data and APIs
      • AI Generated Ad Films for Product Videography
      • Fun with Keyword Search
      • Overlay a Word-Counter on Video Stream
      • Generate Automated Video Outputs with Text Prompts | VideoDB
      • VideoDB x TwelveLabs: Real-Time Video Understanding
      • Multimodal Search
      • How I Built a CRM-integrated Sales Assistant Agent in 1 Hour
      • Make Your Video Sound Studio Quality with Voice Cloning
      • Automated Traffic Violation Reporter
    • Live Video→ Instant Action
    • Generative Media Quickstart
      • Generative Media Pricing
    • Video Editing Automation
      • 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
      • Setup Director Locally
    • Workflows and Integrations
      • 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
    • Meeting Recording SDK
    • github
      Open Source
      • llama
        LlamaIndex VideoDB Retriever
      • PromptClip: Use Power of LLM to Create Clips
      • StreamRAG: Connect ChatGPT to VideoDB
    • mcp
      VideoDB MCP Server
    • videodb
      Give your AI, Eyes and Ears
      • Building Infrastructure that “Sees” and “Edits”
      • Agents with Video Experience
      • 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
      • Beyond Traditional Video Infrastructure
    • Customer Love
    • Join us
      • 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
      • Edge of Knowledge
        • Language Models to World Models: The Next Frontier in AI
        • Society of Machines
          • Society of Machines
          • Autonomy - Do we have the choice?
          • Emergence - An Intelligence of the collective
        • Building Intelligent Machines
          • Part 1 - Define Intelligence
          • Part 2 - Observe and Respond
          • Part 3 - Training a Model
      • Updates
        • VideoDB Acquires Devzery: Expanding Our AI Infra Stack with Developer-First Testing Automation

Ref: Subtitle Styles

video.add_subtitle(SubtitleStyle()) function supports many parameters for styling your captions or subtitles according to your brand and guidelines. You can create your own
Typography and Style
Color and Effects
Positioning and Margins
Text Transformation
Borders and Shadow,
This document provides an API Reference to the parameters of SubtitleStyle function.
empty-flag
Checkout to dive deep into the outputs of these parameters

Import

Import SubtitleStyle from VideoDB module
from videodb import SubtitleStyle, connect

conn = connect()
coll = conn.get_collection()
video = coll.get_video("MY_VIDEO_ID")

video.add_subtitle(
SubtitleStyle(
font_name = <>,
font_size = <>,
spacing = <>,
....
....
)
)


SubtitleStyle

This function supports following parameters for styling 👇

font_name

The name of the font to use for the subtitles.
Default: "Arial"
Type: str
info
Checkout List of

font_size

The size of the subtitle text in points.
Default: 18
Type: float

primary_colour

The color of the main subtitle text in &HBBGGRR or&HAABBGGRR format. Checkout for the details.
Default: "&H00FFFFFF" (white)
Type: str

secondary_colour

The color used for secondary effects like karaoke
Default: "&H000000FF" (red)
Type: str
info
Checkout for the format details.

outline_colour

The color of the text outline.
Default: "&H00000000" (black)
Type: str
info
Checkout for the format details.

back_colour

The background color of the subtitle box
Default: "&H00000000" (black)
Type: str
info
Checkout for the format details.

bold

Indicates if the subtitle text is bold.
Default: False
Type: bool

italic

Indicates if the subtitle text is italicized.
Default: False
Type: bool

underline

Indicates if the subtitle text is underlined.
Default: False
Type: bool

strike_out

Indicates if the subtitle text has a strikethrough.
Default: False
Type: bool

scale_x

The horizontal scale of the subtitle text in percentage.
Default: 1.0 (100%, no scaling)
Type: float

scale_y

The vertical scale of the subtitle text in percentage.
Default: 1.0 (100%, no scaling)
Type: float

spacing

Space between characters in pixels.
Default: 0
Type: float

angle

The rotation angle of the subtitle text in degrees.
Default: 0 (no rotation)
Type: float

border_style

The style of the border around the text
Default: SubtitleBorderStyle.outline
Type: int or SubtitleBorderStyle

This field accepts following value.
SubtitleBorderStyle.no_border or 1
SubtitleBorderStyle.opaque_box or 3
SubtitleBorderStyle.outline or 4

Usage:
from videodb import SubtitleStyle, SubtitleBorderStyle, connect

conn = connect()
coll = conn.get_collection()
video = coll.get_video("MY_VIDEO_ID")

video.add_subtitle(
SubtitleStyle(
border_style = SubtitleBorderStyle.outline
)
)


outline

The width (px) of the outline around the text.
Default: 1.0 (px)
Type: float

shadow

The depth of the shadow behind the text in pixels.
Default: 0.0
Type: float

alignment

The position of the subtitle text on the screen, typically an enumerated type following the SSA/ASS standard.
Default: SubtitleAlignment.bottom_center
Type: SubtitleAlignment or int
This field accepts following value.
SubtitleAlignment.bottom_left or 1
SubtitleAlignment.bottom_center or 2
SubtitleAlignment.bottom_right or 3
SubtitleAlignment.middle_left or 8, 9
SubtitleAlignment.middle_center or 10
Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.