Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
1st September 2021, 11:31 | #1 | Link |
Registered User
Join Date: Mar 2019
Posts: 8
|
VapourSynth equivalent of AviSynth's ChromaShiftSP?
Looking to use a similar plugin in VapourSynth to: http://avisynth.nl/index.php/ChromaShiftSP
I've looked at the VapourSynth Database, but can't find any plugins that allow for pixel/sub-pixel adjustment of the chroma. Is there another way to do it in VS, or a way to make the ChromaShiftSP avsi file work with VS? Thank you for any/all assistance! |
1st September 2021, 11:54 | #2 | Link |
Registered User
Join Date: Jan 2018
Posts: 2,156
|
Maybe you need try port avs script to Vapoursynth. I find out MergeChrma here, good luck:
https://github.com/WolframRhodium/mu...sfunc.py#L1643 |
1st September 2021, 15:53 | #3 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
This seems to work ok. There is no fancy built-in error messages, and the resizer is hardcoded to Spline16 , like the original.
Code:
def ChromaShiftSP (clip, X=0.0, Y=0.0): #Vapoursynth version of Avisynth ChromaShiftSP #Original AVS ChromaShift_SP: Shift chroma with subpixel accuracy, basic function by IanB, made standalone by McCauley #X: positive values shift the chroma to left, negative values to right #Y: positive values shift the chroma upwards, negative values downwards Yplane = core.std.ShufflePlanes(clip, planes=0, colorfamily=vs.GRAY) shift = core.resize.Spline16(clip, width=clip.width, height=clip.height, src_left=X, src_top=Y, src_width=clip.width + X, src_height=clip.height + Y) shiftu = core.std.ShufflePlanes(shift, planes=1, colorfamily=vs.GRAY) shiftv = core.std.ShufflePlanes(shift, planes=2, colorfamily=vs.GRAY) merge = core.std.ShufflePlanes(clips=[Yplane, shiftu, shiftv], planes=[0, 0, 0], colorfamily=vs.YUV) return merge |
1st September 2021, 16:36 | #4 | Link |
Registered User
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 377
|
Should produce the same result with less operations
Code:
def ChromaShiftSP (clip, X=0.0, Y=0.0): #Vapoursynth version of Avisynth ChromaShiftSP #Original AVS ChromaShift_SP: Shift chroma with subpixel accuracy, basic function by IanB, made standalone by McCauley #X: positive values shift the chroma to left, negative values to right #Y: positive values shift the chroma upwards, negative values downwards Yplane = core.std.ShufflePlanes(clip, planes=0, colorfamily=vs.GRAY) shift = core.resize.Spline16(clip, width=clip.width, height=clip.height, src_left=X, src_top=Y, src_width=clip.width + X, src_height=clip.height + Y) merge = core.std.ShufflePlanes(clips=[Yplane, shift], planes=[0, 1, 2], colorfamily=vs.YUV) return merge |
3rd September 2021, 07:56 | #5 | Link | ||
Registered User
Join Date: Mar 2019
Posts: 8
|
Quote:
Quote:
|
||
|
|