muxtools.helpers.propedit
MKVPropEdit
MKVPropEdit(fileIn: PathLike, track_statistics: bool | None = None, chapters: PathLike | Chapters = None, tags: dict[str, str] | None = None)
Creates the mkvpropedit helper including any modifications possible on the global scope.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fileIn
|
PathLike
|
File to edit. |
required |
track_statistics
|
bool | None
|
Whether to update or remove track statistics like bitrate.
|
None
|
chapters
|
PathLike | Chapters
|
Chapters to add to the file. This can be any txt or xml file in the same formats that mkvmerge takes. It can also take a muxtools Chapters object and create a txt from that. An empty string will remove any chapters. |
None
|
tags
|
dict[str, str] | None
|
Global tags to add/replace. An empty string as value will remove a tag. An empty dict will remove any global tags. |
None
|
Source code in
muxtools/helpers/propedit.py
info
info(title: str | None = None, date: str | None = None, muxing_application: str | None = None, writing_application: str | None = None, **kwargs: bool | str | None)
Edit properties for the main info section.
None always means the property will be left untouched while an empty string will remove the property outright.
Bool values are converted to their respective integer to be passed on to mkvpropedit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str | None
|
The title for the whole movie |
None
|
date
|
str | None
|
The date the file was created |
None
|
muxing_application
|
str | None
|
The name of the application or library used for multiplexing the file |
None
|
writing_application
|
str | None
|
The name of the application or library used for writing the file |
None
|
kwargs
|
bool | str | None
|
Any other properties to set or remove. Check out the 'Segment information' section in |
{}
|
Source code in
muxtools/helpers/propedit.py
video_track
video_track(name: str | None = None, language: str | None = None, default: bool | None = None, forced: bool | None = None, tags: dict[str, str] | None = None, crop: int | Sequence[int] | None = None, **kwargs: bool | str | None) -> Self
Edit properties for the next video track in the file.
None always means the property will be left untouched while an empty string will remove the property outright.
Bool values are converted to their respective integer to be passed on to mkvpropedit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
A human-readable track name |
None
|
language
|
str | None
|
Specifies the language of the track |
None
|
default
|
bool | None
|
Specifies whether a track should be eligible for automatic selection |
None
|
forced
|
bool | None
|
Specifies whether a track should be played with tracks of a different type but same language |
None
|
tags
|
dict[str, str] | None
|
Any custom/arbitrary tags to set for the track. An empty string as value will remove a tag An empty dict will remove any custom tags. |
None
|
crop
|
int | Sequence[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
|
kwargs
|
bool | str | None
|
Any other properties to set or remove. Check out the 'Track headers' section in |
{}
|
Source code in
muxtools/helpers/propedit.py
audio_track
audio_track(name: str | None = None, language: str | None = None, default: bool | None = None, forced: bool | None = None, tags: dict[str, str] | None = None, **kwargs: bool | str | None) -> Self
Edit properties for the next audio track in the file.
None always means the property will be left untouched while an empty string will remove the property outright.
Bool values are converted to their respective integer to be passed on to mkvpropedit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
A human-readable track name |
None
|
language
|
str | None
|
Specifies the language of the track |
None
|
default
|
bool | None
|
Specifies whether a track should be eligible for automatic selection |
None
|
forced
|
bool | None
|
Specifies whether a track should be played with tracks of a different type but same language |
None
|
tags
|
dict[str, str] | None
|
Any custom/arbitrary tags to set for the track. An empty string as value will remove a tag. An empty dict will remove any custom tags. |
None
|
kwargs
|
bool | str | None
|
Any other properties to set or remove. Check out the 'Track headers' section in |
{}
|
Source code in
muxtools/helpers/propedit.py
sub_track
sub_track(name: str | None = None, language: str | None = None, default: bool | None = None, forced: bool | None = None, tags: dict[str, str] | None = None, **kwargs: bool | str | None) -> Self
Edit properties for the next subtitle track in the file.
None always means the property will be left untouched while an empty string will remove the property outright.
Bool values are converted to their respective integer to be passed on to mkvpropedit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
A human-readable track name |
None
|
language
|
str | None
|
Specifies the language of the track |
None
|
default
|
bool | None
|
Specifies whether a track should be eligible for automatic selection |
None
|
forced
|
bool | None
|
Specifies whether a track should be played with tracks of a different type but same language |
None
|
tags
|
dict[str, str] | None
|
Any custom/arbitrary tags to set for the track. An empty string as value will remove a tag. An empty dict will remove any custom tags. |
None
|
kwargs
|
bool | str | None
|
Any other properties to set or remove. Check out the 'Track headers' section in |
{}
|
Source code in
muxtools/helpers/propedit.py
run
Run the mkvpropedit process.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quiet
|
bool
|
Suppresses the output. The stdout will still be printed on failure regardless of this setting. |
True
|
error_on_failure
|
bool
|
Raise an exception on failure. Otherwise this function will return a bool indicating the success. |
True
|
Returns:
| Type | Description |
|---|---|
tuple[Path, bool]
|
Returns the path and a boolean indicating the success. This may be a new path when a CRC32 was detected, swapped and the file renamed. |