muxtools.utils.types
__all__
module-attribute
__all__ = ['PathLike', 'Paths', 'Trim', 'TrackType', 'AudioFrame', 'AudioStats', 'AudioInfo', 'Chapter', 'LooseChapter', 'DitherType', 'LossyWavQuality', 'VideoMeta', 'TimeScale', 'FileMixin']
LooseChapter
module-attribute
Chapter type where the time can be a frame number or timedelta.
The chapters class will normalize these to just timedeltas.
TimeSourceT
module-attribute
TimeSourceT = PathLike | Fraction | float | list | VideoMeta | ABCTimestamps | tuple[Path | str, int]
The source of timestamps/timecodes.
For actual timestamps, this can be a timestamps (v1/v2/v4) file, a video file or a list of integers.
You can also pass a tuple of some form of path to a video file and a relative video track index.
For FPS based timestamps, this can be a Fraction object, a float or even a string representing a fraction.
Like '24000/1001'.
Can also be an already instantiated Timestamps class from the videotimestamps library.
None will usually fallback to 24000/1001 but exact behavior might differ based on the target function.
TimeScaleT
module-attribute
Unit of time (in seconds) in terms of which frame timestamps are represented.
While you can pass an int, the needed type is always a Fraction and will be converted via Fraction(your_int).
None will usually fallback to a generic mkv timescale but exact behavior might differ based on the target function.
TrackType
VideoMeta
dataclass
Source code in
muxtools/utils/types.py
to_json
from_json
staticmethod
Source code in
muxtools/utils/types.py
TimeScale
DitherType
Bases: IntEnum
FFMPEG Dither Methods, see https://ffmpeg.org/ffmpeg-resampler.html#Resampler-Options
Source code in
muxtools/utils/types.py
qAAC_MODE
Bases: IntEnum
Source code in
muxtools/utils/types.py
LossyWavQuality
Bases: IntEnum
LossyWAV Quality presets, see https://wiki.hydrogenaud.io/index.php?title=LossyWAV#Quality_presets
TL;DR: Insane the least lossy, ExtraPortable the most lossy.
Source code in
muxtools/utils/types.py
ValidInputType
Bases: IntEnum
Source code in
muxtools/utils/types.py
allows_flac
FileMixin
Source code in
muxtools/utils/types.py
AudioFrame
dataclass
A dataclass representing ffmpeg's ashowdata filter output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
The (sequential) number of the input frame, starting from 0 |
required |
pts
|
int
|
The presentation timestamp of the input frame, in time base units the time base depends on the filter input pad, and is usually 1/sample_rate |
required |
pts_time
|
float
|
The presentation timestamp of the input frame in seconds |
required |
num_samples
|
int
|
Number of samples in a frame (can also be refered to as frame length or size) |
required |
Source code in
muxtools/utils/types.py
AudioStats
dataclass
A dataclass representing ffmpeg's astats filter output.
Too many attributes to document to be honest.
See https://ffmpeg.org/ffmpeg-filters.html#astats-1