utils ¶
Utilities for field-based processing and telecine pattern generation.
Functions:
-
dmetrics–Attaches the match metrics calculated by Telecide (decomb package) to frames as properties. Primarily intended for
-
get_field_difference–Compute the difference between top and bottom fields in a clip.
-
reinterlace–Reinterlace a progressive clip by separating and weaving fields.
-
reweave–Interleave two clips and weave them into full frames.
-
telecine_patterns–Generate all possible telecine patterns by interleaving frames from two clips.
-
weave–Recombine fields into frames using DoubleWeave.
dmetrics ¶
dmetrics(
clip: VideoNode,
tff: FieldBasedLike | bool | None = None,
chroma: bool = True,
nt: int = 10,
y: tuple[int, int] = (0, 0),
clip2: VideoNode | None = None,
func: FuncExcept | None = None,
) -> VideoNode
Attaches the match metrics calculated by Telecide (decomb package) to frames as properties. Primarily intended for use with Wobbly.
Parameters:
-
(clip¶VideoNode) –Input clip.
-
(tff¶FieldBasedLike | bool | None, default:None) –Field order (top-field-first). If None, inferred from the clip. Defaults to None.
-
(chroma¶bool, default:True) –Determines whether chroma combing is included in the decision made during postprocessing as to whether a frame is combed or not. Defaults to True.
-
(nt¶int, default:10) –Defines the noise tolerance threshold. Defaults to 10.
-
(y¶tuple[int, int], default:(0, 0)) –Define an exclusion band for the field matching. If y0 is not equal to y1 this feature is enabled. Rows in the image between lines y0 and y1 (inclusive) are excluded from consideration when the field matching is decided. This feature is typically used to ignore subtitling, which might otherwise throw off the matching. Defaults to (0, 0).
-
(clip2¶VideoNode | None, default:None) –Clip that dmetrics will copy the frame properties to. If
clip2is used, dmetrics will perform all calculations based onclip, but will copy the calculated metrics toclip2. This can be used to work around dmetrics's video format limitations. Defaults to None. -
(func¶FuncExcept | None, default:None) –Function returned for custom error handling. This should only be set by VS package developers.
Returns:
-
VideoNode–Clip with metrics attached as frame properties.
Source code in vsdeinterlace/utils.py
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 | |
get_field_difference ¶
get_field_difference(
clip: VideoNode,
tff: FieldBasedLike | bool | None = None,
func: FuncExcept | None = None,
) -> VideoNode
Compute the difference between top and bottom fields in a clip.
Parameters:
-
(clip¶VideoNode) –Input clip.
-
(tff¶FieldBasedLike | bool | None, default:None) –Field order (top-field-first). If None, inferred from the clip. Defaults to None.
-
(func¶FuncExcept | None, default:None) –Function returned for custom error handling. This should only be set by VS package developers.
Returns:
-
VideoNode–A clip with a per-frame property "FieldDifference" indicating the absolute difference between fields.
Source code in vsdeinterlace/utils.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | |
reinterlace ¶
reinterlace(
clip: VideoNode,
tff: FieldBasedLike | bool | None = None,
func: FuncExcept | None = None,
) -> VideoNode
Reinterlace a progressive clip by separating and weaving fields.
Parameters:
-
(clip¶VideoNode) –Input clip.
-
(tff¶FieldBasedLike | bool | None, default:None) –Field order (top-field-first). If None, inferred from the clip. Defaults to None.
-
(func¶FuncExcept | None, default:None) –Function returned for custom error handling. This should only be set by VS package developers.
Returns:
-
VideoNode–A reinterlaced clip with fields woven back into interlaced frames.
Source code in vsdeinterlace/utils.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
reweave ¶
reweave(
clipa: VideoNode,
clipb: VideoNode,
tff: FieldBasedLike | bool | None = None,
func: FuncExcept | None = None,
) -> VideoNode
Interleave two clips and weave them into full frames.
Parameters:
-
(clipa¶VideoNode) –First input clip.
-
(clipb¶VideoNode) –Second input clip.
-
(tff¶FieldBasedLike | bool | None, default:None) –Field order (top-field-first). If None, inferred from the clip. Defaults to None.
-
(func¶FuncExcept | None, default:None) –Function returned for custom error handling. This should only be set by VS package developers.
Returns:
-
VideoNode–A reweaved clip with fields combined into frames.
Source code in vsdeinterlace/utils.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
telecine_patterns ¶
telecine_patterns(
clipa: VideoNode,
clipb: VideoNode,
length: int = 5,
func: FuncExcept | None = None,
) -> list[VideoNode]
Generate all possible telecine patterns by interleaving frames from two clips.
Parameters:
-
(clipa¶VideoNode) –First input clip.
-
(clipb¶VideoNode) –Second input clip.
-
(length¶int, default:5) –Cycle length used for frame selection. Defaults to 5.
-
(func¶FuncExcept | None, default:None) –Function returned for custom error handling. This should only be set by VS package developers.
Returns:
-
list[VideoNode]–A list of interleaved clips, each representing a unique telecine pattern.
Source code in vsdeinterlace/utils.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
weave ¶
weave(
clip: VideoNode,
tff: FieldBasedLike | bool | None = None,
func: FuncExcept | None = None,
) -> VideoNode
Recombine fields into frames using DoubleWeave.
Parameters:
-
(clip¶VideoNode) –Input clip.
-
(tff¶FieldBasedLike | bool | None, default:None) –Field order (top-field-first). If None, inferred from the clip. Defaults to None.
-
(func¶FuncExcept | None, default:None) –Function returned for custom error handling. This should only be set by VS package developers.
Returns:
-
VideoNode–A clip with fields woven back into full frames.
Source code in vsdeinterlace/utils.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |