utils ¶
Utilities for field-based processing and telecine pattern generation.
Functions:
-
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.
get_field_difference ¶
get_field_difference(
clip: VideoNode,
tff: FieldBasedLike | bool | None = None,
func: FuncExcept | None = None,
) -> ConstantFormatVideoNode
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:
-
ConstantFormatVideoNode
–A clip with a per-frame property "FieldDifference" indicating the absolute difference between fields.
Source code in vsdeinterlace/utils.py
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 |
|
reinterlace ¶
reinterlace(
clip: VideoNode,
tff: FieldBasedLike | bool | None = None,
func: FuncExcept | None = None,
) -> ConstantFormatVideoNode
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:
-
ConstantFormatVideoNode
–A reinterlaced clip with fields woven back into interlaced frames.
Source code in vsdeinterlace/utils.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
reweave ¶
reweave(
clipa: VideoNode,
clipb: VideoNode,
tff: FieldBasedLike | bool | None = None,
func: FuncExcept | None = None,
) -> ConstantFormatVideoNode
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:
-
ConstantFormatVideoNode
–A reweaved clip with fields combined into frames.
Source code in vsdeinterlace/utils.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|
telecine_patterns ¶
telecine_patterns(
clipa: VideoNode,
clipb: VideoNode,
length: int = 5,
func: FuncExcept | None = None,
) -> list[ConstantFormatVideoNode]
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[ConstantFormatVideoNode]
–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 35 36 37 |
|
weave ¶
weave(
clip: VideoNode,
tff: FieldBasedLike | bool | None = None,
func: FuncExcept | None = None,
) -> ConstantFormatVideoNode
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:
-
ConstantFormatVideoNode
–A clip with fields woven back into full frames.
Source code in vsdeinterlace/utils.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
|