sub-pgs
SubFilePGS
dataclass
Bases: MuxingFile
Utility class representing a PGS/SUP subtitle file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file
|
PathLike | list[PathLike] | GlobSearch
|
Can be a string, Path object or GlobSearch. |
required |
container_delay
|
int
|
Set a container delay used in the muxing process later. |
0
|
source
|
PathLike | None
|
The file this sub originates from, will be set by the constructor. |
None
|
Source code in .venv/lib/python3.11/site-packages/muxtools/subtitle/sub_pgs.py
extract_from(fileIn, track=0, preserve_delay=False, quiet=True)
classmethod
Extract a PGS subtitle track from a file using ffmpeg.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fileIn
|
PathLike
|
The input file to extract from. |
required |
track
|
int
|
The track number to extract. |
0
|
preserve_delay
|
bool
|
If True, the container delay will be preserved. |
False
|
quiet
|
bool
|
If True, suppresses ffmpeg output. |
True
|
Returns:
Type | Description |
---|---|
Self
|
An instance of SubFilePGS containing the extracted subtitle. |
Source code in .venv/lib/python3.11/site-packages/muxtools/subtitle/sub_pgs.py
shift(shift, shift_is_ms=False, timesource=None, timescale=None, quiet=True)
Shifts all lines by any frame number with supmover.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shift
|
int
|
Number of frames to shift by |
required |
shift_is_ms
|
bool
|
If True, the shift is in milliseconds. |
False
|
timesource
|
TimeSourceT
|
The source of timestamps/timecodes. For details check the docstring on the type. |
None
|
timescale
|
TimeScaleT
|
Unit of time (in seconds) in terms of which frame timestamps are represented. For details check the docstring on the type. |
None
|
quiet
|
bool
|
If True, suppresses supmover output. |
True
|