Subtitle
SubtitleAsset
Bases: BaseTextAsset
Represents a subtitles assets.
type
class-attribute
instance-attribute
type: Literal['subtitle'] = 'subtitle'
The type of the assets. Defaults to "subtitle".
params
class-attribute
instance-attribute
params: TextAssetParams = Field(
default_factory=lambda: TextAssetParams(
position=RegionPosition(x="center", y="bottom"),
font_color=Color("white"),
font_size=45,
stroke_width=1,
align="center",
shadow_blur=10,
shadow_angle=135,
shadow_opacity=0.5,
shadow_distance=5,
)
)
The parameters for the assets.
check_position_is_region
classmethod
check_position_is_region(
params: TextAssetParams,
) -> TextAssetParams
Validate that the subtitle positioning is of type RegionPosition.
Source code in src/mosaico/assets/subtitle.py
from_shot
classmethod
from_shot(shot: Shot, **kwargs: Any) -> SubtitleAsset
Create a SubtitleAsset from a Shot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shot |
Shot
|
The shot to create the asset from. |
required |
kwargs |
Any
|
Additional parameters for the asset. |
{}
|
Returns:
Type | Description |
---|---|
SubtitleAsset
|
The created asset. |