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. |
![]() |
#4721 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 6,741
|
I get:
Code:
ry, ru, rv = core.std.SplitPlanes(rainbow) ValueError: too many values to unpack (expected 3)) Code:
from vapoursynth import core import vapoursynth as vs # requires: # * BiFrost: https://github.com/dubhater/vapoursynth-bifrost # * TemporalSoften: https://github.com/dubhater/vapoursynth-temporalsoften # I think this could be replaced by TemporalSoften2 https://github.com/dubhater/vapoursynth-temporalsoften2 # raidus = temporal radius # th = threshold def ChubbyRain2(clip: vs.VideoNode, th: int= 0, radius: int=3, show: bool=False, interlaced: bool=False): if interlaced: es = core.std.SeparateFields(clip=clip) else: res = clip y = core.std.ShufflePlanes(res, planes=0, colorfamily=vs.GRAY) u = core.std.ShufflePlanes(res, planes=1, colorfamily=vs.GRAY) v = core.std.ShufflePlanes(res, planes=2, colorfamily=vs.GRAY) uc = core.std.Convolution(u, [1,-2,1], mode = "v") vc = core.std.Convolution(v, [1,-2,1], mode = "v") ucc = core.std.Convolution(u, [1,2,1], planes=0, mode = "v") vcc = core.std.Convolution(v, [1,2,1], planes=0, mode = "v") cc = core.std.ShufflePlanes([y,ucc,vcc], planes=[0, 0, 0], colorfamily=vs.YUV) cc = core.bifrost.Bifrost(cc) cc = core.focus.TemporalSoften(cc, radius=radius,luma_threshold=0, chroma_threshold=255,scenechange=2 , mode=2) expr = "x y + " + str(th) + " > " + str(256 << (clip.format.bits_per_sample - 8)) + " 0 ?" rainbow = core.std.Expr([uc,vc],expr) rainbow = core.resize.Point(rainbow, res.width, res.height) ry, ru, rv = core.std.SplitPlanes(rainbow) ry = std.Maximum(ry) ru = core.std.BlankClip(ru, color=128 << (clip.format.bits_per_sample - 8)) rv = core.std.BlankClip(rv, color=128 << (clip.format.bits_per_sample - 8) ) rainbow = core.std.ShufflePlanes([ry,ru,rv], [0,0,0], vs.YUV) resfinal = core.std.MaskedMerge(res, cc, rainbow) if show: output = rainbow else: if interlaced: output = core.std.DoubleWeave(resfinal) output = core.std.SelectEvery(output, 2, 0) else: output = resfinal return output |
![]() |
![]() |
![]() |
#4722 | Link |
Registered User
Join Date: Sep 2008
Posts: 343
|
While I don't have a solution to your current issue, are you not missing the cnr2() function call? (http://avisynth.nl/index.php/Cnr2)
I doubt it would function the same without it?
__________________
(i have a tendency to drunk post) |
![]() |
![]() |
![]() |
#4723 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 6,741
|
@mastrboy: yes, you are right I missed the cnr2 call.
--- Okay, I see why the ValueError happens rainbow is Gray8 Code:
def ChubbyRain2(clip: vs.VideoNode, th: int=10, radius: int=3, show: bool=False, sft: int=10, interlaced: bool=False): if interlaced: res = core.std.SeparateFields(clip=clip) else: res = clip y = core.std.ShufflePlanes(res, planes=0, colorfamily=vs.GRAY) u = core.std.ShufflePlanes(res, planes=1, colorfamily=vs.GRAY) v = core.std.ShufflePlanes(res, planes=2, colorfamily=vs.GRAY) uc = core.std.Convolution(u, [1,-2,1], mode = "v") vc = core.std.Convolution(v, [1,-2,1], mode = "v") ucc = core.std.Convolution(u, [1,2,1], planes=0, mode = "v") vcc = core.std.Convolution(v, [1,2,1], planes=0, mode = "v") cc = core.std.ShufflePlanes([y,ucc,vcc], planes=[0, 0, 0], colorfamily=vs.YUV) cc = core.bifrost.Bifrost(cc) cc = core.cnr2.Cnr2(cc) cc = core.focus.TemporalSoften(cc, radius=radius, luma_threshold=0, chroma_threshold=sft, scenechange=2 , mode=2) #cc = core.focus2.TemporalSoften2(cc, radius=radius, luma_threshold=0, chroma_threshold=sft, scenechange=2 , mode=2) shift = (clip.format.bits_per_sample - 8) expr = "x y + " + str(th) + " > " + str(256 << shift) + " 0 ?" rainbowMask = core.std.Expr([uc,vc],expr) rainbowMask = core.resize.Point(rainbowMask, res.width, res.height) rainbowMask = core.std.Maximum(rainbowMask) resfinal = core.std.MaskedMerge(res, cc, rainbowMask) if show: output = rainbowMask else: if interlaced: output = core.std.DoubleWeave(resfinal) output = core.std.SelectEvery(output, 2, 0) else: output = resfinal return output
__________________
Hybrid here in the forum, homepage Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,.. Last edited by Selur; 26th June 2022 at 07:02. |
![]() |
![]() |
![]() |
#4724 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,701
|
es = core.std.SeparateFields(clip=clip) should be res = ...
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database || https://github.com/avisynth-repository |
![]() |
![]() |
![]() |
#4727 | Link | |
Registered User
Join Date: Dec 2020
Posts: 65
|
Quote:
__________________
CPU: AMD 3700X | GPU: RTX 3070Ti | RAM: 32GB 3200MHz Discord: @Julek#9391 || GitHub |
|
![]() |
![]() |
![]() |
#4728 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 6,741
|
Will try thanks.
![]()
__________________
Hybrid here in the forum, homepage Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,.. Last edited by Selur; 1st July 2022 at 22:02. |
![]() |
![]() |
![]() |
#4729 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,701
|
Will there be a binary for the R2 imwri release?
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database || https://github.com/avisynth-repository |
![]() |
![]() |
![]() |
#4730 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,491
|
Done. Forgot to check back for the artifacts to grab binaries.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
![]() |
![]() |
![]() |
#4731 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 6,741
|
Using BlankClip (http://www.vapoursynth.com/doc/funct...blankclip.html) there is a color parameter,
Code:
float[] color=<black> |
![]() |
![]() |
![]() |
#4732 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,491
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
![]() |
![]() |
![]() |
#4733 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 6,741
|
Okay,.. so the best way if I got a rgb(50,205,50) color coding would be to first create a RGB24 clip with my values and then use for example:
Code:
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, matrix_s="470bg", range_s="limited") |
![]() |
![]() |
![]() |
#4734 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,491
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
![]() |
![]() |
![]() |
#4736 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 6,741
|
Using:
PHP Code:
![]() that should not be there,... ![]() any idea where I go wrong? Did I do something wrong or this a bug in overlay or somewhere else? (it's not much of an issue for my use case here, but seem to be wrong) Cu Selur Ps.: In case it's helps, I got the source clip I used in my google drive. |
![]() |
![]() |
![]() |
#4737 | Link | |
Registered User
Join Date: Dec 2020
Posts: 65
|
Quote:
__________________
CPU: AMD 3700X | GPU: RTX 3070Ti | RAM: 32GB 3200MHz Discord: @Julek#9391 || GitHub |
|
![]() |
![]() |
![]() |
#4738 | Link |
Registered User
Join Date: Aug 2012
Posts: 198
|
That's an artifact from doing chroma subsampling, 4:2:0 (YUV420Px) has a 1/4 resolution for chroma and using a bicubic kernel (which use some negative lobe IIRC) generate that purple line (if you invert your green to [155,50,250] you will in fact generate a faint green line), if you use a kernel without negative lobes such a bilinear one you can avoid that kind of artifact, but introducing a strong chroma contrast line like that i a subsampled pic will always introduce some artifact, leave in in 444 subsampling (or RGB) and you will avoid that.
|
![]() |
![]() |
![]() |
Tags |
speed, vaporware, vapoursynth |
Thread Tools | Search this Thread |
Display Modes | |
|
|