muxtools.subtitle.basesub
_Line
Source code in
muxtools/subtitle/basesub.py
layer
instance-attribute
An integer value in the range [0, 2³¹-1]. Events with a lower Layer value are placed behind events with a higher value.
style
instance-attribute
Style name used for this line. Must exactly match one of the styles in your subtitle file.
name
instance-attribute
Usually used for what character is currently speaking. Known as Actor in aegisub.
margin_v
instance-attribute
Vertical margin overriding the value in the current style.
effect
instance-attribute
A legacy effect to be applied to the event. Can usually also be used as another freeform field.
ShiftMode
Bases: Enum
Source code in
muxtools/subtitle/basesub.py
ASSHeader
Bases: IntEnum
Basic enum class for some functional ASS headers.
Check https://github.com/libass/libass/wiki/ASS-File-Format-Guide for more information on each member.
Also contains the function to validate the input.
Source code in
muxtools/subtitle/basesub.py
LayoutResX
class-attribute
instance-attribute
Video width this subtitle was originally authored on.
LayoutResY
class-attribute
instance-attribute
Video height this subtitle was originally authored on.
ScaledBorderAndShadow
class-attribute
instance-attribute
Scale border and shadow with playback resolution. Should ideally always be yes.
BaseSubFile
BaseSubFile(file: PathLike | Sequence[PathLike] | GlobSearch, container_delay: int = 0, source: PathLike | None = None, tags: dict[str, str] | None = None, encoding: str = 'utf_8_sig')
Bases: ABC, MuxingFile
A base class for the SubFile class.
Mostly contains the functions to read/write the file and some commonly reused functions to manipulate headers/lines.
Source code in
muxtools/subtitle/basesub.py
OutOfBoundsMode
Bases: IntEnum
How lines that are below 0 after shifting/merging should be handled
Source code in
muxtools/subtitle/basesub.py
SET_TO_ZERO
class-attribute
instance-attribute
Set both start and end to 0. Essentially disabling the line.
MAX_TO_ZERO
class-attribute
instance-attribute
Set the start to 0 and the end to what it would be after shifting or also 0 if also below 0.