encoders
VideoEncoder
dataclass
Bases: ABC
Source code in vsmuxtools/video/encoders.py
encode(clip, outfile=None)
abstractmethod
To actually run the encode.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
clip |
VideoNode
|
Your videonode |
required |
outfile |
PathLike | None
|
Can be a custom output file or directory. The correct extension will automatically be appended. Returns a VideoFile object. If you're only interested in the path you can just do |
None
|
Source code in vsmuxtools/video/encoders.py
x264
dataclass
Bases: SupportsQP
Encodes your clip to an avc/h264 file using x264.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settings |
str | PathLike | None
|
This will by default try to look for an |
None
|
zones |
Zone | list[Zone] | None
|
With this you can tweak settings of specific regions of the video. In x264 this includes but is not limited to CRF. For example (100, 300, "crf", 12) or [(100, 300, "crf", 12), (500, 750, 1.3)] If the third part is not a string it will assume a bitrate multiplier (or "b") |
None
|
qp_file |
PathLike | bool | None
|
Here you can pass a bool to en/disable or an existing filepath for one. |
None
|
qp_clip |
src_file | VideoNode | None
|
Can either be a straight up VideoNode or a SRC_FILE/FileInfo from this package. If neither a clip or a file are given it will simply skip. If only a clip is given it will generate one. |
None
|
add_props |
bool | None
|
This will explicitly add all props taken from the clip to the command line. This will be disabled by default if you are using a file and otherwise enabled. Files can have their own tokens like in vs-encode/vardautomation that will be filled in. |
None
|
sar |
str | None
|
Here you can pass your Pixel / Sample Aspect Ratio. This will overwrite whatever is in the clip if passed. |
None
|
resumable |
bool
|
Enable or disable resumable encodes. Very useful for people that have scripts that crash their PC (skill issue tbh) |
True
|
Source code in vsmuxtools/video/encoders.py
x265
dataclass
Bases: SupportsQP
Encodes your clip to an hevc/h265 file using x265.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settings |
str | PathLike | None
|
This will by default try to look for an |
None
|
zones |
Zone | list[Zone] | None
|
With this you can tweak settings of specific regions of the video. In x265 you're basically limited to a flat bitrate multiplier or force QP ("q") For example (100, 300, "b", 1.2) or [(100, 300, "q", 12), (500, 750, 1.3)] If the third part is not a string it will assume a bitrate multiplier (or "b") |
None
|
qp_file |
PathLike | bool | None
|
Here you can pass a bool to en/disable or an existing filepath for one. |
None
|
qp_clip |
src_file | VideoNode | None
|
Can either be a straight up VideoNode or a SRC_FILE/FileInfo from this package. If neither a clip or a file are given it will simply skip. If only a clip is given it will generate one. |
None
|
add_props |
bool | None
|
This will explicitly add all props taken from the clip to the command line. This will be disabled by default if you are using a file and otherwise enabled. Files can have their own tokens like in vs-encode/vardautomation that will be filled in. |
None
|
sar |
str | None
|
Here you can pass your Pixel / Sample Aspect Ratio. This will overwrite whatever is in the clip if passed. |
None
|
resumable |
bool
|
Enable or disable resumable encodes. Very useful for people that have scripts that crash their PC (skill issue tbh) |
True
|
csv |
bool | PathLike
|
Either a bool to enable or disable csv logging or a Filepath for said csv. |
True
|
Source code in vsmuxtools/video/encoders.py
LosslessX264
dataclass
Bases: VideoEncoder
Uses x264 to encode clip to a lossless avc stream.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
preset |
str | LosslessPreset
|
Can either be a string of some x264 preset or any of the 3 predefined presets. |
MIDDLEGROUND
|
settings |
str | None
|
Any other settings you might want to pass. Entirely optional. |
None
|
add_props |
bool
|
This will explicitly add all props taken from the clip to the command line. |
True
|
Source code in vsmuxtools/video/encoders.py
FFV1
dataclass
Bases: VideoEncoder
Uses ffmpeg to encode clip to a lossless ffv1 stream.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settings |
str | LosslessPreset
|
Can either be a string of your own settings or any of the 3 presets. |
MIDDLEGROUND
|
ensure_props |
bool
|
Calls initialize_clip on the clip to have at the very least guessed props |
True
|