clips ¶
ProcVarClipSelf module-attribute
¶
ProcVarClipSelf = TypeVar('ProcVarClipSelf', bound=ProcessVariableClip)
ProcessVariableClip ¶
ProcessVariableClip(
clip: VideoNode,
out_dim: tuple[int, int] | Literal[False] | None = None,
out_fmt: int | VideoFormat | Literal[False] | None = None,
cache_size: int = 10,
)
Bases: DynamicClipsCache[T]
Source code
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
|
eval_clip ¶
eval_clip() -> VideoNode
Source code
286 287 288 289 290 291 292 293 |
|
from_clip classmethod
¶
from_clip(clip: VideoNode) -> VideoNode
Source code
298 299 300 301 302 303 |
|
from_func classmethod
¶
from_func(
clip: VideoNode,
func: Callable[[VideoNode], VideoNode],
out_dim: tuple[int, int] | Literal[False] | None = None,
out_fmt: int | VideoFormat | Literal[False] | None = None,
cache_size: int = 10,
) -> VideoNode
Source code
305 306 307 308 309 310 311 312 313 314 315 316 317 |
|
get_clip ¶
get_clip(key: T) -> VideoNode
Source code
295 296 |
|
get_key ¶
get_key(frame: VideoFrame) -> T
Source code
319 320 |
|
normalize ¶
normalize(clip: VideoNode, cast_to: T) -> VideoNode
Source code
322 323 |
|
process ¶
process(clip: VideoNode) -> VideoNode
Source code
325 326 |
|
ProcessVariableFormatClip ¶
ProcessVariableFormatClip(
clip: VideoNode,
out_dim: tuple[int, int] | Literal[False] | None = None,
out_fmt: int | VideoFormat | Literal[False] | None = None,
cache_size: int = 10,
)
Bases: ProcessVariableClip[VideoFormat]
Source code
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
|
eval_clip ¶
eval_clip() -> VideoNode
Source code
286 287 288 289 290 291 292 293 |
|
from_clip classmethod
¶
from_clip(clip: VideoNode) -> VideoNode
Source code
298 299 300 301 302 303 |
|
from_func classmethod
¶
from_func(
clip: VideoNode,
func: Callable[[VideoNode], VideoNode],
out_dim: tuple[int, int] | Literal[False] | None = None,
out_fmt: int | VideoFormat | Literal[False] | None = None,
cache_size: int = 10,
) -> VideoNode
Source code
305 306 307 308 309 310 311 312 313 314 315 316 317 |
|
get_clip ¶
get_clip(key: T) -> VideoNode
Source code
295 296 |
|
get_key ¶
get_key(frame: VideoFrame) -> VideoFormat
Source code
341 342 |
|
normalize ¶
normalize(clip: VideoNode, cast_to: VideoFormat) -> VideoNode
Source code
344 345 |
|
process ¶
process(clip: VideoNode) -> VideoNode
Source code
325 326 |
|
ProcessVariableResClip ¶
ProcessVariableResClip(
clip: VideoNode,
out_dim: tuple[int, int] | Literal[False] | None = None,
out_fmt: int | VideoFormat | Literal[False] | None = None,
cache_size: int = 10,
)
Bases: ProcessVariableClip[tuple[int, int]]
Source code
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
|
eval_clip ¶
eval_clip() -> VideoNode
Source code
286 287 288 289 290 291 292 293 |
|
from_clip classmethod
¶
from_clip(clip: VideoNode) -> VideoNode
Source code
298 299 300 301 302 303 |
|
from_func classmethod
¶
from_func(
clip: VideoNode,
func: Callable[[VideoNode], VideoNode],
out_dim: tuple[int, int] | Literal[False] | None = None,
out_fmt: int | VideoFormat | Literal[False] | None = None,
cache_size: int = 10,
) -> VideoNode
Source code
305 306 307 308 309 310 311 312 313 314 315 316 317 |
|
get_clip ¶
get_clip(key: T) -> VideoNode
Source code
295 296 |
|
get_key ¶
Source code
333 334 |
|
normalize ¶
Source code
336 337 |
|
process ¶
process(clip: VideoNode) -> VideoNode
Source code
325 326 |
|
ProcessVariableResFormatClip ¶
ProcessVariableResFormatClip(
clip: VideoNode,
out_dim: tuple[int, int] | Literal[False] | None = None,
out_fmt: int | VideoFormat | Literal[False] | None = None,
cache_size: int = 10,
)
Bases: ProcessVariableClip[tuple[int, int, VideoFormat]]
Source code
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
|
eval_clip ¶
eval_clip() -> VideoNode
Source code
286 287 288 289 290 291 292 293 |
|
from_clip classmethod
¶
from_clip(clip: VideoNode) -> VideoNode
Source code
298 299 300 301 302 303 |
|
from_func classmethod
¶
from_func(
clip: VideoNode,
func: Callable[[VideoNode], VideoNode],
out_dim: tuple[int, int] | Literal[False] | None = None,
out_fmt: int | VideoFormat | Literal[False] | None = None,
cache_size: int = 10,
) -> VideoNode
Source code
305 306 307 308 309 310 311 312 313 314 315 316 317 |
|
get_clip ¶
get_clip(key: T) -> VideoNode
Source code
295 296 |
|
get_key ¶
Source code
349 350 |
|
normalize ¶
Source code
352 353 |
|
process ¶
process(clip: VideoNode) -> VideoNode
Source code
325 326 |
|
finalize_clip ¶
finalize_clip(
clip: VideoNode,
bits: VideoFormatT | HoldsVideoFormatT | int | None = 10,
clamp_tv_range: bool | None = None,
dither_type: DitherType = AUTO,
*,
func: FuncExceptT | None = None
) -> VideoNode
Finalize a clip for output to the encoder.
Parameters:
-
clip
¶VideoNode
) –Clip to output.
-
bits
¶VideoFormatT | HoldsVideoFormatT | int | None
, default:10
) –Bitdepth to output to.
-
clamp_tv_range
¶bool | None
, default:None
) –Whether to clamp to tv range. If None, decide based on clip properties.
-
dither_type
¶DitherType
, default:AUTO
) –Dithering used for the bitdepth conversion.
-
func
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling. This should only be set by VS package developers.
Returns:
-
VideoNode
–Dithered down and optionally clamped clip.
Source code
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 |
|
finalize_output ¶
finalize_output(
function: F_VD | None = None,
/,
*,
bits: int | None = 10,
clamp_tv_range: bool = True,
dither_type: DitherType = AUTO,
func: FuncExceptT | None = None,
) -> Callable[[F_VD], F_VD] | F_VD
Decorator implementation of finalize_clip.
Source code
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
initialize_clip ¶
initialize_clip(
clip: VideoNode,
bits: int | None = None,
matrix: MatrixT | None = None,
transfer: TransferT | None = None,
primaries: PrimariesT | None = None,
chroma_location: ChromaLocationT | None = None,
color_range: ColorRangeT | None = None,
field_based: FieldBasedT | None = None,
strict: bool = False,
dither_type: DitherType = AUTO,
*,
func: FuncExceptT | None = None
) -> VideoNode
Initialize a clip with default props.
It is HIGHLY recommended to always use this function at the beginning of your scripts!
Parameters:
-
clip
¶VideoNode
) –Clip to initialize.
-
bits
¶int | None
, default:None
) –Bits to dither to. - If 0, no dithering is applied. - If None, 16 if bit depth is lower than it, else leave untouched. - If positive integer, dither to that bitdepth.
-
matrix
¶MatrixT | None
, default:None
) –Matrix property to set. If None, tries to get the Matrix from existing props. If no props are set or Matrix=2, guess from the video resolution.
-
transfer
¶TransferT | None
, default:None
) –Transfer property to set. If None, tries to get the Transfer from existing props. If no props are set or Transfer=2, guess from the video resolution.
-
primaries
¶PrimariesT | None
, default:None
) –Primaries property to set. If None, tries to get the Primaries from existing props. If no props are set or Primaries=2, guess from the video resolution.
-
chroma_location
¶ChromaLocationT | None
, default:None
) –ChromaLocation prop to set. If None, tries to get the ChromaLocation from existing props. If no props are set, guess from the video resolution.
-
color_range
¶ColorRangeT | None
, default:None
) –ColorRange prop to set. If None, tries to get the ColorRange from existing props. If no props are set, assume Limited Range.
-
field_based
¶FieldBasedT | None
, default:None
) –FieldBased prop to set. If None, tries to get the FieldBased from existing props. If no props are set, assume PROGRESSIVE.
-
strict
¶bool
, default:False
) –Whether to be strict about existing properties. If True, throws an exception if certain frame properties are not found.
-
dither_type
¶DitherType
, default:AUTO
) –Dithering used for the bitdepth conversion.
-
func
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling. This should only be set by VS package developers.
Returns:
-
VideoNode
–Clip with relevant frame properties set, and optionally dithered up to 16 bits by default.
Source code
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 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
|
initialize_input ¶
initialize_input(
function: None = None,
/,
*,
bits: int | None = 16,
matrix: MatrixT | None = None,
transfer: TransferT | None = None,
primaries: PrimariesT | None = None,
chroma_location: ChromaLocationT | None = None,
color_range: ColorRangeT | None = None,
field_based: FieldBasedT | None = None,
dither_type: DitherType = AUTO,
func: FuncExceptT | None = None,
) -> Callable[[F_VD], F_VD]
initialize_input(
function: F_VD,
/,
*,
bits: int | None = 16,
matrix: MatrixT | None = None,
transfer: TransferT | None = None,
primaries: PrimariesT | None = None,
chroma_location: ChromaLocationT | None = None,
color_range: ColorRangeT | None = None,
field_based: FieldBasedT | None = None,
strict: bool = False,
dither_type: DitherType = AUTO,
func: FuncExceptT | None = None,
) -> F_VD
initialize_input(
function: F_VD | None = None,
/,
*,
bits: int | None = 16,
matrix: MatrixT | None = None,
transfer: TransferT | None = None,
primaries: PrimariesT | None = None,
chroma_location: ChromaLocationT | None = None,
color_range: ColorRangeT | None = None,
field_based: FieldBasedT | None = None,
strict: bool = False,
dither_type: DitherType = AUTO,
func: FuncExceptT | None = None,
) -> Callable[[F_VD], F_VD] | F_VD
Decorator implementation of initialize_clip
Source code
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
|