-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a bob deinterlacer that uses core lib resizing.
- Loading branch information
1 parent
2c41ecd
commit 98dc349
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from typing import Callable, Optional | ||
|
||
from vapoursynth import VideoNode, core | ||
|
||
from vsfieldkit.util import convert_format_if_needed | ||
|
||
|
||
def bob( | ||
clip: VideoNode, | ||
tff: Optional[bool] = None, | ||
keep_field_property: bool = True, | ||
kernel: Callable = core.resize.Spline36, | ||
dither_type: str = 'random' | ||
) -> VideoNode: | ||
"""Returns a clip of progressive frames, each consisting of a field from | ||
the original interlaced clip in order of its original capture. | ||
As interlaced fields have half the resolution of a given moment, the new | ||
frames are stretched up to the original clip's height. | ||
""" | ||
as_fields = clip.std.SeparateFields(tff=tff) | ||
stretched = convert_format_if_needed( | ||
as_fields, | ||
height=clip.height, | ||
kernel=kernel, | ||
dither_type=dither_type | ||
) | ||
if keep_field_property: | ||
return stretched | ||
|
||
return stretched.std.RemoveFrameProps(('_Field',)) |