videodb
VideoDB Documentation
videodb
VideoDB Documentation
Quick Start Guide

icon picker
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
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.