sub-pgs
SubFilePGS
Bases: MuxingFile
Utility class representing a PGS/SUP subtitle file.
Source code in
muxtools/subtitle/sub_pgs.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
__init__(file, container_delay=0, source=None, tags=None)
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. |
None
|
tags
|
dict[str, str] | None
|
Custom matroska tags to assign to this as a track later on. |
None
|
Source code in
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
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
|