clip ¶
process_var_clip ¶
Process variable format/resolution clips with a given function.
This function will temporarily assert a resolution and format for a variable clip, run the given function, and then return a variable format clip back.
The function must accept a VideoNode and return a VideoNode.
Parameters:
-
clip
¶VideoNode
) –Input clip.
-
function
¶F_VD
) –Function that takes and returns a single VideoNode.
Returns:
-
VideoNode
–Processed variable clip.
Source code
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 |
|
shift_clip ¶
Shift a clip forwards or backwards by N frames.
This is useful for cases where you must compare every frame of a clip with the frame that comes before or after the current frame, like for example when performing temporal operations.
Both positive and negative integers are allowed. Positive values will shift a clip forward, negative will shift a clip backward.
Parameters:
-
clip
¶VideoNode
) –Input clip.
-
offset
¶int
) –Number of frames to offset the clip with. Negative values are allowed. Positive values will shift a clip forward, negative will shift a clip backward.
Returns:
-
VideoNode
–Clip that has been shifted forwards or backwards by N frames.
Source code
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
shift_clip_multi ¶
shift_clip_multi(
clip: VideoNode, offsets: FrameRange = (-1, 1)
) -> list[VideoNode]
Shift a clip forwards or backwards multiple times by a varying amount of frames.
This will return a clip for every shifting operation performed. This is a convenience function that makes handling multiple shifts easier.
Example:
.. code-block:: python
>>> shift_clip_multi(clip, (-3, 3))
[VideoNode, VideoNode, VideoNode, VideoNode, VideoNode, VideoNode, VideoNode]
-3 -2 -1 0 +1 +2 +3
Parameters:
-
clip
¶VideoNode
) –Input clip.
-
offsets
¶FrameRange
, default:(-1, 1)
) –List of frame ranges for offsetting. A clip will be returned for every offset. Default: (-1, 1).
Returns:
-
list[VideoNode]
–A list of clips, the amount determined by the amount of offsets.
Source code
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 |
|