heuristics ¶
Functions:
-
video_heuristics
–Determine video heuristics from frame properties.
-
video_resample_heuristics
–Get a kwargs object for a video's heuristics to pass to the resize plugin or Kernel.resample.
video_heuristics ¶
video_heuristics(
clip: VideoNode,
props: Mapping[str, Any] | bool | None = None,
prop_in: bool = True,
assumed_return: bool = False,
) -> dict[str, PropEnum] | tuple[dict[str, PropEnum], list[str]]
Determine video heuristics from frame properties.
Parameters:
-
clip
¶VideoNode
) –The input clip.
-
props
¶Mapping[str, Any] | bool | None
, default:None
) –Source properties used to retrieve values.
- If True: uses the frame properties from the clip when available.
- If a Mapping is passed: uses the frame properties from it when available.
- If any other value or frame properties unavailable: values are inferred from the clip's resolution.
-
prop_in
¶bool
, default:True
) –If True, returns a dict with keys in the form
{prop_name}_in
(e.g.,matrix_in
instead ofmatrix
).For more details, see the Resize docs.
-
assumed_return
¶bool
, default:False
) –If True, returns the assumed props as a list alongside the heuristics.
Returns:
-
dict[str, PropEnum] | tuple[dict[str, PropEnum], list[str]]
–A dict containing all determinable video heuristics, optionally using key names derived
-
dict[str, PropEnum] | tuple[dict[str, PropEnum], list[str]]
–from the resize plugin.
Source code in vstools/functions/heuristics.py
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 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
video_resample_heuristics ¶
video_resample_heuristics(
clip: VideoNode, kwargs: KwargsT | None = None, **fmt_kwargs: Any
) -> KwargsT
Get a kwargs object for a video's heuristics to pass to the resize plugin or Kernel.resample.
Parameters:
-
clip
¶VideoNode
) –Clip to derive the heuristics from.
-
kwargs
¶KwargsT | None
, default:None
) –Keyword arguments for the _out parameters.
-
**fmt_kwargs
¶Any
, default:{}
) –Keyword arguments to pass to the output kwargs. These will override any heuristics that were derived from the input clip!
Returns:
-
KwargsT
–Keyword arguments to pass on to the resize plugin or Kernel.resample.
Source code in vstools/functions/heuristics.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
|