check ¶
Functions:
-
check_correct_subsampling–Check if the subsampling is correct and return an error if it's not.
-
check_progressive–Check if the clip is progressive and return an error if it's not.
-
check_ref_clip–Function for ensuring the ref clip's format matches that of the input clip.
-
check_variable–Check for variable format and a variable resolution and return an error if found.
-
check_variable_format–Check for variable format and return an error if found.
-
check_variable_resolution–Check for variable width or height and return an error if found.
check_correct_subsampling ¶
check_correct_subsampling(
clip: VideoNode, width: int, height: int, func: FuncExcept | None = None
) -> None
Check if the subsampling is correct and return an error if it's not.
Parameters:
-
(clip¶VideoNode) –Clip to check.
-
(width¶int) –Output width.
-
(height¶int) –Output height.
-
(func¶FuncExcept | None, default:None) –Function returned for custom error handling. This should only be set by VS package developers.
Raises:
-
CustomValueError–The clip has invalid subsampling.
Source code in vstools/utils/check.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
check_progressive ¶
Check if the clip is progressive and return an error if it's not.
Parameters:
-
(clip¶VideoNode) –Clip to check.
-
(func¶FuncExcept) –Function returned for custom error handling. This should only be set by VS package developers.
Raises:
-
UnsupportedFieldBasedError–The clip is interlaced.
Source code in vstools/utils/check.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
check_ref_clip ¶
check_ref_clip(
src: VideoNode, ref: VideoNode | None, func: FuncExcept | None = None
) -> VideoNode
Function for ensuring the ref clip's format matches that of the input clip.
If no ref clip can be found, this function will simply do nothing.
Parameters:
Raises:
-
VariableFormatError–The format of either clip is variable.
-
VariableResolutionError–The resolution of either clip is variable.
-
FormatsRefClipMismatchError–The formats of the two clips do not match.
-
ResolutionsRefClipMismatchError–The resolutions of the two clips do not match.
Returns:
-
VideoNode–Ref clip.
Source code in vstools/utils/check.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | |
check_variable ¶
check_variable(clip: VideoNode, func: FuncExcept) -> Literal[True]
Check for variable format and a variable resolution and return an error if found.
Raises:
-
VariableFormatError–The clip is of a variable format.
-
VariableResolutionError–The clip has a variable resolution.
Source code in vstools/utils/check.py
92 93 94 95 96 97 98 99 100 101 102 103 104 | |
check_variable_format ¶
Check for variable format and return an error if found.
Raises:
-
VariableFormatError–The clip is of a variable format.
Source code in vstools/utils/check.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
check_variable_resolution ¶
check_variable_resolution(clip: VideoNode, func: FuncExcept) -> Literal[True]
Check for variable width or height and return an error if found.
Raises:
-
VariableResolutionError–The clip has a variable resolution.
Source code in vstools/utils/check.py
78 79 80 81 82 83 84 85 86 87 88 89 | |