Utility functions
vs-kernels
offers additional utility functions to help ease your module writing.
|
Get the matrix of a clip or VideoFrame. |
- vskernels.util.get_matrix(frame, strict=False)
Get the matrix of a clip or VideoFrame.
By default this function will first check the _Matrix prop for a valid matrix. If the matrix is not set, it will guess based on the resolution.
If you want it to be strict and raise an error if no matrix is set, set
strict=True
.- Parameters
clip – Clip or VideoFrame to process.
strict (bool) – Whether to be strict about the matrix. If
True
, checks just the _Matrix prop. IfFalse
, will check the _Matrix prop and make a guess if _Matrix=Matrix.UNKNOWN. Default: False.
- Return type
Matrix
- Returns
Value representing a matrix.
- Raises
UndefinedMatrixError – This matrix was undefined and strict was enabled.
ReservedMatrixError – This matrix is reserved.
UnsupportedMatrixError – VapourSynth no longer supports this matrix.
UnsupportedMatrixError – This matrix is unsupported.