tracks
VT = VideoTrack
module-attribute
AT = AudioTrack
module-attribute
ST = SubTrack
module-attribute
MkvTrack = Premux
module-attribute
_track
Source code in muxtools/muxing/tracks.py
args: list[str] | None = args
instance-attribute
default: bool = default
instance-attribute
delay: int = file.container_delay if isinstance(file, MuxingFile) else delay
instance-attribute
file: Path = ensure_path_exists(file, self)
instance-attribute
forced: bool = forced
instance-attribute
lang: str = lang
instance-attribute
name: str = name
instance-attribute
tags: dict[str, str] | None = tags
instance-attribute
type: TrackType = type if isinstance(type, TrackType) else TrackType(type) if isinstance(type, int) else TrackType[type.upper()]
instance-attribute
__init__(file, type, name='', lang='', default=True, forced=False, delay=0, args=None, tags=None)
Source code in muxtools/muxing/tracks.py
mkvmerge_args()
Source code in muxtools/muxing/tracks.py
VideoTrack
Bases: _track
_track object with VIDEO type preselected and japanese language default
Parameters:
Name | Type | Description | Default |
---|---|---|---|
timecode_file
|
PathLike | GlobSearch | None
|
Pass a path for proper vfr playback if needed. |
None
|
crop
|
int | tuple[int, int] | tuple[int, int, int, int] | None
|
Container based cropping with (horizontal, vertical) or (left, top, right, bottom). Will crop the same on all sides if passed a single integer. |
None
|
Source code in muxtools/muxing/tracks.py
args: list[str] | None = args
instance-attribute
default: bool = default
instance-attribute
delay: int = file.container_delay if isinstance(file, MuxingFile) else delay
instance-attribute
file: Path = ensure_path_exists(file, self)
instance-attribute
forced: bool = forced
instance-attribute
lang: str = lang
instance-attribute
name: str = name
instance-attribute
tags: dict[str, str] | None = tags
instance-attribute
type: TrackType = type if isinstance(type, TrackType) else TrackType(type) if isinstance(type, int) else TrackType[type.upper()]
instance-attribute
__init__(file, name='', lang='ja', default=True, forced=False, delay=0, timecode_file=None, crop=None, args=[], tags=None)
Source code in muxtools/muxing/tracks.py
mkvmerge_args()
Source code in muxtools/muxing/tracks.py
AudioTrack
Bases: _track
_track object with AUDIO type preselected and japanese language default
Source code in muxtools/muxing/tracks.py
args: list[str] | None = args
instance-attribute
default: bool = default
instance-attribute
delay: int = file.container_delay if isinstance(file, MuxingFile) else delay
instance-attribute
file: Path = ensure_path_exists(file, self)
instance-attribute
forced: bool = forced
instance-attribute
lang: str = lang
instance-attribute
name: str = name
instance-attribute
tags: dict[str, str] | None = tags
instance-attribute
type: TrackType = type if isinstance(type, TrackType) else TrackType(type) if isinstance(type, int) else TrackType[type.upper()]
instance-attribute
__init__(file, name='', lang='ja', default=True, forced=False, delay=0, args=None, tags=None)
Source code in muxtools/muxing/tracks.py
mkvmerge_args()
Source code in muxtools/muxing/tracks.py
SubTrack
Bases: _track
_track object with SUB type preselected and english language default
Supports merging multiple files by passing a List of Path objects or filepath strings and of course also a GlobSearch
Source code in muxtools/muxing/tracks.py
args: list[str] | None = args
instance-attribute
default: bool = default
instance-attribute
delay: int = file.container_delay if isinstance(file, MuxingFile) else delay
instance-attribute
file: Path = ensure_path_exists(file, self)
instance-attribute
forced: bool = forced
instance-attribute
lang: str = lang
instance-attribute
name: str = name
instance-attribute
tags: dict[str, str] | None = tags
instance-attribute
type: TrackType = type if isinstance(type, TrackType) else TrackType(type) if isinstance(type, int) else TrackType[type.upper()]
instance-attribute
__init__(file, name='', lang='en', default=True, forced=False, delay=0, args=None, tags=None)
Source code in muxtools/muxing/tracks.py
mkvmerge_args()
Source code in muxtools/muxing/tracks.py
Premux
Bases: _track
Source code in muxtools/muxing/tracks.py
args: list[str] | None = args
instance-attribute
default: bool = default
instance-attribute
delay: int = file.container_delay if isinstance(file, MuxingFile) else delay
instance-attribute
file: Path = ensure_path_exists(file, self)
instance-attribute
forced: bool = forced
instance-attribute
lang: str = lang
instance-attribute
name: str = name
instance-attribute
tags: dict[str, str] | None = tags
instance-attribute
type: TrackType = type if isinstance(type, TrackType) else TrackType(type) if isinstance(type, int) else TrackType[type.upper()]
instance-attribute
__init__(file, video=-1, audio=-1, subtitles=-1, keep_attachments=True, mkvmerge_args='--no-global-tags', assume_absolute=False)
Custom Track object to arbitrarily grab tracks from an existing file.
For all track params:
None
means there won't be any chosen and -1
means all will be chosen.
You can also specify a single or multiple relative track numbers to choose any.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
video
|
int | list[int] | None
|
Video Track(s) to choose |
-1
|
audio
|
int | list[int] | None
|
Audio Track(s) to choose |
-1
|
subtitles
|
int | list[int] | None
|
Subtitle Track(s) to choose |
-1
|
keep_attachments
|
bool
|
Whether to keep attachments from the file. Fonts for example. |
True
|
mkvmerge_args
|
str | list[str]
|
Any other args you may want to pass. |
'--no-global-tags'
|
assume_absolute
|
bool
|
Assume that the track numbers passed were already absolute to begin with. If False it will simply get absolute numbers derived from the relative ones. |
False
|
Source code in muxtools/muxing/tracks.py
mkvmerge_args()
Source code in muxtools/muxing/tracks.py
Attachment
Bases: _track
pseudo _track object for attachments