funcs ¶
Functions:
-
combine
–Combines multiple video clips using a specified expression operator.
-
expr_func
–Calls
akarin.Expr
plugin. -
norm_expr
–Evaluate a per-pixel expression on input clip(s), normalize it based on the specified planes,
ExprLike module-attribute
¶
A recursive type representing a valid expression input.
Acceptable forms include: - A single string (or string-like object): Used as the same expression for all planes. - A list of expressions: Concatenated into a single expression for all planes. - A tuple of expressions: Interpreted as separate expressions for each plane. - A TupleExprList: will make a norm_expr call for each expression within this tuple.
combine ¶
combine(
clips: VideoNodeIterableT[VideoNode],
operator: ExprOpBase = MAX,
suffix: SupportsString | Iterable[SupportsString] | None = None,
prefix: SupportsString | Iterable[SupportsString] | None = None,
expr_suffix: SupportsString | Iterable[SupportsString] | None = None,
expr_prefix: SupportsString | Iterable[SupportsString] | None = None,
planes: PlanesT = None,
split_planes: bool = False,
**kwargs: Any
) -> ConstantFormatVideoNode
Combines multiple video clips using a specified expression operator.
Parameters:
-
clips
¶VideoNodeIterableT[VideoNode]
) –Input clip(s).
-
operator
¶ExprOpBase
, default:MAX
) –An ExprOpBase enum used to join the clips.
-
suffix
¶SupportsString | Iterable[SupportsString] | None
, default:None
) –Optional suffix string(s) to append to each input variable in the expression.
-
prefix
¶SupportsString | Iterable[SupportsString] | None
, default:None
) –Optional prefix string(s) to prepend to each input variable in the expression.
-
expr_suffix
¶SupportsString | Iterable[SupportsString] | None
, default:None
) –Optional expression to append after the combined input expression.
-
expr_prefix
¶SupportsString | Iterable[SupportsString] | None
, default:None
) –Optional expression to prepend before the combined input expression.
-
planes
¶PlanesT
, default:None
) –Which planes to process. Defaults to all.
-
split_planes
¶bool
, default:False
) –If True, treats each plane of input clips as separate inputs.
-
**kwargs
¶Any
, default:{}
) –Additional keyword arguments forwarded to norm_expr.
Returns:
-
ConstantFormatVideoNode
–A clip representing the combined result of applying the expression.
Source code
94 95 96 97 98 99 100 101 102 103 104 105 106 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 132 133 134 |
|
expr_func ¶
expr_func(
clips: VideoNode | Sequence[VideoNode],
expr: str | Sequence[str],
format: HoldsVideoFormatT | VideoFormatT | None = None,
opt: bool | None = None,
boundary: bool = True,
func: FuncExceptT | None = None,
) -> ConstantFormatVideoNode
Calls akarin.Expr
plugin.
For a higher-level function, see norm_expr
Parameters:
-
clips
¶VideoNode | Sequence[VideoNode]
) –Input clip(s). Supports constant format clips, or one variable resolution clip.
-
expr
¶str | Sequence[str]
) –Expression to be evaluated.
-
format
¶HoldsVideoFormatT | VideoFormatT | None
, default:None
) –Output format, defaults to the first clip format.
-
opt
¶bool | None
, default:None
) –Forces integer evaluation as much as possible.
-
boundary
¶bool
, default:True
) –Specifies the default boundary condition for relative pixel accesses:
- True (default): Mirrored edges.
- False: Clamped edges.
-
func
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling. This should only be set by VS package developers.
Raises:
-
CustomRuntimeError
–If
akarin
plugin is not found. -
Error
–If the expression could not be evaluated.
Returns:
-
ConstantFormatVideoNode
–Evaluated clip.
Source code
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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
norm_expr ¶
norm_expr(
clips: VideoNodeIterableT[VideoNode],
expr: ExprLike,
planes: PlanesT = None,
format: HoldsVideoFormatT | VideoFormatT | None = None,
opt: bool | None = None,
boundary: bool = True,
func: FuncExceptT | None = None,
split_planes: bool = False,
debug: bool = False,
**kwargs: Iterable[SupportsString] | SupportsString
) -> ConstantFormatVideoNode
Evaluate a per-pixel expression on input clip(s), normalize it based on the specified planes, and format tokens and placeholders using provided keyword arguments.
Parameters:
-
clips
¶VideoNodeIterableT[VideoNode]
) –Input clip(s). Supports constant format clips, or one variable resolution clip.
-
expr
¶ExprLike
) –Expression to be evaluated.
- A single str will be processed for all planes.
- A list will be concatenated to form a single expr for all planes.
- A tuple of these types will allow specification of different expr for each planes.
- A TupleExprList will make a
norm_expr
call for each expression within this tuple.
-
planes
¶PlanesT
, default:None
) –Plane to process, defaults to all.
-
format
¶HoldsVideoFormatT | VideoFormatT | None
, default:None
) –Output format, defaults to the first clip format.
-
opt
¶bool | None
, default:None
) –Forces integer evaluation as much as possible.
-
boundary
¶bool
, default:True
) –Specifies the default boundary condition for relative pixel accesses:
- True (default): Mirrored edges.
- False: Clamped edges.
-
func
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling. This should only be set by VS package developers.
-
split_planes
¶bool
, default:False
) –Splits the VideoNodes into their individual planes.
-
debug
¶bool
, default:False
) –Print out the normalized expr.
-
**kwargs
¶Iterable[SupportsString] | SupportsString
, default:{}
) –Additional keywords arguments to be passed to the expression function. These arguments are key-value pairs, where the keys are placeholders that will be replaced in the expression string. Iterable values (except str and bytes types) will be associated with the corresponding plane.
Returns:
-
ConstantFormatVideoNode
–Evaluated clip.
Source code
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
|