View Full Version : HAvsFunc
HolyWu
29th November 2012, 19:49
https://github.com/HomeOfVapourSynthEvolution/havsfunc
Usage Example:
Firstly, put havsfunc.py to Python\Lib\site-packages.
from vapoursynth import core
import havsfunc as haf
clip = yourclip
clip = haf.QTGMC(clip, Preset='Medium', TFF=True)
kolak
30th November 2012, 00:54
What plugins are needed for QTGMC? It has to be massive list? Is it?
HolyWu
30th November 2012, 02:30
What plugins are needed for QTGMC? It has to be massive list? Is it?
The core plugins are MVTools2, MaskTools v2, RemoveGrain and TemporalSoften (https://github.com/dubhater/vapoursynth-temporalsoften), they must be loaded. Others depending on your settings. If you don't use them, they don't have to be loaded.
BTW, if encountering deadlock, try setting the number of threads to a bigger number, vs.Core(threads=x). But no guarantee it will always work. The perfeck solution is to wait for the fix of MVTools2.
kolak
30th November 2012, 02:38
Is it more stable than avisynthMT, specially for HD sources?
Revgen
30th November 2012, 02:44
QTGMC(clip, Preset='Medium', SubPel=2, TFF=True) constantly crashes VirtualDub for VapourSynth. Picture looks great though. I'll try to fiddle with it later.
kolak
30th November 2012, 02:55
For HD you can use very fast or even ultrafast. Can you share vs script ?
HolyWu
30th November 2012, 04:03
Can't say if more stable than avisynthMT or not. Maybe it depends on your available threads or settings. I only tried encoding a 1440x1080 1m30s video with Medium preset without crash or deadlock. If you want to avoid the deadlock caused by MCompensate, try setting SLMode to 1 or 3(spatial sharpness limiting) for the time being. Be aware that activating NoiseProcess with some combination of settings will invoke MCompensate too.
Chikuzen
30th November 2012, 06:51
you should use 'if foo is None:' instead of 'if foo == None:'.
see this.
http://jaredgrubb.blogspot.jp/2009/04/python-is-none-vs-none.html
HolyWu
30th November 2012, 12:32
you should use 'if foo is None:' instead of 'if foo == None:'.
see this.
http://jaredgrubb.blogspot.jp/2009/04/python-is-none-vs-none.html
Thanks for the tip. ;)
HolyWu
30th November 2012, 17:19
Updated r2. Worked around memory leak problem in Bob. The memory consumption of QTGMC should be much lesser now.
Revgen
30th November 2012, 22:17
Memory hogging is still going on for me. Vdub still crashes with the new version.
Is it possible to implement fmtconv instead of Bob() as an alternative for those who have crashing issues? fmtconv is slower, but perhaps it could be more stable.
Myrsloik
30th November 2012, 23:55
Updated r2. Worked around memory leak problem in Bob. The memory consumption of QTGMC should be much lesser now.
Uh, what is this memory leak problem in Bob? I know I did a quick and bad job of ripping it out of avisynth but it still shouldn't crash... that much.
HolyWu
1st December 2012, 02:42
Memory hogging is still going on for me. Vdub still crashes with the new version.
Is it possible to implement fmtconv instead of Bob() as an alternative for those who have crashing issues? fmtconv is slower, but perhaps it could be more stable.
Did VirtualDub crash as soon as you loaded your vpy script, or after you seek/jump to another frame? I tried a 1440x1080 video with only haf.QTGMC(clip, TFF=True) in the script and then previewd it in both AvsPmod and VirtualDub. No matter how I seek/jump to random frames, AvsPmod and VirtualDub are still there without crash. The memory usage of both are always around 1GB. Is there any other function used besides QTGMC in your vpy script?
Uh, what is this memory leak problem in Bob? I know I did a quick and bad job of ripping it out of avisynth but it still shouldn't crash... that much.
http://i.imgur.com/pC2BF.png
Revgen
1st December 2012, 03:14
I tried using fmtconv instead of BicubicResize for Bob(). Still crashes at the same place in the video. Strangely enough, fmtconv doesn't appear to be any slower than using BicubicResize. The crash occurs when the ram usage jumps from 1 gb to 1.5 gb in 2-3 secs in one particular spot in the video, then it crashes. I may have to upload the video itself help you solve the problem.
Here's the fmtconv method I tried.
def Bob(self, input, b, c, tff):
return self.core.std.Interleave([self.core.fmtc.bitdepth(self.core.fmtc.resample(self.core.std.SelectEvery(self.core.std.SeparateFields(input, tff), cycle=2, offsets=0), w=input.width, h=input.height,kernel='bicubic', a1=b, a2=c, sx=0, sy=0.25, sw=input.width, sh=input.height/2, fulls=0, fulld=0)bits=8,fulls=0,fulld=0),
self.core.fmtc.bitdepth(self.core.fmtc.resample(self.core.std.SelectEvery(self.core.std.SeparateFields(input, tff), cycle=2, offsets=1), w=input.width, h=input.height,kernel='bicubic', a1=b, a2=c, sx=0, sy=-0.25, sw=input.width, sh=input.height/2, fulls=0, fulld=0)bits=8,fulls=0,fulld=0)])
My script is.
import vapoursynth as vs
import sys
import havsfunc
core = vs.Core()
haf = havsfunc.HAvsFunc(core)
core.std.LoadPlugin(r'C:\Program Files\VapourSynth\filters\avisource.dll')
core.std.LoadPlugin(r'C:\Program Files\VapourSynth\fmtconv.dll')
core.std.LoadPlugin(r'C:\Program Files\VapourSynth\d2vsource_beta3_mingw.dll')
core.std.LoadPlugin(r'C:\Program Files\VapourSynth\nnedi3.dll')
core.std.LoadPlugin(r'C:\Program Files\VapourSynth\filters\eedi3.dll')
core.std.LoadPlugin(r'C:\Program Files\VapourSynth\filters\temporalsoften.dll')
core.avs.LoadPlugin('C:/Program Files/VapourSynth/avisynthfilters.dll')
core.avs.LoadPlugin(r'E:\QTGMC\AddGrainC.dll')
core.avs.LoadPlugin(r'E:\QTGMC\dfttest.dll')
core.avs.LoadPlugin(r'E:\QTGMC\EEDI2.dll')
core.avs.LoadPlugin(r'E:\QTGMC\FFT3DFilter.dll')
core.avs.LoadPlugin(r'E:\QTGMC\mvtools2.dll')
core.avs.LoadPlugin(r'E:\QTGMC\nnedi.dll')
core.avs.LoadPlugin(r'E:\QTGMC\nnedi2.dll')
core.avs.LoadPlugin(r'E:\QTGMC\RemoveGrainSSE2.dll')
core.avs.LoadPlugin(r'E:\QTGMC\RepairSSE2.dll')
core.avs.LoadPlugin(r'E:\QTGMC\TDeint.dll')
core.avs.LoadPlugin(r'E:\QTGMC\VerticalCleanerSSE2.dll')
core.avs.LoadPlugin(r'E:\QTGMC\mt_masktools-25.dll')
vid = core.avisource.AVISource(r'E:\test6.avi')
vid = haf.QTGMC(vid,Preset='Medium',SubPel=2, TFF=True)
last = vid
Revgen
2nd December 2012, 03:17
Here's my source. It's a lossless H264 MKV file.
http://depositfiles.com/files/brzkx20yo
HolyWu
2nd December 2012, 17:09
No, I can't reproduce crash in VirtualDub here, no matter by seeking to random frames or using "Run video analysis pass" under File menu. In your script you used AVISource to load avi file, but the file you provided is mkv, hence I used ffms2 to load it. I don't know whether this difference matters. Did you ever try vid.output(file) way to see if it crashes?
BTW, updated r3. Added DeHalo_alpha, YAHR, HQDering and FastLineDarkenMOD.
Revgen
2nd December 2012, 19:00
I used avisource on the huffyuv file. I encoded it to lossless h264 in order to decrease filesize for upload. Both files crash for me.
Looks like it's a problem on my end.
kolak
3rd December 2012, 18:38
On my laptop anything different than ultra fast does not work at all. Which plugins are the best to use with vs- I use Vit's modified version (but not the one for avisynth 2.6).
matfra
3rd December 2012, 20:24
Can you post a picture to show what the output for this script plese. Im curious
kolak
3rd December 2012, 21:23
What do you mean?
It looks the same as from avisynth version.
HolyWu
4th December 2012, 02:40
On my laptop anything different than ultra fast does not work at all. Which plugins are the best to use with vs- I use Vit's modified version (but not the one for avisynth 2.6).
What exactly "does not work" means? Do you mean the output frame is the same as if QTGMC had no effect? Or is there any error message? If so, you should post it as well. The plugins I use mostly are the official ones, except nnedi3 and eedi3 are native VapourSynth plugin. I didn't use Vit's modified version, so no idea if it works with VapourSynth.
EDIT: Did you try replacing this new vsvfw.dll (http://forum.doom9.org/showthread.php?p=1601856#post1601856)? Though it maybe have nothing to do with your problem.
If in doubt, just try encoding a small range of your video and see whether the encoding could finish, and whether the frames of the encoded file has problems or not.
kolak
4th December 2012, 02:57
No- Vdub shows first frame and than does nothing- CPU stays at 0. I can't jump into any frame etc- just hangs.
I will try unmodified version, see if it changes anything. Looks like ultrafast uses different plugins than all others.
Revgen
9th December 2012, 00:54
I found out how to increase WinXP's memory limit to 3GB. That helps to make the process to go longer, but it still crashes after using over 2.2 GB of memory. How much memory does QTGMC need anyway?
Also I tried to use Vapoursynth's set_max_cache_size() but couldn't figure out how to use it. So then I tried using vs.Core(threads=2) to see if it would use less memory instead of utilizing all 4 CPU cores. The program hangs and doesn't do anything. Ditto with threads=1. The lowest I can go is threads=3, and even that reaches to 2.2gb and crashes. I tried the vsvfw.dll too. No luck.
I tried Vdub, x264, and FFPlay. Same results on all.
I'm wondering if I have a bad version of a plugin. Is there a way to monitor which plugin is utlizing the most memory?
Myrsloik
9th December 2012, 02:29
I found out how to increase WinXP's memory limit to 3GB. That helps to make the process to go longer, but it still crashes after using over 2.2 GB of memory. How much memory does QTGMC need anyway?
Also I tried to use Vapoursynth's set_max_cache_size() but couldn't figure out how to use it. So then I tried using vs.Core(threads=2) to see if it would use less memory instead of utilizing all 4 CPU cores. The program hangs and doesn't do anything. Ditto with threads=1. The lowest I can go is threads=3, and even that reaches to 2.2gb and crashes. I tried the vsvfw.dll too. No luck.
I tried Vdub, x264, and FFPlay. Same results on all.
I'm wondering if I have a bad version of a plugin. Is there a way to monitor which plugin is utlizing the most memory?
There's a bug in vs that makes the memory limit 1024 times bigger than it should be meaning that the default max is 1TB. As a temporary workaround try setting the max cache size to 1. Will be fixed in the next release which should be out sometime next week.
Revgen
9th December 2012, 03:15
I haven't been able to figure out how to do set_max_cache_size().
If I do it this way
import vapoursynth as vs
import sys
import havsfunc
core = vs.Core().set_max_cache_size(1)
haf = havsfunc.HAvsFunc(core)
#plugins#
I get a "avisynth open failure; Python exception. 'int' object has no attribute 'avs'" error.
I'm not sure exactly where it's supposed to go.
I guess I'll wait until next week for the new release.
Are_
9th December 2012, 03:34
core = vs.Core()
core.set_max_cache_size(1)
Revgen
9th December 2012, 05:10
Thanks Are. No error messages this time, but it's still exhibiting the same behavior. Looks like I'll just have to wait til the next release to see if the situation improves.
Myrsloik
14th January 2013, 14:32
The download link is broken. If you have trouble finding reliable hosting I can put a copy of the scripts on my website.
HolyWu
14th January 2013, 15:24
Updated r4.
Added 'dct' argument to SMDegrain to set the equivalent argument of MAnalyse.
Added FFT3dGPU to QTGMC as another Denoiser to NoiseProcess. Since FFT3dGPU doesn't support bt=5, the maximum of NoiseTR is restricted to 1.
Renamed 'DftThreads' of QTGMC to 'DenoiseThreads'. The threads of FFT3DFilter is not set in the original version. Now 'DenoiseThreads' sets the threads of both dfttest and FFT3DFilter.
Added nnedi3_rpow2 function.
Replaced HQDering function with HQDering mod(only 8-bit processing).
Added ivtc_txt60mc function.
Added InterFrame function.
Replaced some filters with the native VapourSynth plugins if possible.
Minor bug fixes.
For ivtc_txt60mc there is a problem. MFlowInter seems to have problem running in VapourSynth when pel=2. So you have to set draft=True in ivtc_txt60mc to let it use pel=1 right now.
For InterFrame there is a bigger problem. It's a pity that SVPflow runs about 10x slower in VapourSynth than it runs in AviSynth. Mostly because of the "Avisynth Compat: requested frame XXX not prefetched, using slow method that may deadlock" issue I guess.
The download link is broken. If you have trouble finding reliable hosting I can put a copy of the scripts on my website.
Ah...I was just about to update the new version so I deleted the old file. :D
Myrsloik
14th January 2013, 15:27
I'll have a look at the svpflow stuff later. I think I simply needed to add it properly to the avisynth prefetch lists.
kolak
14th January 2013, 16:25
Updated r4.
For InterFrame there is a bigger problem. It's a pity that SVPflow runs about 10x slower in VapourSynth than it runs in AviSynth. Mostly because of the "Avisynth Compat: requested frame XXX not prefetched, using slow method that may deadlock" issue I guess.
Yep- runs way slower than avs and uses almost 1 core only resources.
Chikuzen
14th January 2013, 16:48
on nnedi3_rpow2, you should use only std.Transpose() instead of your TurnLeft/Right functions. FlipHorizontal and FlipVertical are useless in this case.
yexpr = 'x 128 - y 128 - * 0 < 128 x 128 - abs y 128 - abs < x y ? ?'
I suspect that Lut2 is faster than Expr in the case of such a complicated expression.
and, since warpsharp package is not compatible with VS, you can't use UnsharpMask().
Myrsloik
15th January 2013, 04:35
The warpsharp package has been fixed since Chikuzen pointed it out and will work in r19 when that's done.
That's one confusing expression. What does it look like in readable form anyway?
Are_
15th January 2013, 04:53
That's one confusing expression. What does it look like in readable form anyway?
(((x-128)*(y-128))<0) ? 128 : ((abs(x-128)<abs(y-128)) ? x : y)
Chikuzen
15th January 2013, 10:49
a benchmark result
import vapoursynth as vs
import sys
def expr(x, y):
if (x - 128) * (y - 128) < 0: return 128
if abs(x - 128) < abs(y - 128): return x
return y
def get_lut():
lut = []
for y in range(256):
for x in range(256):
lut.append(expr(x, y))
return lut
core = vs.Core(threads=1)
core.std.LoadPlugin('vsrawsource.dll')
c0 = core.raws.Source('720p50_mobcal.y4m')
c0 = core.std.Loop(core.std.ShufflePlanes(c0, 0, vs.GRAY), 4) #2016(504x4) frames
c1 = core.raws.Source('720p50_parkrun.y4m')
c1 = core.std.Loop(core.std.ShufflePlanes(c1, 0, vs.GRAY), 4) #2016(504x4) frames
clip = core.std.Expr([c0, c1], ['x 128 - y 128 - * 0 < 128 x 128 - abs y 128 - abs < x y ? ?'])
#clip = core.std.Lut2([c0, c1], get_lut(), planes=0)
clip.output(sys.stdout)
-------------------------------------------------------------
$ for i in {1..3}; do time python3 benchmarch.py > /dev/null; done
std.Expr std.Lut2
1st 0m22.792s 0m17.316s
2nd 0m22.782s 0m16.963s
3rd 0m22.791s 0m17.004s
HolyWu
16th January 2013, 14:02
The most complicated expression in the script is probably the one used by LSFmod's Smode=5.
'x y = x x x y - abs 16 / log 1 4 / * exp 16 * 0.75 * x y - dup abs / * x y - dup * 16 dup * 4 + * x y - dup * 4 + 16 dup * * / * 1 48 0 = 0 16 48 / dup * dup * ? + 1 48 0 = 0 x y - abs 48 / dup * dup * ? + / * + ?'
# Infix notation: (x==y) ? x : (x+(((((((abs(x-y)/16)^(1/4))*16)*0.75)*((x-y)/abs(x-y)))*((((x-y)^2)*((16^2)+4))/((((x-y)^2)+4)*(16^2))))*((1+((48==0) ? 0 : ((16/48)^4)))/(1+((48==0) ? 0 : ((abs(x-y)/48)^4))))))
Then the difference is much significant. :sly:
import vapoursynth as vs
import sys
def get_lut():
lut = []
for y in range(256):
for x in range(256):
if x==y:
lut.append(x)
else:
lut.append(max(min(round(x+(((((((abs(x-y)/16)**(1/4))*16)*0.75)*((x-y)/abs(x-y)))*((((x-y)**2)*((16**2)+4))/((((x-y)**2)+4)*(16**2))))*((1+(0 if 48==0 else (16/48)**4))/(1+(0 if 48==0 else (abs(x-y)/48)**4))))), 255), 0))
return lut
core = vs.Core()
core.avs.LoadPlugin(r'C:\Program Files (x86)\AviSynth 2.5\plugins\DGDecodeNV.dll')
core.std.LoadPlugin(r'C:\Program Files (x86)\VapourSynth\filters\genericfilters.dll')
clip = core.std.Trim(core.avs.DGSource(r'a 1080p24 video.dgi'), 0, 4999)
blur = core.generic.Blur(clip, planes=0)
clip = core.std.Expr([clip, blur], ['x y = x x x y - abs 16 / log 1 4 / * exp 16 * 0.75 * x y - dup abs / * x y - dup * 16 dup * 4 + * x y - dup * 4 + 16 dup * * / * 1 48 0 = 0 16 48 / dup * dup * ? + 1 48 0 = 0 x y - abs 48 / dup * dup * ? + / * + ?', ''])
#clip = core.std.Lut2([clip, blur], lut=get_lut(), planes=0)
clip.output(sys.stdout)
-------------------------------------------------------------
$ time python test.vpy > /dev/null
std.Expr std.Lut2
10m10.820s 1m49.963s
Myrsloik
16th January 2013, 14:21
I suspect you can speed it up a bit. Not that it really matters when a lut is so much faster...
For example "16 dup *" is a constant expression and there are several more constants recalculated every time. You can also rewrite X ^ (1/4) as sqrt(sqrt(X)) which probably is a lot faster than using exp and log.
Chikuzen
16th January 2013, 14:46
'x y = x x x y - abs 16 / log 1 4 / * exp 16 * 0.75 * x y - dup abs / * x y - dup * 16 dup * 4 + * x y - dup * 4 + 16 dup * * / * 1 48 0 = 0 16 48 / dup * dup * ? + 1 48 0 = 0 x y - abs 48 / dup * dup * ? + / * + ?'
# Infix notation: (x==y) ? x : (x+(((((((abs(x-y)/16)^(1/4))*16)*0.75)*((x-y)/abs(x-y)))*((((x-y)^2)*((16^2)+4))/((((x-y)^2)+4)*(16^2))))*((1+((48==0) ? 0 : ((16/48)^4)))/(1+((48==0) ? 0 : ((abs(x-y)/48)^4))))))
is this expression really working ?
also, "... (1+((48==0)) ? 0 : ((16/48))^4)"
why you don't write just "1.012346"
HolyWu
16th January 2013, 14:59
In the original expression some constants are parameters, and are replaced with the function's argument values, for example (1/4) is one of it, so can't simply using sqrt(sqrt(X)) if someone specified (1/3) or so. I replaced all parameters with the default values for convenience here. That's why you wonder why I don't write values which could be calculated beforehand like (1+((48==0) ? 0 : ((16/48)^4))).
Chikuzen
16th January 2013, 18:25
another benchmark (Since HolyWu's script did not work on my box, I rewrote it by myself. )
import vapoursynth as vs
import sys
core = vs.Core(threads=1)
core.std.LoadPlugin('vsrawsource.dll')
core.std.LoadPlugin('genericfilters.dll')
def func(x, y, strength, szrp, spwr, sdmplo, sdmphi):
if x == y:
return x
diff = x - y
diff2 = diff * diff
tmp0 = ((abs(diff)/szrp)**(1 / szrp))*szrp*strength * (diff/abs(diff))
tmp1 = szrp ** 2 + sdmplo
tmp2 = szrp ** 2
tmp3 = 1 + ((szrp/sdmphi) ** 4 if (sdmphi != 0) else 0)
tmp4 = 1 + (abs(diff)/sdmphi ** 4 if (sdmphi != 0) else 0)
tmp3 /= tmp4
ret = x + tmp0 * ((diff2 * tmp1) / ((diff2 + sdmplo) * tmp2)) * tmp3
return min(255, max(0, int(round(ret))))
def get_lut(strength, szrp, spwr, sdmplo, sdmphi):
lut = []
for y in range(256):
for x in range(256):
lut.append(func(x, y, strength, szrp, spwr, sdmplo, sdmphi))
return lut
c0 = core.raws.Source('720p50_mobcal.y4m')
c0 = core.std.ShufflePlanes(c0, 0, vs.GRAY)
c1 = core.generic.Blur(c0)
strength, szrp, spwr, sdmplo, sdmphi = 0.75, 16, 4, 4, 0
expr = ('x y = x x x y - abs {Szrp} / log 1 {Spwr} / * exp {Szrp} * {Str} * x y - '
'dup abs / * x y - dup * {Szrp} dup * {SdmpLo} + * x y - dup * {SdmpLo} + '
'{Szrp} dup * * / * 1 {SdmpHi} 0 = 0 {Szrp} {SdmpHi} / dup * dup * ? + 1 '
'{SdmpHi} 0 = 0 x y - abs {SdmpHi} / dup * dup * ? + / * + ?')
expr = expr.format(Szrp=szrp, Spwr=spwr, Str=strength, SdmpLo=sdmplo, SdmpHi=sdmphi)
clip = core.std.Expr([c0, c1], [expr])
#clip = core.std.Lut2([c0, c1], get_lut(strength, szrp, spwr, sdmplo, sdmphi), planes=0)
clip.output(sys.stdout)
the result is
std.Expr 0m20.436s
std.Lut2 0m06.396s
Why was a different result brought?
Probably, HolyWo would use anime as a sample.
Since x and y become equal in many cases in the case of anime, almost part of expression does not evaluate and finishes with the head of them(if x == y then return x).
aegisofrime
27th October 2013, 06:36
Hi,
Due to the changes in VS r21, Will it be a difficult process rewriting HAvsFunc to use the new native RemoveGrain plugin instead of the Avisynth one?
HolyWu
27th October 2013, 06:50
Not that difficult. Already working on it. Maybe release today or tomorrow.
HolyWu
29th October 2013, 10:08
Updated r5.
Added the following functions: ediaa, daa, maa, SharpAAMCmod, Deblock_QED, Vinverse, LUTDeCrawl, LUTDeRainbow.
Added a simple wrapper Resize over fmtc.resample + fmtc.bitdepth, including a ringing-cancellation algorithm from Dither_resize16nr.
Added GammaToLinear and LinearToGamma function. The same as Dither_y_gamma_to_linear and Dither_y_linear_to_gamma, but some parameters name and default values are changed.
HQDering mod updated to v1.4. stack16 input/output is supported.
SMDegrain's Motion Vectors Globals Input/Output is supported.
LSFmod's Smode 1&2 are deleted. Smode 3~5 becomes 1~3 now.
Added 'noring' parameter to maa, SharpAAMCmod, Dehalo_alpha and LSFmod to indicate that a non-ringing algorithm must be used in case of supersampling.
Replaced RemoveGrain/Repair with the native plugin.
It's no need to pass in the core instance anymore.
Some bug fixes, optimizations and cosmetic changes.
EDIT: Fixed a very minor issue. Please redownload if you have downloaded hours ago.
HolyWu
30th October 2013, 13:36
Updated r6.
A quick bug fix release. I missed the 'planes' parameter in GammaToLinear/LinearToGamma and it mistakenly only processed the first(Y or R) plane. By the way I also add restriction on bitdepth to only allow 16-bit input clip in GammaToLinear/LinearToGamma.
Mystery Keeper
17th February 2014, 17:08
Couldn't get Deblock_QED to work. It uses mt_lutspa, but when I try to load mt_masktools-26.dll VS says it has no entry point.
Myrsloik
17th February 2014, 17:12
Couldn't get Deblock_QED to work. It uses mt_lutspa, but when I try to load mt_masktools-26.dll VS says it has no entry point.
Only 2.5 plugins supported for now. 2.6 won't happen until avisynth+ makes a sane 64bit api most likely.
Mystery Keeper
17th February 2014, 17:59
Thank you. Figured it out, got it to work.
Mystery Keeper
2nd July 2014, 20:55
Using Deblock_QED crashes my script if I seek far forward. Crash happens in mt_masktools-25.dll. Can these functions be made to not rely on it?
Reel.Deel
3rd July 2014, 17:49
Using Deblock_QED crashes my script if I seek far forward. Crash happens in mt_masktools-25.dll. Can these functions be made to not rely on it?
I don't think so, but it's been a while since I've used VS so if I remember correctly there is no native mt_lutspa equivalent.
Mystery Keeper
3rd July 2014, 21:56
mt_lutspa replacement from Myrsloik himself. (http://pastebin.com/ZQRchkkq)
Reel.Deel
3rd July 2014, 22:54
Hmmm, I guess I must of missed that... I guess now the only Avisynth plugin required is DCTFilter?... Cool beans
Mystery Keeper
3rd July 2014, 23:50
Also Deblock. But I tried to replace lutspa with those functions, and it spawns threads like crazy. Right now VirtualDub is running 1581 thread and hanging. My own WIP editor dies quickly after spawning ~700.
Reel.Deel
3rd July 2014, 23:54
Also Deblock.
Of course http://www.smileyvault.com/albums/basic/smileyvault-slaphead.gif (http://www.smileyvault.com/) (how did I forget that?)
HolyWu
4th July 2014, 05:01
Also Deblock. But I tried to replace lutspa with those functions, and it spawns threads like crazy. Right now VirtualDub is running 1581 thread and hanging. My own WIP editor dies quickly after spawning ~700.
Try havsfunc-r7.7z (https://www.mediafire.com/?ynk5rizd26voxf7) and see if it works for you. I didn't give it a heavy test though.
Added the following function: GrainStabilizeMC.
Changed the way to generate block clip instead of using mt_lutspa, which is used in Deblock_QED.
HQDering mod updated to v1.8.
Added sigmoid curves to GammaToLinear/LinearToGamma.
LSFmod's Smode 2 is deleted. Now Smode=1 is Range sharpening, Smode=2 is Nonlinear sharpening (corrected version).
Optimized the way to build LUT of Smode=2 in LSFmod. In previous version std.Expr is used for >8-bit clip and the speed is very slow. Now std.Lut is used for 8~16-bit clip.
Replaced MakeDiff/AddDiff with internal function std.MakeDiff/std.MergeDiff instead of using std.Expr.
Mystery Keeper
4th July 2014, 10:02
Works, but the same way as with mt_lutspa. If I seek all the way to the last frame - I crash. But now I did get an error. "Seek pattern broke d2vsource." -_-
But it does work, so thank you again.
HolyWu
16th August 2014, 15:21
Updated r8.
Changed Deblock_QED to use native plugins. That's it.
Mystery Keeper
16th August 2014, 19:39
Thank you!
YamashitaRen
24th August 2014, 12:29
Thank you!
As a linux user, I greatly appreciate these steps toward a fully native vapoursynth :)
HolyWu
26th August 2014, 14:27
Updated r9.
Added GrainFactory3 function. The default of g?str is adjusted to a saner value as the default in the original is way too overkill. Besides, g?tex parameter is removed.
HolyWu
23rd September 2014, 16:22
Updated r10.
Changed QTGMC and some other functions to use native filters of MVTools.
Mystery Keeper
23rd September 2014, 16:39
Cool! Is it completely native now I thought there were some functions unported yet.
HolyWu
23rd September 2014, 16:51
Of course not. Only filters that listed at https://github.com/dubhater/vapoursynth-mvtools/blob/v1.1/readme.rst get changed.
Mystery Keeper
24th September 2014, 10:30
Can you please give a link for r9 too? So far VS MVTools is buggy, and QTGMC crashes even though I'm not using DCT.
HolyWu
24th September 2014, 13:48
No problem. First post is updated. It may be helpful to let jackoneill know what preset or arguments you specified to make it crash. I just let it run on a 1920x1080 clip about 10000 frames with all default values and don't encounter crash. The average speed is roughly at 5.0 fps.
lansing
25th September 2014, 03:10
I tried the new version with native mvtools added, on my 720x480 video, qtgmc(preset="medium"),
vapoursynth 32bit: 94fps
vapoursynth 64bit: 94fps
avisynth mt mvtools: 125fps
Updated the result for Vapoursynth 64 bit version, kind of disappointed. I was expecting it to be much faster.
HolyWu
10th October 2014, 08:48
Updated r11.
The mvtools-related filters used in QTGMC and ivtc_txt60mc are all native now.
Because QTGMC's SVThin and Lossless modes require rgvs.VerticalCleaner, I also include RemoveGrainVS.dll in the archive so you don't have to wait for the next release of VapourSynth.
Myrsloik
4th November 2014, 09:13
Why do we have to do?
import havsfunc
...
haf = havsfunc.HAvsFunc()
...
clip = haf.QTGMC(clip, Preset='Medium', TFF=True)
Wouldn't it make more sense to remove the HAvsFunc class that effectively does nothing so we can do:
import havsfunc as haf
...
clip = haf.QTGMC(clip, Preset='Medium', TFF=True)
HolyWu
4th November 2014, 15:23
You are right. The class was used to let users pass the core instance to the module before VapourSynth R19. Since the core now uses a singleton pattern, the class becomes redundant. I just didn't think of doing the modifications though...
HolyWu
25th December 2014, 17:30
Update r12.
The class is ditched so you can reduce one line in your script.
Add function Vinverse2.
Delete function InterFrame.
DeHalo_alpha: Remove the color family restriction of input clip.
HQDeringmod: Remove the color family restriction of input clip. Remove dering kernel 'dfttest' and related parameters. Remove stack16 related parameters.
QTGMC: Remove EdiMode 'nnedi2', 'nnedi', 'eedi2' and 'tdeint'.
Vinverse: Remove the color family restriction of input clip.
GSMC: Use native filters of MVTools. Remove lsb parameter.
SMDegrain: Use native filters of MVTools. Remove stack16 related parameters. Change prefilter=3 to MinBlur(3).
FastLineDarkenMOD: Remove the color family restriction of input clip.
LSFmod: Remove the color family restriction of input clip. Change the type of parameter 'preblur' from string to bool.
jackoneill
25th December 2014, 19:58
Is your vinverse different from the one in the VapourSynth source tree?
Reel.Deel
25th December 2014, 20:36
Vinverse2 is a modified version of Vinverse used as a helper this dot crawl removal script. (http://forum.doom9.org/showpost.php?p=1584186&postcount=62) tp7 also included a fast implementation in his Vinverse plugin. (https://github.com/tp7/vinverse)
Edit: oops, I completely misunderstood jackoneill's question. I honestly thought he asked about vinverse2. The eggnog must of been a little stronger this year ;)
feisty2
26th December 2014, 05:10
edit: okay, it's wrong, just tried and the result is completely different from mdegrain
I thought something from here (http://forum.doom9.org/showthread.php?t=156770&highlight=mdegrain9) could be useful
any luck with mcompensate + templinearappoximate to imitate "mdegrain (lsb=true)" ?
HolyWu
26th December 2014, 15:13
Is your vinverse different from the one in the VapourSynth source tree?
I think the only difference is high bitdepth support.
MonoS
28th December 2014, 22:16
I've also ported a avs script to vs, if you want you can add it to your collection [so that as much script will be available in only one place].
The original script is here http://recensubshq.forumfree.it/?t=64839203
The code is here: https://github.com/MonoS/VS-MaskDetail
The thread is here: http://forum.doom9.org/showthread.php?t=171546
lansing
17th January 2015, 01:33
Hi, I'm getting an error while using deblock_qed.
No attribute with the name dct exists. Did you mistype a plugin namespace
ret = haf.Deblock_QED(ret, quant1=40, quant2=24)
I'm using the latest Vapousynth, mvtools and deblock plugin.
Are_
17th January 2015, 01:50
dctfilter (http://forum.doom9.org/showthread.php?t=171039)
Next time you can search for the missing dll here (http://www.vapoursynth.com/doc/pluginlist.html).
lansing
17th January 2015, 02:00
thanks, it works now
Mystery Keeper
31st January 2015, 13:02
MVTools now support up to 16 bits and other formats. Functions need to be fixed to add that support too.
HolyWu
2nd February 2015, 16:44
Update r13.
Remove the format restriction of the following functions: QTGMC, GSMC, SMDegrain.
SMDegrain: Use sbr for prefilter instead of MinBlur.
zerowalker
4th February 2015, 06:54
SMDegrain acts a bit different compared to the Avisynth version on the same settings.
Is there some Default settings that are different?
SMDegrain(tr=2,thSAD=500,search=3)
That's what i tested and compared with.
HolyWu
4th February 2015, 16:27
SMDegrain acts a bit different compared to the Avisynth version on the same settings.
Is there some Default settings that are different?
Nope. The only big difference should be the prefilter setting which has been changed to use sbr for prefiltering. The others should be quite the same.
Test the core mvtools part first on your own to check whether the issue comes from mvtools itself. Here are equivalent settings for AVS and VS respectively.
super = MSuper(rfilter=4)
bv2 = MAnalyse(super, isb=true, delta=2, overlap=4, search=3, truemotion=false)
bv1 = MAnalyse(super, isb=true, delta=1, overlap=4, search=3, truemotion=false)
fv1 = MAnalyse(super, isb=false, delta=1, overlap=4, search=3, truemotion=false)
fv2 = MAnalyse(super, isb=false, delta=2, overlap=4, search=3, truemotion=false)
output = MDegrain2(super, bv1, fv1, bv2, fv2, thSAD=500, thSADC=250)
super = core.mv.Super(clip, rfilter=4)
bv2 = core.mv.Analyse(super, isb=True, delta=2, overlap=4, search=3, truemotion=False)
bv1 = core.mv.Analyse(super, isb=True, delta=1, overlap=4, search=3, truemotion=False)
fv1 = core.mv.Analyse(super, isb=False, delta=1, overlap=4, search=3, truemotion=False)
fv2 = core.mv.Analyse(super, isb=False, delta=2, overlap=4, search=3, truemotion=False)
output = core.mv.Degrain2(clip, super, bv1, fv1, bv2, fv2, thsad=500, thsadc=250)
zerowalker
4th February 2015, 22:00
Tested, it looks a bit different.
It's like the image is pushed up 1 line in some places VapourSynth (in a stretched way).
Does yours look identical?
zerowalker
13th February 2015, 12:55
So what am i supposed to do?
They looked different, is it supposed to, i mean it doesn't use the prefilter as far as i can tell, if rfilter isn't that of course? (isn't Prefilter when you add an already filtered imaged and use it as some kind of layer or something).
Reel.Deel
13th February 2015, 13:20
(isn't Prefilter when you add an already filtered imaged and use it as some kind of layer or something).
A prefiltered clip is usually used in order to try to get better motion analysis; gather motion vectors from the prefiltered clip and then use those vectors on the original clip.
feisty2
13th February 2015, 13:53
prefilter is a special filter used only on vector search clip
when you do the motion compensation (mv.compensate/degrain/...), vectors are required to move blocks from predicted frames to the current reference frame
the point is, you don't have to get vectors from the clip you are performing compensation
like, you can get vectors from a spatial denoised version of the source clip so you can reduce the local SAD value
that's pretty much it
zerowalker
13th February 2015, 17:53
So how come my results look different between them if i don't use a prefiltered source to do the vector thing?
I am missing something here, shouldn't they be identical?
jackoneill
13th February 2015, 18:55
So how come my results look different between them if i don't use a prefiltered source to do the vector thing?
I am missing something here, shouldn't they be identical?
Not 100% identical, no. There are some very small differences in the output of Super, which I haven't bothered to investigate. The small differences in Super propagate to every other filter in MVTools. However, I don't think these particular differences are visible in the output of Degrain, so it must be something else. Please show some screenshots (original image, filtered with Avisynth MVTools, filtered with VapourSynth MVTools). Maybe we should take this to the MVTools thread (http://forum.doom9.org/showthread.php?t=171207&page=6).
Tarutaru
26th February 2015, 14:38
Hi, QTGMC won't start and throw this error
$ vspipe Untitled.vpy -
Segmentation fault (core dumped)
and I got this in dmesg
traps: vspipe[17476] general protection ip:7f1b98e4d6cd sp:7f1b8e384c30 error:0 in libgenericfilters.so[7f1b98e48000+10000]
Is there something wrong with the genericfilters or some other problem? Thanks!
(OS - Linuxmint 17.1 x64)
Script -
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
core.std.LoadPlugin('/usr/lib/x86_64-linux-gnu/libffms2.so.3')
ret = core.ffms2.Source(source='foo.bar')
ret = haf.QTGMC(ret, Preset='Medium', TFF=True)
ret.set_output()
Tarutaru
26th February 2015, 15:04
Solved by using Myrsloik's fork.
Thanks!!
Hi, QTGMC won't start and throw this error
and I got this in dmesg
Is there something wrong with the genericfilters or some other problem? Thanks!
(OS - Linuxmint 17.1 x64)
Script -
HolyWu
15th March 2015, 17:16
Update r14.
Add functions SigmoidInverse and SigmoidDirect from Dither package.
Remove the bitdepth restriction of ediaa function.
For functions that use mvtools, now internally apply DitherLumaRebuild to the clip when it's being fed to 'mv.Super' (for the final 'mv.Analyse' only). s0=1 is always used.
QTGMC: Use native filter of FFT3DFilter for noise processing if selected.
HolyWu
20th March 2015, 07:40
Update r15.
HQDeringmod: When invoking generic.Sobel, mthr was not properly scaled with the bitdepth of input clip.
QTGMC: When invoking TemporalSoften, thresholds and scenechange were not properly scaled with the bitdepth of input clip.
Pat357
21st March 2015, 00:14
Update r15.
HQDeringmod: When invoking generic.Sobel, mthr was not properly scaled with the bitdepth of input clip.
QTGMC: When invoking TemporalSoften, thresholds and scenechange were not properly scaled with the bitdepth of input clip.
Would you consider adding MCBob to HAvsFunc ?
Info & code about MCBob : http://avisynth.nl/index.php/MCBob .
For me the script is really to complicated to rewrite it myself ; otherwise I would have done it already.
Thanks !
HolyWu
21st March 2015, 04:34
Would you consider adding MCBob to HAvsFunc ?
Info & code about MCBob : http://avisynth.nl/index.php/MCBob .
For me the script is really to complicated to rewrite it myself ; otherwise I would have done it already.
Thanks !
I don't know, probably no. Isn't MCBob superseded by TempGaussMC which is considered to be more stable?
HolyWu
29th March 2015, 06:07
Update r16.
Add functions logoNR and SmoothLevels.
maa: Use native filter of SangNomMod. Expose 'aa' and 'aac' parameters.
SharpAAMCmod: Use native filter of SangNomMod if selected.
ivtc_txt60mc: Fix misusing of DitherLumaRebuild.
SMDegrain: Update to v3.0d.
Cosmetic changes.
MonoS
2nd April 2015, 18:59
I think there's a little bug into QTGMC.
When using InputType 2-3 at line 1013 got passed to mv.Mask a 16bit clip, but the plugin require a 8bit clip
Solved dithering srchClip like so [i mostly use 16bit QTGMC so i'm fine with this change]
inputTypeBlend = core.fmtc.bitdepth(core.mv.Mask(core.fmtc.bitdepth(srchClip, bits=8), bVec1, kind=1, ml=ProgSADMask), bits=16)
There's another instance in the code of mv.Mask, but wasn't triggered by my script
HolyWu
3rd April 2015, 03:18
It looks like jackoneill forgot to update mv.Mask to support 16 bits as well. :D
jeremy33
14th May 2015, 14:19
Hello,
I try to use LSFMod but I have this error "Erreur de segmentation" (Segfault)
If I try clip = haf.QTGMC(clip, Preset='Medium', TFF=True) I have this error "Exception en point flottant" (Floating point exception)
What's the problem ?
Thank you
What license is HAvsFunc?
HolyWu
14th May 2015, 16:32
Hello,
I try to use LSFMod but I have this error "Erreur de segmentation" (Segfault)
If I try clip = haf.QTGMC(clip, Preset='Medium', TFF=True) I have this error "Exception en point flottant" (Floating point exception)
What's the problem ?
Thank you
Sorry, I can't reproduce it on both 32 and 64 bits. What version of Python and VapourSynth did you install? Did you use vspipe to test your script? Normally you should get a traceback pointing out the code at which line caused the exception.
What license is HAvsFunc?
No license, just like most of the AVS scripts.
jeremy33
14th May 2015, 17:32
Sorry, I can't reproduce it on both 32 and 64 bits. What version of Python and VapourSynth did you install? Did you use vspipe to test your script? Normally you should get a traceback pointing out the code at which line caused the exception.
I'm on Netrunner 14 x64 (Ubuntu 14.04 derivative) and I use Python 3.4.0 and VapourSynth 27.
I use MPV, I also tried with Vspipe, and I only have this error with LSFMod : Segfault
HolyWu
14th May 2015, 17:50
I'm on Netrunner 14 x64 (Ubuntu 14.04 derivative) and I use Python 3.4.0 and VapourSynth 27.
I use MPV, I also tried with Vspipe, and I only have this error with LSFMod : Segfault
I fear I can't help you with so few information. Can your script output successfully with only
clip = core.std.MakeDiff(clip, core.rgvs.RemoveGrain(clip, 11))
or
clip = core.generic.Minimum(clip)
?
jeremy33
14th May 2015, 18:04
This works :
clip = core.std.MakeDiff(clip, core.rgvs.RemoveGrain(clip, 11))
But this give me a segfault :
clip = core.generic.Minimum(clip)
If you need more infos ask me what to try ;)
What license is HAvsFunc?
No license, just like most of the AVS scripts.
No license = public domain?
Sorry for that question but I've added it to a collection of VS plugins and scripts and I just want some clarity on the copyright.
captainadamo
14th May 2015, 18:48
No license = public domain?
No. I don't think any such jurisdiction has such a policy when it comes to copyright. No license = all rights reserved. But in this case, HolyWu is clearly allowing everyone to use it and do what they want with it.
Sorry for that question but I've added it to a collection of VS plugins and scripts and I just want some clarity on the copyright.
HolyWu is putting it out there for all to freely use like all other scripts shared on here. That was their point.
HolyWu
14th May 2015, 19:18
But this give me a segfault :
clip = core.generic.Minimum(clip)
If you need more infos ask me what to try ;)
Was your GenericFilters compiled from https://github.com/myrsloik/GenericFilters? Anyway, you can just replace all core.generic. with core.std. in the script, except core.generic.Blur and core.generic.Hysteresis.
No license = public domain?
Sorry for that question but I've added it to a collection of VS plugins and scripts and I just want some clarity on the copyright.
captainadamo has answered for me nicely.
jeremy33
14th May 2015, 20:55
Was your GenericFilters compiled from https://github.com/myrsloik/GenericFilters? Anyway, you can just replace all core.generic. with core.std. in the script, except core.generic.Blur and core.generic.Hysteresis
I don't know, I use this PPA (https://launchpad.net/~djcj/+archive/ubuntu/vapoursynth) that djcj have created. By chance djcj is here to answer ;)
By the way djcj, it's with me that you talk about nnedi3 and other things by mail ;)
foxyshadis
15th May 2015, 01:07
It'd still be a good idea to at least add CC0 (public domain) or CC-BY (which just says your name has to stay attached somehow) to the top. License questions have caused some quarrels in the past.
This is the collection I was talking about: https://github.com/darealshinji/vapoursynth-plugins
I've created it because I didn't want to add like 40+ Ubuntu packages to the PPA.
Like foxyshadis pointed out, mentioning a license is still a good idea. Other examples for short and liberal licenses would be: MIT, X11, WTFPL, BSD (2-clause), Expat, ISC or zlib. You can also release it under multiple licenses.
jeremy33
15th May 2015, 13:33
Was your GenericFilters compiled from https://github.com/myrsloik/GenericFilters?
What is recommended, use GenericFilters from myrsloik or chikuzen ? In the djcj ppa it's the one from chikuzen.
I have tested a new build from myrsloik and chikuzen and they now work with
clip = core.generic.Minimum(clip)
But I still have segfault with LSFmod. Do you have an idea of what the problem can be ?
captainadamo
15th May 2015, 15:09
This is the collection I was talking about: https://github.com/darealshinji/vapoursynth-plugins
I've created it because I didn't want to add like 40+ Ubuntu packages to the PPA.
Like foxyshadis pointed out, mentioning a license is still a good idea. Other examples for short and liberal licenses would be: MIT, X11, WTFPL, BSD (2-clause), Expat, ISC or zlib. You can also release it under multiple licenses.
Sure, but HolyWu has clearly affirmed that you are allowed to use it, modify it and do whatever you want with it. Plus, considering many of these are ported scripts that other people wrote previously, it's likely HolyWu can't just slap their own license on what is a derivative of someone else's work. Ultimately, you're likely to not get any such clear licensing since most scripts are thrown up here with no license.
jackoneill
15th May 2015, 16:21
What is recommended, use GenericFilters from myrsloik or chikuzen ? In the djcj ppa it's the one from chikuzen.
I have tested a new build from myrsloik and chikuzen and they now work with
clip = core.generic.Minimum(clip)
But I still have segfault with LSFmod. Do you have an idea of what the problem can be ?
Chikuzen's repository has several bugs that were fixed in Myrsloik's fork. If the filter you want to use exists in the "std" namespace, use that. Otherwise, use Myrsloik's fork. At this point, there is no reason to use Chikuzen's repository, and several reasons to avoid it.
jeremy33
15th May 2015, 16:38
Ok thank you jackoneill ;)
I still don't understand why I have a segfault when I try to use LSFmod even with GenericFilters from myrsloik.
jackoneill
15th May 2015, 16:55
Ok thank you jackoneill ;)
I still don't understand why I have a segfault when I try to use LSFmod even with GenericFilters from myrsloik.
Post the script, please.
jeremy33
15th May 2015, 17:07
This is my test script :
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
clip = video_in
clip = haf.LSFmod(clip, defaults="slow")
clip.set_output()
jackoneill
15th May 2015, 17:52
This is my test script :
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
clip = video_in
clip = haf.LSFmod(clip, defaults="slow")
clip.set_output()
Does it still crash, now that you built fmtconv yourself?
jeremy33
15th May 2015, 18:11
Yes it still crash
jackoneill
15th May 2015, 18:35
Yes it still crash
Run it in gdb to see at least what plugin is responsible:
gdb --args mpv file.mov etc
Then type "run" and when it crashes, type "bt". Paste the output from that.
Myrsloik
15th May 2015, 18:40
You may also want to compile vapoursynth with --enable-guard-pattern which may be able to detect when the corruption happens.
jeremy33
15th May 2015, 18:55
This is the output of gdb :
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff940a2700 (LWP 22339)]
0x00007fff967dcac2 in ?? () from /usr/lib/x86_64-linux-gnu/vapoursynth/libgenericfilters.so
(gdb) bt
#0 0x00007fff967dcac2 in ?? () from /usr/lib/x86_64-linux-gnu/vapoursynth/libgenericfilters.so
#1 0x00007fff967e7699 in ?? () from /usr/lib/x86_64-linux-gnu/vapoursynth/libgenericfilters.so
#2 0x00007ffff18c2edd in VSNode::getFrameInternal(int, int, VSFrameContext&) ()
from /usr/lib/x86_64-linux-gnu/libvapoursynth.so
#3 0x00007ffff18d1607 in VSThreadPool::runTasks(VSThreadPool*, std::atomic<bool>&) ()
from /usr/lib/x86_64-linux-gnu/libvapoursynth.so
#4 0x00007fffee1b9bf0 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff5d4c182 in start_thread (arg=0x7fff940a2700) at pthread_create.c:312
#6 0x00007fffee70c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
HolyWu
15th May 2015, 19:12
Update r17.
Use the equivalent functions in the std namespace instead of GenericFilters', except Hysteresis.
jackoneill
15th May 2015, 19:23
This is the output of gdb :
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff940a2700 (LWP 22339)]
0x00007fff967dcac2 in ?? () from /usr/lib/x86_64-linux-gnu/vapoursynth/libgenericfilters.so
(gdb) bt
#0 0x00007fff967dcac2 in ?? () from /usr/lib/x86_64-linux-gnu/vapoursynth/libgenericfilters.so
#1 0x00007fff967e7699 in ?? () from /usr/lib/x86_64-linux-gnu/vapoursynth/libgenericfilters.so
#2 0x00007ffff18c2edd in VSNode::getFrameInternal(int, int, VSFrameContext&) ()
from /usr/lib/x86_64-linux-gnu/libvapoursynth.so
#3 0x00007ffff18d1607 in VSThreadPool::runTasks(VSThreadPool*, std::atomic<bool>&) ()
from /usr/lib/x86_64-linux-gnu/libvapoursynth.so
#4 0x00007fffee1b9bf0 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff5d4c182 in start_thread (arg=0x7fff940a2700) at pthread_create.c:312
#6 0x00007fffee70c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
It's GenericFilters... I think HAvsFunc r17 will be better.
jeremy33
15th May 2015, 19:32
It's not better :(
*** Error in `/usr/bin/mpv': double free or corruption (out): 0x00007fff88003060 ***
Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fff8ffff700 (LWP 26886)]
0x00007fffee648cc9 in __GI_raise (sig=sig@entry=6)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: Aucun fichier ou dossier de ce type.
(gdb) bt
#0 0x00007fffee648cc9 in __GI_raise (sig=sig@entry=6)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007fffee64c0d8 in __GI_abort () at abort.c:89
#2 0x00007fffee685394 in __libc_message (do_abort=do_abort@entry=1,
fmt=fmt@entry=0x7fffee793b28 "*** Error in `%s': %s: 0x%s ***\n")
at ../sysdeps/posix/libc_fatal.c:175
#3 0x00007fffee69166e in malloc_printerr (ptr=<optimized out>,
str=0x7fffee793c58 "double free or corruption (out)", action=1) at malloc.c:4996
#4 _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3840
#5 0x00007ffff18c1eae in VSVariant::~VSVariant() ()
from /usr/lib/x86_64-linux-gnu/libvapoursynth.so
#6 0x00007ffff18be519 in ?? () from /usr/lib/x86_64-linux-gnu/libvapoursynth.so
#7 0x00007fff983a3fd7 in ?? () from /usr/lib/x86_64-linux-gnu/vapoursynth/libscenechange.so
#8 0x00007ffff18c2edd in VSNode::getFrameInternal(int, int, VSFrameContext&) ()
from /usr/lib/x86_64-linux-gnu/libvapoursynth.so
#9 0x00007ffff18d1607 in VSThreadPool::runTasks(VSThreadPool*, std::atomic<bool>&) ()
from /usr/lib/x86_64-linux-gnu/libvapoursynth.so
#10 0x00007fffee1b9bf0 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#11 0x00007ffff5d4c182 in start_thread (arg=0x7fff8ffff700) at pthread_create.c:312
#12 0x00007fffee70c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
Edit 1: Maybe that can help if I use LSFmod with "defaults=old" it works (clip = haf.LSFmod(clip, defaults="old"))
Edit 2: I find that if I replace diff2 = TemporalSoften(diff, 1, 255<<shift, 0, 32<<shift, 2) by diff2 = diff it works so the problem can be here
def TemporalSoften(clip, radius=4, luma_threshold=4, chroma_threshold=8, scenechange=15, mode=2):
core = vs.get_core()
if scenechange:
clip = set_scenechange(clip, scenechange)
return core.focus2.TemporalSoften2(clip, radius, luma_threshold, chroma_threshold, scenechange)
Edit 3: I found the bug, the call TemporalSoften(diff, 1, 255<<shift, 0, 32<<shift, 2) have to be TemporalSoften(diff, 1, 255<<shift, 32<<shift, 0, 2)
Parameters chroma_threshold and scenechange are swapped!
jackoneill
15th May 2015, 21:11
Edit 1: Maybe that can help if I use LSFmod with "defaults=old" it works (clip = haf.LSFmod(clip, defaults="old"))
Edit 2: I find that if I replace diff2 = TemporalSoften(diff, 1, 255<<shift, 0, 32<<shift, 2) by diff2 = diff it works so the problem can be here
def TemporalSoften(clip, radius=4, luma_threshold=4, chroma_threshold=8, scenechange=15, mode=2):
core = vs.get_core()
if scenechange:
clip = set_scenechange(clip, scenechange)
return core.focus2.TemporalSoften2(clip, radius, luma_threshold, chroma_threshold, scenechange)
Edit 3: I found the bug, the call TemporalSoften(diff, 1, 255<<shift, 0, 32<<shift, 2) have to be TemporalSoften(diff, 1, 255<<shift, 32<<shift, 0, 2)
Parameters chroma_threshold and scenechange are swapped!
That does look like a bug, but I'm not convinced it's the source of your crashes. Neither scd.Detect nor focus2.TemporalSoften2 do anything stupid when those two parameters are swapped.
Please switch them back, confirm that it crashes again, then run it in valgrind and upload the resulting text file somewhere (maybe compressed):
valgrind --log-file=lsfmod-crash-valgrind.txt mpv file.mov etc
jeremy33
15th May 2015, 21:28
Ok I just did it. That's weird (but maybe it's normal I don't know valgrind) because with valgrind mpv start playing the video.
http://www.mediafire.com/view/8ddnzxua3400fbz/lsfmod-crash-valgrind.txt
jackoneill
15th May 2015, 21:46
Ok I just did it. That's weird (but maybe it's normal I don't know valgrind) because with valgrind mpv start playing the video.
http://www.mediafire.com/view/8ddnzxua3400fbz/lsfmod-crash-valgrind.txt
It doesn't find anything. This is inconvenient. I guess the last thing you can try is compile VapourSynth with --enable-guard-pattern and see if that uncovers anything.
HolyWu
16th May 2015, 07:05
Edit 3: I found the bug, the call TemporalSoften(diff, 1, 255<<shift, 0, 32<<shift, 2) have to be TemporalSoften(diff, 1, 255<<shift, 32<<shift, 0, 2)
Parameters chroma_threshold and scenechange are swapped!
Um...no, they are not swapped by accident. It does intend to be used like that in the original version.
jeremy33
16th May 2015, 10:36
Too bad :(
I will try to compile VapourSynth with --enable-guard-pattern
jeremy33
16th May 2015, 11:33
Ok I built VapourSynth with --enable-guard-pattern. How I use it ?
Myrsloik
16th May 2015, 11:34
Ok I built VapourSynth with --enable-guard-pattern. How I use it ?
It's always active so run the same things again and see what error you get.
jeremy33
16th May 2015, 11:49
How can I be sure that I built vapoursynth right with --enable-guard-pattern ?
Because it seems that I don't have any new info :
*** Error in `mpv': malloc(): memory corruption (fast): 0x00007fb57800df20 ***
Abandon
Erreur de segmentation (Segfault)
*** Error in `Erreur de segmentation (Segfault)
*** Error in `mpv': double free or corruption (fasttop): 0x00007f47ce291080 ***
Abandon
This is the errors I get with the same script and the same video lanched 6 times
Myrsloik
16th May 2015, 12:05
How can I be sure that I built vapoursynth right with --enable-guard-pattern ?
Because it seems that I don't have any new info :
*** Error in `mpv': malloc(): memory corruption (fast): 0x00007fb57800df20 ***
Abandon
Erreur de segmentation (Segfault)
*** Error in `Erreur de segmentation (Segfault)
*** Error in `mpv': double free or corruption (fasttop): 0x00007f47ce291080 ***
Abandon
This is the errors I get with the same script and the same video lanched 6 times
You don't know unless you trigger that specific kind of error. So I guess it didn't.
jeremy33
16th May 2015, 12:18
OK.
This is here that the problem occur I think :
def TemporalSoften(clip, radius=4, luma_threshold=4, chroma_threshold=8, scenechange=15, mode=2):
core = vs.get_core()
if scenechange:
clip = set_scenechange(clip, scenechange)
return core.focus2.TemporalSoften2(clip, radius, luma_threshold, chroma_threshold, scenechange)
If I set scenechange to 0 it works
If I comment this
if scenechange:
clip = set_scenechange(clip, scenechange)
I get this error :
Property read unsuccessful but no error output: _SceneChangePrev
Abandon
If I comment this line (and add return clip) I still have segfault
return core.focus2.TemporalSoften2(clip, radius, luma_threshold, chroma_threshold, scenechange)
It seems to be this line that trigger the segfault
if scenechange:
clip = set_scenechange(clip, scenechange)
Can it help ?
HolyWu
16th May 2015, 13:03
Try clip = core.scd.Detect(clip, 32) and see what happens. Have you built SceneChange yourself as well?
jeremy33
16th May 2015, 13:10
I have also a segfault with clip = core.scd.Detect(clip, 32)
I don't think I built SceneChange, I don't even know what it is.
jeremy33
16th May 2015, 13:55
Ok I think I make it works. Thank you everybody :)
I build SceneChange myself from http://forum.doom9.org/showthread.php?t=166769 and it works!
Is it the right SceneChange version ?
jackoneill
16th May 2015, 13:58
Ok I think I make it works. Thank you everybody :)
I build SceneChange myself from http://forum.doom9.org/showthread.php?t=166769 and it works!
Is it the right SceneChange version ?
That's the one. I'm beginning to think the binaries in that PPA of yours are somehow broken...
jeremy33
16th May 2015, 14:05
Yes there is some problem with the PPA but I'm in touch with the owner, djcj, to improve it.
This PPA is the only easy way to install VapourSynth and the needed plugins on Ubuntu and djcj is kind enough to maintain it so I'm glad to help to make it works.
Tarutaru
22nd May 2015, 19:55
I got 3.3fps when converting a 1080i Blu-ray to FFV1.
I compiled ffmpeg, all QTGMC plugins with "-march=native -O3"
Is it normal?
My script -
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
ret = core.ffms2.Source(source='foo', fpsnum=30000, fpsden=1001)
ret = haf.QTGMC(ret, Preset='Slow', TFF=True)
ret = ret[::2]
ret.set_output()
Command -
vspipe --y4m $input.vpy - | ffmpeg -y -f yuv4mpegpipe -i - -vcodec ffv1 -level 3 -threads 8 -slices 24 -an $output
My computer -
CPU - Intel Xeon E3-1230 v3
RAM - 20GB DDR3
OS - Linuxmint 17.1
HolyWu
23rd May 2015, 07:02
I think it's normal with a 1920x1080 clip and Slow preset. I get approximately the same speed as yours.
HolyWu
9th June 2015, 18:46
Update r18.
SMDegrain: Fix limit and limitc arguments are not scaled to the bit depth of the input.
Bob: Fix the result is always outputted in 16-bit integer mistakenly, affecting QTGMC and ivtc_txt60mc for 8-15 bits input.
stax76
17th June 2015, 14:37
Is necessary to put havsfunc.py to Lib\site-packages or is there a way to load it from the script?
HolyWu
17th June 2015, 17:40
You can import modules put in arbitary places like this:
import importlib
haf = importlib.machinery.SourceFileLoader('havsfunc', r'C:\Foo & Bar\havsfunc.py').load_module()
haf.QTGMC(...)
stax76
17th June 2015, 22:39
:thanks:
stax76
24th June 2015, 22:53
I would like to add some presets to StaxRip and could use some help, so far I have only this:
QTGMC Slow in category 'Field'
clip = havsfunc.QTGMC(Input = clip, TFF = True, Preset = 'Slow')
SMDegrain in category 'Noise'
clip = havsfunc.SMDegrain(input = clip)
maybe somebody can suggest some useful presets, I have not really experience with anything included.
MonoS
24th June 2015, 23:09
I suggest you to make two version for SD contents and HD contents, QTGMC and degrain are very heavy function and on bd can slow down a lot the encode.
I personally use the settings in this script
https://github.com/MonoS/MonoS-VS-Func/blob/master/MFunc.py
Denoise2 works pretty well with both SD and HD content, be sure to use fast=True when dealing with BD
MQTGMC is a bit to extreme for BD and i'm tweaking its parameter a bit for both SD and HD contents
Here an except from my personal copy
# Check MatchEnhance and/or Sharpness because with SourceMatch the result seems to be a bit less sharper
# has.QTGMC(src16, Preset="Very Slow", SourceMatch=3, MatchPreset="Slow", MatchPreset2="Ultra Fast", Lossless=2, NoisePreset="Slow", TFF=TFF, EZDenoise=EZDenoise, FPSDivisor=FPSDivisor) # SD
# has.QTGMC(src16, Preset="Medium", SourceMatch=3, MatchPreset="Fast", MatchPreset2="Ultra Fast", Lossless=2, NoisePreset="Medium", TFF=TFF, EZDenoise=EZDenoise, FPSDivisor=FPSDivisor) #HD
But maybe a simple
has.QTGMC(src16, Preset="Medium", Denoiser="dfttest", TFF=TFF, EZDenoise=EZDenoise, FPSDivisor=FPSDivisor)
Should be enough for BD [i'll also suggest a downscale after deinterlacing cause usually interlaced bd don't have so much details imho].
MQTGMC is extremely slow, like 3fps on SD contents, the same for the speedupped version on the previous line on HD contents
foxyshadis
25th June 2015, 04:29
The SMDegrain wiki page (http://avisynth.nl/index.php/SMDegrain#Ready-to-run_Samples) has a bunch of sample ideas. I personally use:
df = core.dfttest.DFTTest(grainy_clip, sstring="0.0:4.0 0.2:9.0 1.0:15.0", tbsize=1)
smooth = havs.SMDegrain(up,tr=2,contrasharp=True,RefineMotion=True,pel=2,prefilter=df,mfilter=df)
but it is SLOW.
Boulder
22nd July 2015, 14:44
EDIT: Nevermind, got it working. Note to self: use the 64-bit version of the fftw library :P
tormento
25th September 2015, 20:48
Could you please update SMDegrain up to 3.1.2d? It supports KNLMeansCL and I'd like to do some tests against AviSynth and AviSynth+.
HolyWu
4th October 2015, 17:19
Update r19.
Add functions santiag, STPresso.
Delete functions ediaa, maa, SharpAAMCmod, GammaToLinear, LinearToGamma.
HQDeringmod: The Y, U, V parameters are replaced with planes parameter.
QTGMC: Delete the option 'FFT3dGPU' from Denoiser parameter, and add KNLMeansCL as another option.
GSMC: The Y, U, V parameters are replaced with planes parameter.
SMDegrain: Update to v3.1.2d.
Boulder
4th October 2015, 18:01
Could you consider porting SRestore to Vapoursynth? It's a monster of a function but quite slow in Avisynth as it doesn't like multithreading much.
mastrboy
5th October 2015, 17:46
Update r19.
Delete functions ediaa, maa, SharpAAMCmod, GammaToLinear, LinearToGamma.
Any reason why you decided to remove those functions ?
HolyWu
6th October 2015, 15:21
Any reason why you decided to remove those functions ?
The main AA functionality of the first three become duplicate of santiag, thus get removed. For masking or pre/postprocessing, just do it yourself. It's not that hard.
The latter two are obsolete since we already have fmtc.transfer.
HolyWu
6th October 2015, 16:19
Could you consider porting SRestore to Vapoursynth? It's a monster of a function but quite slow in Avisynth as it doesn't like multithreading much.
I encounter a difficulty when I step into that monster. We don't have PlaneMax/PlaneMin function to do the things like PlaneAverage!
Boulder
6th October 2015, 16:44
I encounter a difficulty when I step into that monster. We don't have PlaneMax/PlaneMin function to do the things like PlaneAverage!OK, thanks for checking it out anyway :) I'll just need to split the intermediate lossless encode to multiple parts in Avisynth to compensate, and hope that it won't crash:devil:
Myrsloik
6th October 2015, 16:55
I encounter a difficulty when I step into that monster. We don't have PlaneMax/PlaneMin function to do the things like PlaneAverage!
Are any other ones from avisynth (or in general) useful? It's trivial to calculate all of these values at the same time so maybe combining it into one more generalized function would make more sense. Thoughts? Ideas? Other far too complicated scripts you want to make sure they can be ported later on?
Or I'll simply add PlaneMinMax if no other useful ones are suggested. Did anyone actually ever use the median functionality in avisynth?
HolyWu
6th October 2015, 18:12
Currently there is no other script I really have interest in, so can't say what other ones may be needed. But indeed those runtime functions are very rarely used though.
bebs
6th October 2015, 21:46
Is it also possible to port chubby rain ? I find it efficient to remove rainbow on VHS records.
http://avisynth.nl/index.php/ChubbyRain
mawen1250
7th October 2015, 10:38
Are any other ones from avisynth (or in general) useful? It's trivial to calculate all of these values at the same time so maybe combining it into one more generalized function would make more sense. Thoughts? Ideas? Other far too complicated scripts you want to make sure they can be ported later on?
Or I'll simply add PlaneMinMax if no other useful ones are suggested. Did anyone actually ever use the median functionality in avisynth?
Something like calculating std, PSNR, etc?
aegisofrime
11th October 2015, 09:29
Hi all,
So I'm revisiting Vapoursynth after a long hiatus, and I'm confused about how to get everything working again.
Consider the following simple script:
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
core.avs.LoadPlugin(r"C:\Program Files (x86)\AviSynth+\plugins\DGDecode.dll")
DFTTest = core.dfttest
#core.std.LoadPlugin(path=r"C:\Program Files (x86)\VapourSynth\plugins32\DFTTest.dll")
clip = core.avs.MPEG2Source(d2v =r"K:\Test\Test.d2v",idct=5)
clip = haf.QTGMC(clip, Preset='Very Slow', TFF=True)
clip.set_output()
I get the following error:
AttributeError: No attribute with the name fft3dfilter exists. Did you mistype a plugin namespace?
This is despite the fact that I do have FFT3DFilter.dll in my plugins32 directory. I thought that it was supposed to be loaded automatically? In any case, loading it manually doesn't change anything.
So I thought that I might as well use DFTTest as the denoiser since that is supported apparently, so I changed my QTGMC arguments to the following:
clip = haf.QTGMC(clip, Preset='Very Slow', TFF=True, Denoiser= DFTTest)
And now I get the following:
NameError: name 'DFTTest' is not defined
Again, I have downloaded DFTTest.dll (r3) and placed it in my plugins32 folder.
Can anyone point me in the right direction please?
Edit: I'm on Vapoursynth R28!
MonoS
11th October 2015, 10:49
clip = haf.QTGMC(clip, Preset='Very Slow', TFF=True, Denoiser= DFTTest)
DFTTest should go between "quotes"
jackoneill
11th October 2015, 12:38
d2vsource can replace DGDecode. (Unless it wasn't working for you?)
Did you remember to put the (correct) fftw3 DLL in the same folder as FFT3DFilter.dll? Or maybe it's supposed to go in system32 (or whatever it's called in 64 bit Windows).
aegisofrime
11th October 2015, 13:20
DFTTest should go between "quotes"
Damn, that's all it took. Doh! Thanks a bunch! :)
Now to go set up a 64-bit installation.
d2vsource can replace DGDecode. (Unless it wasn't working for you?)
Did you remember to put the (correct) fftw3 DLL in the same folder as FFT3DFilter.dll? Or maybe it's supposed to go in system32 (or whatever it's called in 64 bit Windows).
I reused my old script which I knew was working, which had d2vsource. I'm using DGDecode now which works thanks.
I did indeed have the libfftw3 dll in my plugins folder. I fixed it by downloading a copy of vsFFT3Dfilter from VFRManiac's site :) The included FFT3DFilter.dll wasn't working for some reason.
AzraelNewtype
11th October 2015, 21:51
I reused my old script which I knew was working, which had d2vsource. I'm using DGDecode now which works thanks.
d2vsource is much, much faster, so you may want to go back.
YamashitaRen
13th October 2015, 19:38
Are any other ones from avisynth (or in general) useful? It's trivial to calculate all of these values at the same time so maybe combining it into one more generalized function would make more sense. Thoughts? Ideas? Other far too complicated scripts you want to make sure they can be ported later on?
Just remembered that every-time I bump into some script with mt_lutxy, I wonder how I can port it to Vapoursynth...
edit : ergh forget what I said, everytime there is a mt_lutxy, I see a mt_lutspa instead ~~
edit 2 : maybe I should just let this here : https://gist.github.com/tp7/1e39044e1b660ef0a02c
HolyWu
20th October 2015, 18:42
Update r20.
YAHR: Use native filter of AWarpSharp2.
QTGMC: Fix SOvs argument is not scaled to the bit depth of input clip.
LSFmod: Fix overshoot(2) and undershoot(2) arguments are not scaled to the bit depth of input clip.
MinBlur: For r=2 or 3, improve the speed when the bit depth of input clip is 16.
polus
21st November 2015, 17:26
I am just trying out HAvsfunc, and in particular QTGMC.
If I run this very simple script in vsedit:
import vapoursynth as vs
core = vs.get_core()
import havsfunc as haf
sourceMovie = core.ffms2.Source(source='myFile.vob')
clip = haf.QTGMC(sourceMovie[1000:2000], Preset='Slow', TFF=True)
clip.set_output()
I get a walkback, with Vapoursynth complaining of extra argument 'patsize' in the bitdepth function call from the Resize function of HAvsfunc. Here is the python trace
Failed to evaluate the script:
Python exception: bitdepth: Function does not take argument(s) named patsize
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1484, in vapoursynth.vpy_evaluateScript (src/cython/vapoursynth.c:26808)
File "/home/stefano/Documents/Projects/LinuxEncodingTutorial/tests/scripts/QTGMC-test.vpy", line 15, in <module>
clip = haf.QTGMC(sourceMovie[1000:2000], Preset='Slow', TFF=True)
File "/usr/lib/python3.5/site-packages/havsfunc.py", line 919, in QTGMC
spatialBlur = Resize(core.rgvs.RemoveGrain(repair0, [12] if isGray else [12, CMrg]), w, h, 0, 0, w + epsilon, h + epsilon, kernel='gauss', a1=2)
File "/usr/lib/python3.5/site-packages/havsfunc.py", line 3766, in Resize
return core.fmtc.bitdepth(last, bits=bits, fulls=fulls, fulld=fulld, dmode=dmode, ampo=ampo, ampn=ampn, dyn=dyn, staticnoise=staticnoise, patsize=patsize)
File "src/cython/vapoursynth.pyx", line 1349, in vapoursynth.Function.__call__ (src/cython/vapoursynth.c:24738)
vapoursynth.Error: bitdepth: Function does not take argument(s) named patsize
The offending line is:
return core.fmtc.bitdepth(last, bits=bits, fulls=fulls, fulld=fulld, dmode=dmode, ampo=ampo, ampn=ampn, dyn=dyn, staticnoise=staticnoise, patsize=patsize)
If (just for the fun of it, I don't really know what I'm doing) I edit the line and take out the last argument:
return core.fmtc.bitdepth(last, bits=bits, fulls=fulls, fulld=fulld, dmode=dmode, ampo=ampo, ampn=ampn, dyn=dyn, staticnoise=staticnoise) #, patsize=patsize)
The error disappears. Can anyone enlighten me on what is going on? Perhaps a version mismatch betwene VS and HAvsfunc?
I am running VapourSynth's git version and HAvsfunc r20-2, all installed with Archlinux packager (including all of HAvsfunc's dependent plugins).
Thanks for the help.
HolyWu
21st November 2015, 17:47
It means your built of fmtconv is somewhat old. The patsize parameter was added in fmtconv r17, which was released on 2015/07/09.
polus
21st November 2015, 21:31
Thanks for the quick reply. I suspected it was a version mismatched but did know where to look. Works fine now.
HolyWu
9th January 2016, 19:00
Update r21.
QTGMC: The frame property _FieldBased is set to 0 after deinterlacing now. Fix the dct argument wasn't passed to mv.Recalculate.
SMDegrain: Fix the dct argument wasn't passed to mv.Recalculate.
Clamp: Fix a wrong expression bug introduced in r20, causing the results of QTGMC's SLMode=2/4 and LSFmod's limit to be incorrect.
an3k
16th January 2016, 10:57
The core plugins are MVTools2, MaskTools v2, RemoveGrain and TemporalSoften (https://github.com/dubhater/vapoursynth-temporalsoften), they must be loaded. Others depending on your settings. If you don't use them, they don't have to be loaded.
Are these the correct links for the plugins?
MVTools2 (https://github.com/dubhater/vapoursynth-mvtools), MaskTools v2, RemoveGrain (http://www.vapoursynth.com/doc/plugins/rgvs.html#rgvs) and TemporalSoften (https://github.com/dubhater/vapoursynth-temporalsoften)
Where do I get MaskTools v2? Haven't found anything except MSmoosh (https://github.com/dubhater/vapoursynth-msmoosh)
Boulder
16th January 2016, 10:59
The functions of MaskTools are included in the Vapoursynth core.
an3k
17th January 2016, 03:55
Just a list of some Plugins one may need for HAvsFunc (required) / QTGMC (optional)
Linux:
Required
MVTools2: Download (https://github.com/dubhater/vapoursynth-mvtools/releases) / Git (https://github.com/dubhater/vapoursynth-mvtools) / Forum (http://forum.doom9.org/showthread.php?t=171207)
MaskTools v2: included in VapourSynth core
RemoveGrain: included in VapourSynth core
TemporalSoften (or use the version from SceneChange, see this post (http://forum.doom9.org/showthread.php?p=1753645#post1753645)): Download (https://github.com/dubhater/vapoursynth-temporalsoften/releases) / Git (https://github.com/dubhater/vapoursynth-temporalsoften)
Optional
fmtconv: Download (https://github.com/EleonoreMizo/fmtconv/releases) / Git (https://github.com/EleonoreMizo/fmtconv) / Forum (http://forum.doom9.org/showthread.php?t=166504)
FFTW3: Download (http://www.fftw.org/download.html) (preferred) / Download (https://github.com/FFTW/fftw3/releases) / Git (https://github.com/FFTW/fftw3)
SceneChange: Forum (http://forum.doom9.org/showthread.php?t=166769)
dfttest: Download (https://github.com/HomeOfVapourSynthEvolution/VapourSynth-DFTTest/releases) / Git (https://github.com/HomeOfVapourSynthEvolution/VapourSynth-DFTTest)
NNEDI3: Download (https://github.com/dubhater/vapoursynth-nnedi3/releases) / Git (https://github.com/dubhater/vapoursynth-nnedi3) / Forum (http://forum.doom9.org/showthread.php?t=166434)Windows:
See http://forum.doom9.org/showthread.php?t=156028
sl1pkn07
17th January 2016, 05:15
my list
addgrain: for QTGMC function (optional)
awarpsharp2: for YAHR function
bilateral: for logoNR function
ctmf: for HQDeringmod function
dctfilter: for Deblock_QED function
deblock: for Deblock_QED function
dfttest: for QTGMC function (optional)
eedi2: for santiag function
fft3dfilter: for QTGMC function (optional)
flash3kyuu_deband: for SmoothLevels function
fluxsmooth: for logoNR function
fmtconv: for QTGMC function
genericfilters: for HQDering function
knlmeanscl: for QTGMC function (optional)
mvtools: for QTGMC, GrainStabilizeMC and LSFmod function
nnedi3: for QTGMC function
sangnommod: for santiag function
scenechange: for QTGMC function
temporalsoften: for TemporalSoften function
speedyrazor
24th January 2016, 09:33
Hi, I am trying to get QTGMC working with VapourSynth 64bit portable, but whenever I try to run my script it crashes VSPipe of VapourSynth Editor straight away.
VapourSynth is up and running as I can run other scripts fine.
I have these plugins (which are all the 64bit versions) in the plugin folder:
DFTTest.dll
Yadifmod.dll
fmtconv.dll
libfftw3f-3.dll
libmvtools.dll
libnnedi3.dll
nnedi3_weights.bin
scenechange.dll
temporalsoften.dll
vslsmashsource.dll
And here's the contents of the coreplugins folder:
AvsCompat.dll
EEDI3.dll
RemoveGrainVS.dll
VIVTC.dll
Vinverse.dll
avisource.dll
genericfilters.dll
libassvapour.dll
libhistogram.dll
libtemporalsoften.dll
And here is my script:
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
ret = core.lsmas.LibavSMASHSource(source=r"F:/Interlaced_Test.mov")
ret = haf.QTGMC(ret, Preset='Medium', TFF=True)
ret = core.fmtc.resample (clip=ret, w=720, h=576, css="444", kernel="spline36")
ret = core.fmtc.matrix (clip=ret, mats="709", matd="601")
ret = core.fmtc.resample (clip=ret, css="422")
ret = core.fmtc.bitdepth (clip=ret, bits=10)
ret.set_output()
My source is a 1920x1080 Prores file.
sl1pkn07
24th January 2016, 09:36
and the error is?
speedyrazor
24th January 2016, 09:39
and the error is?
"VSPip.exe has stopped working"
and
"VapuorSynth Editor has stopped working"
sl1pkn07
24th January 2016, 09:41
no more?
please add a sample of the video
EDIT:
tested with http://samples.mplayerhq.hu/V-codecs/HCPA/AppleProRes422.mov
this is your error?
Failed to evaluate the script:
Python exception: bitdepth: Function does not take argument(s) named patsize
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1489, in vapoursynth.vpy_evaluateScript (src/cython/vapoursynth.c:26885)
File "/home/sl1pkn07/aplicaciones/vapoursynth-test/qtmc-test.vpy", line 5, in <module>
ret = haf.QTGMC(ret, Preset='Medium', TFF=True)
File "/usr/lib/python3.5/site-packages/havsfunc.py", line 918, in QTGMC
spatialBlur = Resize(core.rgvs.RemoveGrain(repair0, [12] if isGray else [12, CMrg]), w, h, 0, 0, w + epsilon, h + epsilon, kernel='gauss', a1=2)
File "/usr/lib/python3.5/site-packages/havsfunc.py", line 3774, in Resize
return core.fmtc.bitdepth(last, bits=bits, fulls=fulls, fulld=fulld, dmode=dmode, ampo=ampo, ampn=ampn, dyn=dyn, staticnoise=staticnoise, patsize=patsize)
File "src/cython/vapoursynth.pyx", line 1354, in vapoursynth.Function.__call__ (src/cython/vapoursynth.c:24815)
vapoursynth.Error: bitdepth: Function does not take argument(s) named patsize
speedyrazor
24th January 2016, 09:51
no more?
please add a sample of the video
Thats it, they both just crash with "stopped working".
I have attached a sample which has the same effect. It must be my setup, plugins, etc?
speedyrazor
24th January 2016, 09:56
no more?
please add a sample of the video
EDIT:
tested with http://samples.mplayerhq.hu/V-codecs/HCPA/AppleProRes422.mov
this is your error?
Failed to evaluate the script:
Python exception: bitdepth: Function does not take argument(s) named patsize
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1489, in vapoursynth.vpy_evaluateScript (src/cython/vapoursynth.c:26885)
File "/home/sl1pkn07/aplicaciones/vapoursynth-test/qtmc-test.vpy", line 5, in <module>
ret = haf.QTGMC(ret, Preset='Medium', TFF=True)
File "/usr/lib/python3.5/site-packages/havsfunc.py", line 918, in QTGMC
spatialBlur = Resize(core.rgvs.RemoveGrain(repair0, [12] if isGray else [12, CMrg]), w, h, 0, 0, w + epsilon, h + epsilon, kernel='gauss', a1=2)
File "/usr/lib/python3.5/site-packages/havsfunc.py", line 3774, in Resize
return core.fmtc.bitdepth(last, bits=bits, fulls=fulls, fulld=fulld, dmode=dmode, ampo=ampo, ampn=ampn, dyn=dyn, staticnoise=staticnoise, patsize=patsize)
File "src/cython/vapoursynth.pyx", line 1354, in vapoursynth.Function.__call__ (src/cython/vapoursynth.c:24815)
vapoursynth.Error: bitdepth: Function does not take argument(s) named patsize
How can I see this error message?
So what does this actually mean please?
feisty2
24th January 2016, 10:08
vapoursynth.Error: bitdepth: Function does not take argument(s) named patsize
sl1pkn07
24th January 2016, 10:21
this means i need update my fmtconv (http://forum.doom9.org/showpost.php?p=1747378&postcount=167)
but i get segfault XD
PID: 11849 (vspipe)
UID: 1000 (sl1pkn07)
GID: 100 (users)
Signal: 11 (SEGV)
Timestamp: dom 2016-01-24 10:30:17 CET (13s ago)
Command Line: vspipe -i qtgmc-test.vpy -
Executable: /usr/bin/vspipe
Control Group: /user.slice/user-1000.slice/session-c1.scope
Unit: session-c1.scope
Slice: user-1000.slice
Session: c1
Owner UID: 1000 (sl1pkn07)
Boot ID: a6e84e9c964048a48a6df7c9ff78e494
Machine ID: c20ee0c57658685bfedf50384b0e3ec0
Hostname: sL1pKn07
Coredump: /var/lib/systemd/coredump/core.vspipe.1000.a6e84e9c964048a48a6df7c9ff78e494.11849.1453627817000000.lz4
Message: Process 11849 (vspipe) of user 1000 dumped core.
Stack trace of thread 11953:
#0 0x0000000000000001 n/a (n/a)
i think this is the real problem
speedyrazor
24th January 2016, 11:03
vapoursynth.Error: bitdepth: Function does not take argument(s) named patsize
Does this mean I cant use QTGMC with a 10 bit source , or something else?
Is there anyway to to fix this, so I can use QTGMC?
feisty2
24th January 2016, 11:10
Does this mean I cant use QTGMC with a 10 bit source , or something else?
Is there anyway to to fix this, so I can use QTGMC?
it tells you to update fmtconv.dll
speedyrazor
24th January 2016, 11:18
it tells you to update fmtconv.dll
Updated to fmtconv-r17, still have exatclt the same issue. ".... has stopped working"
feisty2
24th January 2016, 11:25
Updated to fmtconv-r17, still have exatclt the same issue. ".... has stopped working"
sweetheart, "... has stopped working" is not a diagnosable error, that's not the way how troubleshooting works..
speedyrazor
24th January 2016, 11:27
sweetheart, "... has stopped working" is not a diagnosable error, that's not the way how troubleshooting works..
Well, could you tell me how to get more info then please, I would love to report more, but currently thats all I have.
sl1pkn07
24th January 2016, 11:27
sounds a segfault (see my latest post ;_; )
feisty2
24th January 2016, 11:31
http://i.imgur.com/OKVw36i.png
try troubleshooting with vseditor
sl1pkn07
24th January 2016, 11:33
i get segfault in both. vspipe and vsedit
but the coredump is wreid, ony point to http://forum.doom9.org/showpost.php?p=1754591&postcount=181
speedyrazor
24th January 2016, 11:36
http://i.imgur.com/OKVw36i.png
try troubleshooting with vseditor
I have tried that, if I choose 'Check Script' again.... All I get is "VapuorSynth Editor has stopped working", as I keep saying, I dont get anything else. See attached screen grab.
sl1pkn07
24th January 2016, 11:45
please use imgur or something
foxyshadis
24th January 2016, 12:01
Probably something triggering a vsFatal, which annoyingly crashes instead of letting the user do anything about it. It'd be nice if vsFatal at least popped up a simple messagebox detailing the error before crashing, if it's not going to incorporate any kind of crash-reporting code.
Boulder
24th January 2016, 12:07
Does the source filter return normalized framerates? That kind of a crash occurs when it does not.
jackoneill
24th January 2016, 12:12
Debugging a crash in Linux:
gdb --args <your command here>
run
[crashes]
bt full
You probably don't have debugging symbols at this point, so this only tells you what plugin is crashing. Recompile that with
-O0 -g
in CFLAGS and CXXFLAGS and use gdb again. Then post the backtrace.
foxyshadis: In Linux at least you get the error message before the crash, and it's not a segfault (signal 11).
sl1pkn07
24th January 2016, 12:29
http://sl1pkn07.wtf/paste/view/cffc1dfc
using this sample: https://www.arri.com/DE/camera/alexa/learn/alexa_sample_footage/
(ftp://ftp-footage.arri.de/ALEXA%20XT/03_ProRes_16-9_2048x1152/30fps/J001C062_140110_R6MS.mov)
jackoneill
24th January 2016, 13:20
Sorry about that. Please update nnedi3: https://github.com/dubhater/vapoursynth-nnedi3/releases/tag/v8
sl1pkn07
24th January 2016, 13:29
yep. now works for me
tnx bro!
speedyrazor
24th January 2016, 13:39
Updated with V8, unfortunately I am getting:
Failed to evaluate the script:
Python exception: nnedi3: Couldn't open file 'G:/ffmpeg/VapourSynth/vapoursynth64/plugins/nnedi3_weights.bin'. Error message: No such file or directory
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1489, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:26885)
File "", line 5, in <module>
File "G:\ffmpeg\VapourSynth\havsfunc.py", line 1045, in QTGMC
edi1 = QTGMC_Interpolate(ediInput, InputType, EdiMode, NNSize, NNeurons, EdiQual, EdiMaxD, bobbed, ChromaEdi, TFF)
File "G:\ffmpeg\VapourSynth\havsfunc.py", line 1326, in QTGMC_Interpolate
interp = core.nnedi3.nnedi3(Input, field=field, U=CEed, V=CEed, nsize=NNSize, nns=NNeurons, qual=EdiQual)
File "src\cython\vapoursynth.pyx", line 1381, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:25200)
vapoursynth.Error: nnedi3: Couldn't open file 'G:/ffmpeg/VapourSynth/vapoursynth64/plugins/nnedi3_weights.bin'. Error message: No such file or directory
And I checked and doubdle checked, I do have the file nnedi3_weights.bin in G:/ffmpeg/VapourSynth/vapoursynth64/plugins folder. I am using the portable version.
jackoneill
24th January 2016, 13:53
Updated with V8, unfortunately I am getting:
Failed to evaluate the script:
Python exception: nnedi3: Couldn't open file 'G:/ffmpeg/VapourSynth/vapoursynth64/plugins/nnedi3_weights.bin'. Error message: No such file or directory
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1489, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:26885)
File "", line 5, in <module>
File "G:\ffmpeg\VapourSynth\havsfunc.py", line 1045, in QTGMC
edi1 = QTGMC_Interpolate(ediInput, InputType, EdiMode, NNSize, NNeurons, EdiQual, EdiMaxD, bobbed, ChromaEdi, TFF)
File "G:\ffmpeg\VapourSynth\havsfunc.py", line 1326, in QTGMC_Interpolate
interp = core.nnedi3.nnedi3(Input, field=field, U=CEed, V=CEed, nsize=NNSize, nns=NNeurons, qual=EdiQual)
File "src\cython\vapoursynth.pyx", line 1381, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:25200)
vapoursynth.Error: nnedi3: Couldn't open file 'G:/ffmpeg/VapourSynth/vapoursynth64/plugins/nnedi3_weights.bin'. Error message: No such file or directory
And I checked and doubdle checked, I do have the file nnedi3_weights.bin in G:/ffmpeg/VapourSynth/vapoursynth64/plugins folder. I am using the portable version.
This is strange. Which version did you have earlier? Is libnnedi3.dll in that folder too? Is that where the previous version was? Did you simply overwrite the old libnnedi3.dll?
Edit: disregard the above. It was my compiler's fault. Please download v8 again.
For those interested in such things, GCC 5.3.0 broke
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t>::from_bytes()
which I use to convert the char* path returned by getPluginPath to wchar_t*, for _wfopen, which opens nnedi3_weights.bin.
speedyrazor
24th January 2016, 14:03
Just deleted out both nnedi3_weights.bin and libnnedi3.dll and downloaded them, put them in the plugins folder, but still get the same issue.
I have attached 2 screen grabs, one of the plugins folder and one of the core plugins folder.
speedyrazor
24th January 2016, 14:11
All good, thanks, working now.
Just checking, but using QTGMC, it is going to be staying in 10 bit?
Myrsloik
24th January 2016, 19:24
All good, thanks, working now.
Just checking, but using QTGMC, it is going to be staying in 10 bit?
Yes, it should stay in 10bit. I would however recommend doing all processing in 16bit. You're wasting a lot of intermediate precision by not using it.
speedyrazor
24th January 2016, 20:49
Yes, it should stay in 10bit. I would however recommend doing all processing in 16bit. You're wasting a lot of intermediate precision by not using it.
Hi Myrsloik, thanks for the suggestion, and sorry to ask, but using the below script as a 'typical' example, what commands would I need to add / change to process everything in 16 bit?
import vapoursynth as vs
core = vs.get_core()
ret = core.lsmas.LibavSMASHSource(source=r"F:/Interlaced_Test.mov")
ret = core.yadifmod.Yadifmod(ret, edeint=core.nnedi3.nnedi3(ret, field=1), order=1)
ret = core.fmtc.resample (clip=ret, w=720, h=576, css="444", kernel="spline36")
ret = core.fmtc.matrix (clip=ret, mats="709", matd="601")
ret = core.fmtc.resample (clip=ret, css="422")
ret = core.fmtc.bitdepth (clip=ret, bits=10)
ret.set_output()
Kind regards.
HolyWu
25th January 2016, 03:11
Simply insert ret = core.fmtc.bitdepth(clip=ret, bits=16) below LibavSMASHSource.
speedyrazor
25th January 2016, 07:26
Simply insert ret = core.fmtc.bitdepth(clip=ret, bits=16) below LibavSMASHSource.
So it would look like this:
import vapoursynth as vs
core = vs.get_core()
ret = core.lsmas.LibavSMASHSource(source=r"F:/Interlaced_Test.mov")
ret = core.fmtc.bitdepth (clip=ret, bits=16)
ret = core.yadifmod.Yadifmod(ret, edeint=core.nnedi3.nnedi3(ret, field=1), order=1)
ret = core.fmtc.resample (clip=ret, w=720, h=576, css="444", kernel="spline36")
ret = core.fmtc.matrix (clip=ret, mats="709", matd="601")
ret = core.fmtc.resample (clip=ret, css="422")
ret = core.fmtc.bitdepth (clip=ret, bits=10)
ret.set_output()
So convert to 16 bit, do the processing and force it back down to 10?
Does this have much processing / speed implications?
Kind regards.
Boulder
25th January 2016, 07:32
No need to go back to 10 bits so you can remove the "ret = core.fmtc.bitdepth (clip=ret, bits=10)" line. Depending on the encoder you are using to produce the final result, you may need to tell it that you are inputting a 16-bit source.
speedyrazor
25th January 2016, 07:53
No need to go back to 10 bits so you can remove the "ret = core.fmtc.bitdepth (clip=ret, bits=10)" line. Depending on the encoder you are using to produce the final result, you may need to tell it that you are inputting a 16-bit source.
I am piping into ffmpeg, is it better for ffmpeg to do the convert, or VapourSynth?
Boulder
25th January 2016, 19:21
What codec do you use inside ffmpeg?
speedyrazor
25th January 2016, 21:22
What codec do you use inside ffmpeg?
Mainly Prores HQ, but also H.264 and Mpeg2.
Boulder
25th January 2016, 21:43
At least h.264 (x264) should have the input depth parameter, don't know about the others.
sneaker_ger
25th January 2016, 21:48
x264cli has automatic dithering, that's different from the libx264 integration of ffmpeg. Either way, I don't see any reason to favor ffmpeg's/x264cli's dithering over the one of fmtconv.
speedyrazor
25th January 2016, 22:50
x264cli has automatic dithering, that's different from the libx264 integration of ffmpeg. Either way, I don't see any reason to favor ffmpeg's/x264cli's dithering over the one of fmtconv.
Thanks for the advice.
sl1pkn07
5th February 2016, 16:31
only for history record, anyone have the r1, r2 and r3 zips/.py?
greetings
Myrsloik
5th February 2016, 19:29
Speaking about history. Is there any chance I could convince you to use github for hosting and history too?
sl1pkn07
5th February 2016, 20:13
the history is here https://www.nmm-hd.org/newbbs/viewtopic.php?f=23&t=941
HolyWu
9th February 2016, 16:22
Speaking about history. Is there any chance I could convince you to use github for hosting and history too?
Done.
Could you consider porting SRestore to Vapoursynth? It's a monster of a function but quite slow in Avisynth as it doesn't like multithreading much.
Could you or anyone provide a small sample clip with blending problem? I need to do some experiments and make sure the result is correct.
sl1pkn07
9th February 2016, 16:26
i have zips since r4, if you want add in the history
http://sl1pkn07.wtf/havsfunc
Boulder
9th February 2016, 17:17
Could you or anyone provide a small sample clip with blending problem? I need to do some experiments and make sure the result is correct.Sure, I'll try to find something for you off my HDDs. I have at least one concert video readily available but it's tricky to get a good scene for testing.
Boulder
9th February 2016, 17:59
Here you go: https://drive.google.com/file/d/0BzeF_1syecQwLXJfVXhxdE1XMWs/view?usp=sharing
The original frame rate is 25 fps.
BakaProxy
17th February 2016, 19:11
Do you actually intend on implementing the different prefilters from the avisynth version of smdegrain? prefilter 3 and 4 that is.
Thanks in advance.
Tima
24th February 2016, 11:06
Here's another useful script: http://avisynth.nl/index.php/FixChromaBleedingMod
Could you please port it to VS as well (or suggest some better already-ported alternatives)?
HolyWu
26th February 2016, 17:46
Update r22.
Add functions FixChromaBleedingMod(requires adjust (https://github.com/dubhater/vapoursynth-adjust)), InterFrame, srestore and Toon.
Delete utility function LimitDiff, use LimitFilter from mvsfunc (https://github.com/HomeOfVapourSynthEvolution/mvsfunc) instead.
LSFmod: Use "min/max" kernel for edgemaskHQ=False.
SMDegrain: Use DFTTest for prefilter=3 again.
KNLMeansCL: Add the newly added wref parameter in v0.7.5.
HolyWu
26th February 2016, 17:50
Also I made an Anti-Aliasing script of my own.
I don't think it's special enough to make a whole new script for it so I'd like to ask if you want to take it into HAvsFunc.
Sorry, I won't add it. But thanks for your share anyway. :)
Elegant
27th February 2016, 08:24
Any chance on MCTD? I'ts pretty much the only reason I still use AviSynth. I'm not sure prerequisites are still missing.
I should probably learn VapourSynth I find myself porting some of the newer plugins to AviSynth XD
HolyWu
27th February 2016, 09:49
Any chance on MCTD? I'ts pretty much the only reason I still use AviSynth. I'm not sure prerequisites are still missing.
I should probably learn VapourSynth I find myself porting some of the newer plugins to AviSynth XD
MCTD is a script like Swiss army knife. Its main core, denoising, is IMO no better than SMDegrain. Regarding its lot of post-processings, some of the functionality can be achieved by existing functions or individual filters. The only missing two functionality are probably "star & bright points protection" and "stabilize". However I also don't find them really useful though, especially "stabilize" needs a plugin that doesn't have native porting yet.
Boulder
27th February 2016, 10:21
Were you able to use the blended field clip I posted earlier? If not (as it was not a perfect example), I could try finding out a better sample from my DVD collection.
HolyWu
27th February 2016, 14:11
Were you able to use the blended field clip I posted earlier? If not (as it was not a perfect example), I could try finding out a better sample from my DVD collection.
Yes. Thanks for your sample video so I can confirm whether the result is correct. Although I simply test it with the default settings and haven't tried to change any parameter so far.
NailBomber
28th February 2016, 13:10
Update r22.
Add functions FixChromaBleedingMod(requires adjust (https://github.com/dubhater/vapoursynth-adjust)), InterFrame, srestore and Toon.
Delete utility function LimitDiff, use LimitFilter from mvsfunc (https://github.com/HomeOfVapourSynthEvolution/mvsfunc) instead.
LSFmod: Use "min/max" kernel for edgemaskHQ=False.
SMDegrain: Use DFTTest for prefilter=3 again.
KNLMeansCL: Add the newly added wref parameter in v0.7.5.
Does InterFrame work? I can't seem to load an AviSynth plugins (svpflow1.dll and svpflow2.dll).
Simple script gives me an error:
import vapoursynth as vs
import havsfunc as hf
core = vs.get_core()
core.avs.LoadPlugin( path="C:\\Apps\\VapourSynth\\avsplugins\\svpflow1.dll" )
core.avs.LoadPlugin( path="C:\\Apps\\VapourSynth\\avsplugins\\svpflow2.dll" )
clip = core.lsmas.LWLibavSource( "before_interframe.mp4" )
clip = hf.InterFrame( clip )
clip.set_output()
Are_
28th February 2016, 13:51
As far as I understand it svp has native plugins for vapoursynth and this script uses them. Put that plugins in the autoload folder and don't try to manually load anything.
Mystery Keeper
28th February 2016, 15:59
Suggestion, if you haven't done it yet. To process float point clips I did this in my script:
mv = core.mv
if clip.format.sample_type == vs.FLOAT:
mv = core.mvsfThen I used mv instead of core.mv. It worked for TempLinearApproximateMC. You could try it with your functions and see if they can process floating point scripts. Maybe adjust some things if they can't so they could.
HolyWu
28th February 2016, 18:24
Does InterFrame work? I can't seem to load an AviSynth plugins (svpflow1.dll and svpflow2.dll).
As Are_ said, You need to use the native DLLs for VapourSynth instead of AviSynth ones. See http://forum.doom9.org/showthread.php?p=1758187#post1758187.
NailBomber
28th February 2016, 20:23
Are_, HolyWu, thanks!
TalasNetrag
1st March 2016, 13:59
Any plans on porting AnimeIVTC, YAHRmod, abcxyz, WarpDeRing and SSSharp?
aegisofrime
4th March 2016, 22:58
Yay, InterFrame, thanks! That was one of the few reasons I was still on Avisynth. Thanks HolyWu!
asarian
5th April 2016, 10:30
Hmm, QTGMC is supposed to be a native part of the hav tools, right?! Cuz I'm getting some error about the name scd not existing:
Script evaluation failed:
Python exception: No attribute with the name scd exists. Did you mistype a plugin namespace?
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1489, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:26885)
File "f:\jobs\neela.vpy", line 10, in <module>
vid = haf.QTGMC (vid, InputType=0, Preset="Very Slow", TR2=3, TFF=True)
File "C:\Program Files\Python35\lib\site-packages\havsfunc.py", line 978, in QTGMC
if TR0 > 0: ts1 = TemporalSoften(bobbed, 1, 255 << shift, CMts << shift, 28 << shift, 2) # 0.00 0.33 0.33 0.33 0.00
File "C:\Program Files\Python35\lib\site-packages\havsfunc.py", line 4287, in TemporalSoften
clip = set_scenechange(clip, scenechange)
File "C:\Program Files\Python35\lib\site-packages\havsfunc.py", line 4319, in set_scenechange
sc = core.scd.Detect(sc, thresh)
File "src\cython\vapoursynth.pyx", line 1103, in vapoursynth.Core.__getattr__ (src\cython\vapoursynth.c:20711)
AttributeError: No attribute with the name scd exists. Did you mistype a plugin namespace?
Mystery Keeper
5th April 2016, 13:08
Looks like you're missing the scene detection plugin.
asarian
5th April 2016, 13:12
Looks like you're missing the scene detection plugin.
Indeed. I got the 64-bit version now. :) Thx.
asarian
5th April 2016, 19:08
After much fumbling in obscurity, on my end, I finally got QTGMC to work. :) YAY! And, to my surprise, not only does it not crash immediately, it's 'lightning' fast too, relatively, of course. I had hoped the VS implementation would distribute things much better over all my cores, and it does! :) Nearly 100% CPU load.
Great stuff, people! Looks like VS will be my new video rendering environment! :)
asarian
9th April 2016, 11:23
Using 'vid = haf.Deblock_QED (vid)', I'm getting the following error:
Script evaluation failed:
Python exception: No attribute with the name deblock exists. Did you mistype a plugin namespace?
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1491, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:26897)
File "f:\jobs\uit1.vpy", line 10, in <module>
vid = haf.Deblock_QED (vid)
File "C:\Program Files\Python35\lib\site-packages\havsfunc.py", line 341, in Deblock_QED
normal = core.deblock.Deblock(clp, quant=quant1, aoffset=aOff1, boffset=bOff1, planes=[0, 1, 2] if uv != 2 and not isGray else [0])
File "src\cython\vapoursynth.pyx", line 1105, in vapoursynth.Core.__getattr__ (src\cython\vapoursynth.c:20791)
AttributeError: No attribute with the name deblock exists. Did you mistype a plugin namespace?
Boulder
9th April 2016, 12:13
You need the deblock plugin: https://github.com/HomeOfVapourSynthEvolution/VapourSynth-Deblock
asarian
9th April 2016, 14:57
^^ Thx. Silly me. I got the same error, thereafter, about 'dct', but this time I got the message. :)
Mystery Keeper
16th April 2016, 22:27
Is it possible to add float support to QTGMC?
HolyWu
17th April 2016, 00:41
Is it possible to add float support to QTGMC?
Probably not. Some core functions don't support 32-bit input yet.
asarian
17th April 2016, 09:38
SmoothLevels now points to SmoothAdjust. Haven't had my coffee yet, but not seeing a VapourSynth port for it. Does it still exist?
HolyWu
17th April 2016, 12:45
SmoothLevels now points to SmoothAdjust. Haven't had my coffee yet, but not seeing a VapourSynth port for it. Does it still exist?
The SmoothLevels function in haf is ported from the old scripted version. The new dll version SmoothAdjust is closed source.
asarian
17th April 2016, 13:02
Okay, thank you.
HolyWu
13th May 2016, 14:47
Update r23.
Add Stab function.
Now uses core.resize where applicable.
Now uses simple rounding when invoking the Resize wrapper.
srestore: Remove unnecessary invoking of std.Cache.
YAHR: Add the blur and depth parameters.
DeHalo_alpha, LSFmod: Remove the noring parameter.
ContraSharpening: Add the radius and rep parameters.
InterFrame: Remove the invoking of std.Cache. The cache issue has been fixed in VS R32.
HQDeringmod: Process the ring mask in the original color family. It's more convenient for interleaving with the source to tune the mask when show=True.
KNLMeansCL: Use color distance to process chroma planes. The quality is better than processing each chroma plane using gray intensities.
logoNR: Use KNLMeansCL instead of Bilateral+FluxSmooth for smoothing.
Overlay: Process in formats without subsampling to avoid messed result.
QTGMC: The TFF parameter is not required for InputType=1.
Boulder
13th May 2016, 16:46
Thanks a lot for the new version :)
hydra3333
19th June 2016, 05:40
Yes, thank you.
As a VS newbie yet to try to install then run a script using the embedded version of VS/Python, I'm still confused about the dependencies for QTGMC which is the main filter I need, along with deblock_qed and mdegrain1/2/3 and LSFmod.
http://forum.doom9.org/showthread.php?p=1603176#post1603176 from 2012 says
The core plugins are MVTools2, MaskTools v2, RemoveGrain and TemporalSoften, they must be loaded. Others depending on your settings. If you don't use them, they don't have to be loaded.
BTW, if encountering deadlock, try setting the number of threads to a bigger number, vs.Core(threads=x). But no guarantee it will always work. The perfect solution is to wait for the fix of MVTools2.
However I'm not sure what's already included in the embedded version of VS or not.
I've found useful stuff in "mvsfunc-r7" and downloaded "vapoursynth-mvtools-v13-win32" and "vapoursynth-temporalsoften-v1.0-win32" and been told
Also RemoveGrain and Repair already come included with VapourSynth. If you're looking for anything else take a look at this list here: http://www.vapoursynth.com/doc/pluginlist.html
... but what to do about "MaskTools v2" for vapoursynth, to provide for QTGMC, currently eludes me. Can some kind soul please provide clarification ?
If you are feeling in an especially kind mood, any links to sample scripts which use
QTGMC , deblock_qed , mdegrain1/2/3 , LSFmod , deinterlacing and re-interlacing.
VS for a newbie appears a tad confusing since I read that something like this apparently should re-interlace
def convert_50p_to_50i_tff(c):
# http://forum.doom9.org/showthread.php?t=173163
core = vs.get_core()
if not isinstance(c, vs.VideoNode):
raise TypeError('convert_50p_to_50i_tff: input is not a clip')
#cx = c
#cx = core.std.SeparateFields(cx,tff=True)
cx = core.std.SeparateFields(c,tff=True)
cx = core.std.SelectEvery(cx,cycle=4,offsets=[0, 3])
cx = core.std.DoubleWeave(cx,tff=True)
cx = core.std.SelectEvery(cx,cycle=2, offsets=0)
return cx
which looks quite different to avisynth's equivalent
assumeTFF().Blur(0,0.25).SeparateFields().SelectEvery(4,0,3).Weave() #reinterlace - ASSUMED TFF HERE # BLUR(0,1) per http://forum.doom9.org/showthread.php?p=1488308#post1488308
Selur
9th July 2016, 12:34
using the portable Vapoursynth version I tried to get QTGMC running using:
# Imports
import ctypes
import sys
import os
import vapoursynth as vs
core = vs.get_core()
# Loading Support Files
Dllref = ctypes.windll.LoadLibrary("G:/Hybrid/Vapoursynth/vapoursynth64/plugins/support/libfftw3f-3.dll")
# Import Scripts Folder
scriptPath = 'G:/Hybrid/Vapoursynth/scripts'
sys.path.append(os.path.abspath(scriptPath))
# Import havsfunc # https://github.com/HomeOfVapourSynthEvolution/havsfunc/archive/r23.zip
import havsfunc as havsfunc
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/Support/libnnedi3.dll") # https://github.com/dubhater/vapoursynth-nnedi3/releases/download/v8/vapoursynth-nnedi3-v8-win64.7z
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/Support/libmvtools.dll") # https://github.com/dubhater/vapoursynth-mvtools/releases/download/v15/vapoursynth-mvtools-v15-win64.7z
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/Support/temporalsoften.dll") # https://github.com/dubhater/vapoursynth-temporalsoften/releases/download/v1.0/vapoursynth-temporalsoften-v1.0-win64.7z
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/Support/scenechange.dll") # http://uloz.to/x6gvxpbB/scenechange-win64-7z
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/Support/fmtconv.dll") # https://github.com/EleonoreMizo/fmtconv/releases/download/r20/fmtconv-r20.zip
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/SourceFilter/d2vSource/d2vsource.dll") # https://github.com/dwbuiten/d2vsource/releases/download/v1.0/d2vsource-1.0-windows.zip
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/GrainFilter/AddGrain/AddGrain.dll") # https://github.com/HomeOfVapourSynthEvolution/VapourSynth-AddGrain/releases/download/r5/AddGrain-r5.7z
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/DenoiseFilter/FFT3DFilter/vsfft3dfilter.dll") # http://vfrmaniac.fushizen.eu/works/vsfft3dfilter_r22-b023e21.7z
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/DenoiseFilter/DFTTest/DFTTest.dll") # https://github.com/HomeOfVapourSynthEvolution/VapourSynth-DFTTest/releases/download/r3/DFTTest-r3.7z
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll") # https://github.com/Khanattila/KNLMeansCL/releases/download/v0.7.6/KNLMeansCL-v0.7.6.zip
# Loading Source: F:\TestClips&Co\interlaceAndTelecineSamples\interlaced\interlaced.m2v
clip = core.d2v.Source(input="H:/Temp/m2v_26c3cb85db00ee55b39de4864fd86927_491.d2v")
# Deinterlacing using QTGMC
clip = havsfunc.QTGMC(Input=clip, Preset="Fast", TFF=True)
clip = clip[::2]
# Output
clip.output(sys.stdout, y4m=1)
but I only get a 'VSPipe.exe has stopped working' with no further error message when calling:
"g:\Hybrid\Vapoursynth\VSPipe.exe" "h:\Temp\test.vpy" - --y4m | "g:\Hybrid\ffplay.exe" -
(same happens when I use vsedit)
-> am I missing something? (some missing/wrong filter?)
Cu Selur
jackoneill
9th July 2016, 15:35
-> am I missing something? (some missing/wrong filter?)
Cu Selur
If you want to open a script in vspipe, vsedit, etc. you must use "clip.set_output()" (no parameters) instead of "clip.output(...)".
Selur
9th July 2016, 15:44
@jackoneill: Okay, I always used "clip.set_output()" for vsedit and 'clip.output(sys.stdout, y4m=1)' for vspipe so far without a problem.
-> changed 'clip.output(sys.stdout, y4m=1)' to 'clip.set_output()' but the sample problem still occurs.
I could upload the source and my Vapoursynth folder to my google drive if that would help.
-> Uploaded my Vapoursynth-folder to my GoogleDrive (https://drive.google.com/folderview?id=0B_WxUS1XGCPASUZibG5XZkRfeTg&usp=sharing), Vapoursynth.7z, password: d00m9
HolyWu
9th July 2016, 16:52
You probably encountered a bug in Compensate, which was introduced in this commit (https://github.com/dubhater/vapoursynth-mvtools/commit/5ee24a4cc5bfc954d3c207bdd0d5ddd2570e0232) at new line 270.
Selur
9th July 2016, 17:44
@HolyWu: you are probably right, using https://github.com/dubhater/vapoursynth-mvtools/releases/download/v14/vapoursynth-mvtools-v14-win64.7z instead of https://github.com/dubhater/vapoursynth-mvtools/releases/download/v14/vapoursynth-mvtools-v15-win64.7z fixes the crash. :) Thanks!
Reel.Deel
10th July 2016, 14:58
@HolyWu
Is QTGMC with all defaults settings the same as the avs version?
HolyWu
11th July 2016, 04:51
@HolyWu
Is QTGMC with all defaults settings the same as the avs version?
Yes, I think it is.
hydra3333
1st August 2016, 11:01
using the portable Vapoursynth version I tried to get QTGMC running using:
...
but I only get a 'VSPipe.exe has stopped working' with no further error message when calling:
"g:\Hybrid\Vapoursynth\VSPipe.exe" "h:\Temp\test.vpy" - --y4m | "g:\Hybrid\ffplay.exe" -
(same happens when I use vsedit)
-> am I missing something? (some missing/wrong filter?)
I get a similar crash in portable Vapoursynth when using this generic script (all the latest plugins downloaded).
It works fine with Preset up to "Fast" however "Medium" and up just get a 'VSPipe.exe has stopped working' with no further error message.
The commandline is
"C:\SOFTWARE\Vapoursynth\VSPipe.exe" --info ".\z.vpy" -
import vapoursynth as vs
#import havsfunc as haf # http://forum.doom9.org/showthread.php?t=166582
import havsfuncTS as haf # this version uses vanilla TemporalSoften instead of TemporalSoften2
import mvsfunc as mvs # http://forum.doom9.org/showthread.php?t=172564
core = vs.get_core(accept_lowercase=True) # leave off threads=8 so it auto-detects threads
#
core.std.LoadPlugin(r'C:\SOFTWARE\Vapoursynth\vapoursynth32\plugins\dll-to-choose-from\AddGrain.dll') # the r'' indicates do not treat special characters and accept backslashes
core.std.LoadPlugin(r'C:\SOFTWARE\Vapoursynth\vapoursynth32\plugins\dll-to-choose-from\d2vsource.dll') # the r'' indicates do not treat special characters and accept backslashes
core.std.LoadPlugin(r'C:\SOFTWARE\Vapoursynth\vapoursynth32\plugins\dll-to-choose-from\Deblock.dll') # the r'' indicates do not treat special characters and accept backslashes
core.std.LoadPlugin(r'C:\SOFTWARE\Vapoursynth\vapoursynth32\plugins\dll-to-choose-from\DFTTest.dll') # the r'' indicates do not treat special characters and accept backslashes
##core.std.LoadPlugin(r'C:\SOFTWARE\Vapoursynth\vapoursynth32\plugins\dll-to-choose-from\ffms2.dll') # the r'' indicates do not treat special characters and accept backslashes
core.std.LoadPlugin(r'C:\SOFTWARE\Vapoursynth\vapoursynth32\plugins\dll-to-choose-from\fmtconv.dll') # the r'' indicates do not treat special characters and accept backslashes
core.std.LoadPlugin(r'C:\SOFTWARE\Vapoursynth\vapoursynth32\plugins\dll-to-choose-from\KNLMeansCL.dll') # the r'' indicates do not treat special characters and accept backslashes
core.std.LoadPlugin(r'C:\SOFTWARE\Vapoursynth\vapoursynth32\plugins\dll-to-choose-from\libawarpsharp2.dll') # the r'' indicates do not treat special characters and accept backslashes
core.std.LoadPlugin(r'C:\SOFTWARE\Vapoursynth\vapoursynth32\plugins\dll-to-choose-from\libmvtools.dll') # the r'' indicates do not treat special characters and accept backslashes
core.std.LoadPlugin(r'C:\SOFTWARE\Vapoursynth\vapoursynth32\plugins\dll-to-choose-from\libnnedi3.dll') # the r'' indicates do not treat special characters and accept backslashes
##core.std.LoadPlugin(r'C:\SOFTWARE\Vapoursynth\vapoursynth32\plugins\dll-to-choose-from\temporalsoften2.dll') # the r'' indicates do not treat special characters and accept backslashes
core.std.LoadPlugin(r'C:\SOFTWARE\Vapoursynth\vapoursynth32\plugins\dll-to-choose-from\scenechange.dll') # http://forum.doom9.org/showthread.php?t=166769
core.std.LoadPlugin(r'C:\SOFTWARE\Vapoursynth\vapoursynth32\plugins\dll-to-choose-from\vsdctfilter.dll') # http://vfrmaniac.fushizen.eu/works
core.std.LoadPlugin(r'C:\SOFTWARE\Vapoursynth\vapoursynth32\plugins\dll-to-choose-from\vsfft3dfilter.dll') # http://vfrmaniac.fushizen.eu/works
core.std.LoadPlugin(r'C:\SOFTWARE\Vapoursynth\vapoursynth32\plugins\dll-to-choose-from\Yadifmod.dll') # the r'' indicates do not treat special characters and accept backslashes
core.avs.LoadPlugin(r'C:\SOFTWARE\Vapoursynth\DGIndex\DGDecodeNV.dll')
video = core.avs.DGSource(r'T:\HDTV\WDTVlive\MP4-VS\1\TEST1.dgi')
# QTGMC IN HERE (SLMODE=1 is spatial, SLMODE=2 is temporal)
# result is double framerate progressive, so re-interlate it later
video = mvs.AssumeTFF(video)
video = haf.QTGMC(video, TFF=True, Preset="medium")
#video = haf.QTGMC(video, TFF=True, Preset="Very Slow", Sharpness=1.2, SLMode=2, EZKeepGrain=1.2, NoiseProcess=2)
#video = haf.QTGMC(video, TFF=True, Preset="Ultra Fast",Sharpness=1.2,SLMode=1)
#video = haf.QTGMC(video, TFF=True, Preset="Super Fast",Sharpness=1.2,SLMode=1)
#video = haf.QTGMC(video, TFF=True, Preset="Very Fast",Sharpness=1.2,SLMode=1)
#video = haf.QTGMC(video, TFF=True, Preset="Faster",Sharpness=1.2,SLMode=1)
#video = haf.QTGMC(video, TFF=True, Preset="Fast",Sharpness=1.2,SLMode=1)
#video = haf.QTGMC(video, TFF=True, Preset="Medium",Sharpness=1.2,SLMode=1)
#video = haf.QTGMC(video, TFF=True, Preset="Slow",Sharpness=1.2,SLMode=1)
#video = haf.QTGMC(video, TFF=True, Preset="Slower",Sharpness=1.2,SLMode=1)
#video = haf.QTGMC(video, TFF=True, Preset="Very Slow",Sharpness=1.2,SLMode=1)
#video = haf.QTGMC(video, TFF=True, Preset="Very Slow",Sharpness=1.2,SLMode=2,EZKeepGrain=1.2,NoiseProcess=2)
#video = haf.QTGMC(video, TFF=True, Preset="Very Slow",Sharpness=1.2,NoiseProcess=2,GrainRestore=0.4,NoiseRestore=0.2,Sigma=1.8,NoiseDeint="Generate",StabilizeNoise=true)
#video = haf.QTGMC(video, TFF=True, Preset="Very Slow",,SLMode=2,EZKeepGrain=1.2,NoiseProcess=2)
video = core.std.SeparateFields(video, tff=True)
video = core.std.SelectEvery(video, cycle=4, offsets=[0, 3]) # looks like avisynth
video = haf.Weave(video, tff=True)
video = mvs.AssumeTFF(video)
video.set_output()
(havsfuncTS.py just changes the call to TemporalSoften2 into generic VapourSynth TemporalSoften instead)
hydra3333
1st August 2016, 11:29
Interestingly, any call to QTGMC makes this fail with a 'VSPipe.exe has stopped working' (comment out the QTGMC line and it works).
"C:\SOFTWARE\Vapoursynth\VSPipe.exe" ".\z.vpy" - --y4m | "C:\SOFTWARE\ffmpeg\0-homebuilt-x64\x264-mp4.exe" - --stdin y4m --thread-input --frames 294 --profile high --level 4.1 --preset veryslow --interlaced --tff --no-cabac --crf 22 --sar 64:45 --colormatrix bt470bg -o ".\test-full-hard.h264"
y4m [error]: bad sequence header magic
x264 [error]: could not open input file `-'
Even though this works:
"C:\SOFTWARE\Vapoursynth\VSPipe.exe" --info ".\z.vpy" -
Boulder
1st August 2016, 12:47
Which version of MVTools do you have? The latest one (v16) fixes a crash issue from v15.
hydra3333
1st August 2016, 14:22
Which version of MVTools do you have? The latest one (v16) fixes a crash issue from v15.
Well bless my cotton socks, thank you, it works now.
I thought I had MVTools v16 (I had it downloaded) however after I re-downloaded and re-extracted, and tried again ... no crash.
Beaut !
lansing
2nd August 2016, 19:50
the adjust.py file should be included in the required plugin in the readme
Myrsloik
2nd August 2016, 19:55
the adjust.py file should be included in the required plugin in the readme
Or even better, just copy a cut down version of the function used. It's only like 10 lines of code after you realize that saturation adjustment is the only function ever used in it.
Myrsloik
2nd August 2016, 23:35
Would it be possible to adapt the vinverse and vinverse2 functions for higher bitdepths? I think all that's needed is to make amnt change its default value depending on input.
...for integer formats at least.
HolyWu
3rd August 2016, 04:38
Would it be possible to adapt the vinverse and vinverse2 functions for higher bitdepths? I think all that's needed is to make amnt change its default value depending on input.
...for integer formats at least.
The included two functions in the script already support 8-16 bits...?
Myrsloik
3rd August 2016, 10:27
The included two functions in the script already support 8-16 bits...?
The problem is the defaults. By default the maximum change will br smaller the higher the bitdepth. Not what most users would expect...
Selur
13th August 2016, 07:47
@HolyWu: Do all the functions in havsfunc support all color formats (http://www.vapoursynth.com/doc/pythonreference.html#format-constants), or are there restrictions?
If there are could you please note which?
I saw for that LUTDeRainbow and LUTDeCrawl 'Requires YUV input, frame-based only' so that would mean that:
YUV420P8
YUV422P8
YUV444P8
YUV410P8
YUV411P8
YUV440P8
YUV420P9
YUV422P9
YUV444P9
YUV420P10
YUV422P10
YUV444P10
YUV420P16
YUV422P16
YUV444P16
YUV444PH
YUV444PS are all supported right?
Do all other functions work with all color formats?
feisty2
13th August 2016, 10:37
PH = half precision, I don't think any plugin except zimg takes such format..
and half precision is simply useless imho
Myrsloik
13th August 2016, 13:09
@HolyWu: Do all the functions in havsfunc support all color formats (http://www.vapoursynth.com/doc/pythonreference.html#format-constants), or are there restrictions?
If there are could you please note which?
I saw for that LUTDeRainbow and LUTDeCrawl 'Requires YUV input, frame-based only' so that would mean that:
YUV420P8
YUV422P8
YUV444P8
YUV410P8
YUV411P8
YUV440P8
YUV420P9
YUV422P9
YUV444P9
YUV420P10
YUV422P10
YUV444P10
YUV420P16
YUV422P16
YUV444P16
YUV444PH
YUV444PS are all supported right?
Do all other functions work with all color formats?
Spoiler: that's not all possible formats
hydra3333
17th August 2016, 04:13
Just noting for posterity per http://forum.doom9.org/showthread.php?p=1776066#post1776066 and the posts around it a recommendation to change the definition of the TemporalSoften function within havsfunc.py to use the stock standard TemporalSoften rather than a custom TemporalSoften2.
def TemporalSoften(clip, radius=4, luma_threshold=4, chroma_threshold=8, scenechange=15, mode=2):
core = vs.get_core()
if not isinstance(clip, vs.VideoNode):
raise TypeError('TemporalSoften: This is not a clip')
if scenechange:
clip = set_scenechange(clip, scenechange)
# edit to change from TemporalSoften2 to vanilla VapourSynth TemoporalSoften
# http://forum.doom9.org/showthread.php?p=1776066#post1776066
#return core.focus2.TemporalSoften2(clip, radius, luma_threshold, chroma_threshold, scenechange)
return core.focus.TemporalSoften(clip, radius, luma_threshold, chroma_threshold, scenechange)
hydra3333
24th August 2016, 03:03
Also, a link to what seems to possibly updates arising from vapoursynth R33 ?
http://forum.doom9.org/showthread.php?p=1778397#post1778397
(uses of removegrain and fmtconv)
hydra3333
24th August 2016, 14:41
A link showing QTGMC breaks with v9 of nnedi3 (v8 still works) http://forum.doom9.org/showthread.php?p=1778446#post1778446
AzraelNewtype
24th August 2016, 22:38
It's updated on github already, since about three hours after you reported it. Also the removegrain and resize changes were committed days before you mentioned them. Just grab the current master, don't worry so much about a "release" for a single file repo.
hydra3333
25th August 2016, 11:39
OK, beaut. Thank you AzraelNewtype !!
Tested and worked fine (still had to edit it per the below, but that's OK).
def TemporalSoften(clip, radius=4, luma_threshold=4, chroma_threshold=8, scenechange=15, mode=2):
core = vs.get_core()
if not isinstance(clip, vs.VideoNode):
raise TypeError('TemporalSoften: This is not a clip')
if scenechange:
clip = set_scenechange(clip, scenechange)
# edit to change from TemporalSoften2 to vanilla VapourSynth TemoporalSoften
# http://forum.doom9.org/showthread.php?p=1776066#post1776066
#return core.focus2.TemporalSoften2(clip, radius, luma_threshold, chroma_threshold, scenechange)
return core.focus.TemporalSoften(clip, radius, luma_threshold, chroma_threshold, scenechange)
STJAM
26th August 2016, 00:00
Seems that HQDeringmod still needs updating from vapoursynth R33.
fmask = core.generic.Hysteresis(core.std.Median(sobelm, planes=[0]), sobelm, planes=[0])
File "src\cython\vapoursynth.pyx", line 1105, in vapoursynth.Core.__getattr__ (src\cython\vapoursynth.c:20799)
AttributeError: No attribute with the name generic exists. Did you mistype a plugin namespace?
jackoneill
26th August 2016, 08:55
Seems that HQDeringmod still needs updating from vapoursynth R33.
fmask = core.generic.Hysteresis(core.std.Median(sobelm, planes=[0]), sobelm, planes=[0])
File "src\cython\vapoursynth.pyx", line 1105, in vapoursynth.Core.__getattr__ (src\cython\vapoursynth.c:20799)
AttributeError: No attribute with the name generic exists. Did you mistype a plugin namespace?
You can extract genericfilters.dll from the R32 portable archive.
STJAM
26th August 2016, 18:52
Thank you jackoneill it works wonderfully.
HolyWu
10th September 2016, 17:28
Update r24.
Replace some RemoveGrain modes with std.Median or std.Convolution.
santiag: Use the newer SangNom port.
HQDeringmod: Set chroma planes to gray when outputting mask clip.
QTGMC: Use the planes parameter instead of the deprecated ones for nnedi3.
srestore: Replace MinMax property with separate Min and Max for std.PlaneStats.
Overlay: Fix variable referenced before assignment error.
Boulder
10th September 2016, 17:29
Thanks!
Sm3n
24th September 2016, 08:08
Hmm, QTGMC is supposed to be a native part of the hav tools, right?! Cuz I'm getting some error about the name scd not existing:
Script evaluation failed:
Python exception: No attribute with the name scd exists. Did you mistype a plugin namespace?
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1489, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:26885)
File "f:\jobs\neela.vpy", line 10, in <module>
vid = haf.QTGMC (vid, InputType=0, Preset="Very Slow", TR2=3, TFF=True)
File "C:\Program Files\Python35\lib\site-packages\havsfunc.py", line 978, in QTGMC
if TR0 > 0: ts1 = TemporalSoften(bobbed, 1, 255 << shift, CMts << shift, 28 << shift, 2) # 0.00 0.33 0.33 0.33 0.00
File "C:\Program Files\Python35\lib\site-packages\havsfunc.py", line 4287, in TemporalSoften
clip = set_scenechange(clip, scenechange)
File "C:\Program Files\Python35\lib\site-packages\havsfunc.py", line 4319, in set_scenechange
sc = core.scd.Detect(sc, thresh)
File "src\cython\vapoursynth.pyx", line 1103, in vapoursynth.Core.__getattr__ (src\cython\vapoursynth.c:20711)
AttributeError: No attribute with the name scd exists. Did you mistype a plugin namespace?
Looks like you're missing the scene detection plugin.
Hello guys,
I got the same issue and I don't get what "scene detection plugin" is.
I'm running python and vapoursynth both 64 on windows machine also 64.
Failed to evaluate the script:
Python exception: No attribute with the name scd exists. Did you mistype a plugin namespace?
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1491, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:26905)
File "H:\Untitled.vpy", line 5, in <module>
video = haf.QTGMC(video, Preset='Medium', TFF=True, FPSDivisor=2)
File "C:\Users\XXX\AppData\Local\Programs\Python\Python35\lib\site-packages\havsfunc.py", line 958, in QTGMC
if TR0 > 0: ts1 = TemporalSoften(bobbed, 1, 255 << shift, CMts << shift, 28 << shift, 2) # 0.00 0.33 0.33 0.33 0.00
File "C:\Users\XXX\AppData\Local\Programs\Python\Python35\lib\site-packages\havsfunc.py", line 4313, in TemporalSoften
clip = set_scenechange(clip, scenechange)
File "C:\Users\XXX\AppData\Local\Programs\Python\Python35\lib\site-packages\havsfunc.py", line 4345, in set_scenechange
sc = core.scd.Detect(sc, thresh)
File "src\cython\vapoursynth.pyx", line 1105, in vapoursynth.Core.__getattr__ (src\cython\vapoursynth.c:20799)
AttributeError: No attribute with the name scd exists. Did you mistype a plugin namespace?
Is that something to do with "src\cython\vapoursynth.pyx" or "C:\Users\XXX\AppData\Local\Programs\Python\Python35\lib\site-packages\havsfunc.py"?
cheers
Mystery Keeper
24th September 2016, 09:20
Python exception: No attribute with the name scd exists. Did you mistype a plugin namespace?"scd" is namespace registered by scenchange (http://forum.doom9.org/showthread.php?t=166769) plugin.
Sm3n
24th September 2016, 12:11
"scd" is namespace registered by scenchange (http://forum.doom9.org/showthread.php?t=166769) plugin.
Thank you so much.
Can't wait for testing QTGMC on vapoursynth.
Thanks for sharing
TalasNetrag
7th November 2016, 00:31
Where can I get the adjust.py module?
sl1pkn07
7th November 2016, 00:33
https://github.com/dubhater/vapoursynth-adjust
Lynx_TWO
12th November 2016, 08:31
The Stab function (vital for BluRay transfers with old film) doesn't seem to work, at least not when using StaxRip. I get the error "Python exception: name 'havsfunc' is not defined"
This is odd, because SMDegrain works fine...
In StaxRip I'm using
clip = havsfunc.Stab(clip, range=1, dxmax=4, dymax=4, mirror=0)
SMDegrain works with:
clip = havsfunc.SMDegrain(clip, tr = 3, pel = 2, subpixel = 2, Str = 3.0, blksize = 8, overlap = 2, thSAD = 400, prefilter = 4, contrasharp = True, truemotion = True, RefineMotion = True)
Any ideas? :(
poisondeathray
14th November 2016, 05:01
The Stab function (vital for BluRay transfers with old film) doesn't seem to work, at least not when using StaxRip. I get the error "Python exception: name 'havsfunc' is not defined"
This is odd, because SMDegrain works fine...
In StaxRip I'm using
clip = havsfunc.Stab(clip, range=1, dxmax=4, dymax=4, mirror=0)
SMDegrain works with:
clip = havsfunc.SMDegrain(clip, tr = 3, pel = 2, subpixel = 2, Str = 3.0, blksize = 8, overlap = 2, thSAD = 400, prefilter = 4, contrasharp = True, truemotion = True, RefineMotion = True)
Any ideas? :(
just a guess, but if you used something like
import havsfunc as haf
Then you'd have to use "haf" instead of havsfunc.
ie.
clip = haf.SMDegrain....
But not sure why stab would work (I haven't used vapoursynth recently, I didn't even know stab was included in havsfunc, but stab seems to be working for me here, as smdegrain with the current havsfunc.py)
poisondeathray
14th November 2016, 05:02
1) I just updated vapoursynth and a bunch of plugins from an older vapoursynth version , and noticed on some tests that the vapoursynth QTGMC version seems to be faster than the MT avisynth version now . Maybe a year or two ago, it was consistently 10-25% slower (in some cases ~40% slower), now it's consistently 5-10% faster... measured in pipe speed and final encoding with x264. Sorry if this is common knowledge, but has something changed in the vpy world that can explain this ? Maybe some prereq's got optimized or something ? Or maybe some testing errors on my end ? Can anyone else run some quick tests ?
2) What are the differences between the avs version and vpy version of QTGMC ? I thought it was asked and answered before but I can't find it...
This post mentions the defaults are the same, but any other differences ?
http://forum.doom9.org/showpost.php?p=1773640&postcount=256
HolyWu
15th November 2016, 04:09
1) I just updated vapoursynth and a bunch of plugins from an older vapoursynth version , and noticed on some tests that the vapoursynth QTGMC version seems to be faster than the MT avisynth version now . Maybe a year or two ago, it was consistently 10-25% slower (in some cases ~40% slower), now it's consistently 5-10% faster... measured in pipe speed and final encoding with x264. Sorry if this is common knowledge, but has something changed in the vpy world that can explain this ? Maybe some prereq's got optimized or something ? Or maybe some testing errors on my end ? Can anyone else run some quick tests ?
The slowness you encountered was probably resulted from the lack of optimization in some core functions. That's why I provided an ICC build in http://forum.doom9.org/showthread.php?t=173406. In VS r33 the relevant functions has been optimized. I can't remember if mvtools or nnedi3 have their own optimization in recent releases as well so they maybe accumulate too.
2) What are the differences between the avs version and vpy version of QTGMC ? I thought it was asked and answered before but I can't find it...
This post mentions the defaults are the same, but any other differences ?
http://forum.doom9.org/showpost.php?p=1773640&postcount=256
I tried to keep identical settings in all their defaults when I ported every script function. The obvious differences are already mentioned in the first post.
poisondeathray
15th November 2016, 04:21
Thank you for the reply HolyWu and porting the scripts
JackCY
30th November 2016, 20:52
Can you update the OP or add GitHub readme with names and links to all required dependencies/3rd party scripts/DLLs?
xekon
4th December 2016, 00:40
I got it to install on Ubuntu 16.04:
cd ~/.installs/VapourSynthPlugins/
git clone https://github.com/HomeOfVapourSynthEvolution/havsfunc
git clone https://github.com/HomeOfVapourSynthEvolution/mvsfunc
git clone https://github.com/dubhater/vapoursynth-adjust
sudo cp ~/.installs/VapourSynthPlugins/havsfunc/havsfunc.py /usr/local/lib/python3.5/dist-packages
sudo cp ~/.installs/VapourSynthPlugins/mvsfunc/mvsfunc.py /usr/local/lib/python3.5/dist-packages
sudo cp ~/.installs/VapourSynthPlugins/vapoursynth-adjust/adjust.py /usr/local/lib/python3.5/dist-packages
I had trouble finding scenechange, but the below plugin pack worked: https://libraries.io/github/darealshinji/vapoursynth-plugins
sudo apt-get install git nasm yasm libtool pkg-config libfftw3-dev libpng-dev libsndfile1-dev libxvidcore-dev zlib1g-dev libopencv-dev ocl-icd-libopencl1 opencl-headers
cd $HOME/.installs/VapourSynthPlugins/
git clone https://github.com/darealshinji/vapoursynth-plugins.git
cd vapoursynth-plugins
./autogen.sh
./configure
make
sudo make install
xekon
5th December 2016, 01:07
An edit for havsfunc.py line 567:
fmask = core.misc.Hysteresis(core.std.Median(sobelm, planes=[0]), sobelm, planes=[0])
to
fmask = core.generic.Hysteresis(core.std.Median(sobelm, planes=[0]), sobelm, planes=[0])
Are_
5th December 2016, 09:25
genericfilters is deprecated.
xekon
6th December 2016, 02:02
oh, when i was getting the HQDeringmod function to work, I searched and read that genericfilters was now included in the core, the so i made that change and the function worked.
did things change and now genericfilters is going to be removed from core? or maybe they replaced it with something different?
Jindadil007
7th January 2017, 08:43
While importing havsfunc I get this error...
File "C:/DVD/Sample.vpy", line 3, in
import havsfunc
File "C:\Program Files\Python35\lib\site-packages\havsfunc.py", line 2, in
import mvsfunc as mvf
ImportError: No module named 'mvsfunc'
Can anyone guide me how to resolve this...
ChaosKing
7th January 2017, 10:32
You need to import mvsfunc
https://github.com/HomeOfVapourSynthEvolution/mvsfunc/blob/master/mvsfunc.py
Jindadil007
8th January 2017, 04:07
You need to import mvsfunc
https://github.com/HomeOfVapourSynthEvolution/mvsfunc/blob/master/mvsfunc.py
ManY Thanks...C.King !!!:)
Jindadil007
8th January 2017, 04:48
Thanks
Jindadil007
8th January 2017, 15:16
Hi... I have vapoursynth FFT3dFilter.dll and I have placed it in Vapoursynth plugins folder. I am getting this error when applying FFT3DFilter :
2017-01-08 19:43:25.978
Failed to evaluate the script:
Python exception: No attribute with the name fft3dfilter exists. Did you mistype a plugin namespace?
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1491, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:26905)
File "C:/DVD/NK.vpy", line 8, in
video = haf.FastLineDarkenMOD(video)
File "src\cython\vapoursynth.pyx", line 1105, in vapoursynth.Core.__getattr__ (src\cython\vapoursynth.c:20799)
AttributeError: No attribute with the name fft3dfilter exists. Did you mistype a plugin namespace?
Here is my script :
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
video = core.ffms2.Source(r'C:\DVD\NK.avi')
video = core.vivtc.VFM(video, order=1, mode=5, cthresh=10)
video = core.vivtc.VDecimate(video, cycle=5)
video = core.std.CropRel(video, 4,4,2,2)
video = core.fft3dfilter.FFT3DFilter(video, sigma=1.5, bt=5, bw=32, bh=32, ow=16, oh=16, sharpen=0.4)
video = haf.FastLineDarkenMOD(video)
video = core.resize.Spline36(video, width=640,height=480, format=vs.YUV420P8, matrix_in_s="709")
video.set_output()
What I am doing wrong ? Thanks
Are_
8th January 2017, 15:25
The script looks good, maybe you are trying to load a 32bit dll and using the 64bit vspipe or the other way around.
Where did the dll come from? Where exactly did you put it?
ChaosKing
8th January 2017, 15:32
FFT3DFilter requires libfftw3f-3.dll to be in the search path. http://www.fftw.org/install/windows.html
Put it in system32 folder. I think the same directory as the main plugin should also work with vapoursynth.
Jindadil007
8th January 2017, 16:22
The script looks good, maybe you are trying to load a 32bit dll and using the 64bit vspipe or the other way around.
Where did the dll come from? Where exactly did you put it?
Hi...Its 64 bit dll for vapoursynth downloaded from this forum only...
Are_
8th January 2017, 16:25
FFT3DFilter requires libfftw3f-3.dll to be in the search path. http://www.fftw.org/install/windows.html
Put it in system32 folder. I think the same directory as the main plugin should also work with vapoursynth.
Yeah, that's probably it.
Jindadil007
8th January 2017, 16:28
FFT3DFilter requires libfftw3f-3.dll to be in the search path. http://www.fftw.org/install/windows.html
Put it in system32 folder. I think the same directory as the main plugin should also work with vapoursynth.
Its already there in System32 as well as SysWOW64 folder. Would try to paste it in Vapoursyn th plugin folder and test the results. Thanks
Jindadil007
8th January 2017, 16:49
FFT3DFilter requires libfftw3f-3.dll to be in the search path. http://www.fftw.org/install/windows.html
Put it in system32 folder. I think the same directory as the main plugin should also work with vapoursynth.
Many Thanks Cking...Putting it in Vapoursynth plugin folder did the trick...:thanks:
Can you please share command for x264 output with 2 pass encoding ? I need to capture these parameters in output mkv file ... subq=6: partitions=all:8x8dct:me=umh:frameref=5:bframes=3:b_pyramid=normal:weight_b
:thanks:
Mystery Keeper
8th January 2017, 16:59
Many Thanks Cking...Putting it in Vapoursynth plugin folder did the trick...:thanks:
Can you please share command for x264 output with 2 pass encoding ? I need to capture these parameters in output mkv file ... subq=6: partitions=all:8x8dct:me=umh:frameref=5:bframes=3:b_pyramid=normal:weight_b
:thanks:My preset for x264 encoding with Y4M header in VapourSynth Editor r13:--demuxer y4m
--pass 1
--bitrate 3000
--stats "{sd}/{sn}.stats"
--slow-firstpass
--min-keyint 1
--b-adapt 1
--ref 5
--bframes 4
--vbv-init 1.0
--ratetol 100.0
--qcomp 0
--cplxblur 0
--qblur 0
--rc-lookahead 250
--aq-mode 2
--merange 64
--me tesa
--subme 11
--partitions all
--trellis 2
--no-dct-decimate
--stitchable
--direct auto
--no-psy
--no-progress
-
-o "{sd}/{sn}.mkv"
Jindadil007
8th January 2017, 17:26
My preset for x264 encoding with Y4M header in VapourSynth Editor r13:--demuxer y4m
--pass 1
--bitrate 3000
--stats "{sd}/{sn}.stats"
--slow-firstpass
--min-keyint 1
--b-adapt 1
--ref 5
--bframes 4
--vbv-init 1.0
--ratetol 100.0
--qcomp 0
--cplxblur 0
--qblur 0
--rc-lookahead 250
--aq-mode 2
--merange 64
--me tesa
--subme 11
--partitions all
--trellis 2
--no-dct-decimate
--stitchable
--direct auto
--no-psy
--no-progress
-
-o "{sd}/{sn}.mkv"
Many Thanks "MK" ... I would try it... Currently working on QTGMC script where i am getting errors...:thanks:
Jindadil007
9th January 2017, 13:44
Thank you so much.
Can't wait for testing QTGMC on vapoursynth.
Thanks for sharing
Hi...Script works fine till I introduce QTGMC in script. It is showing this error :
Failed to evaluate the script:
Python exception: There is no attribute or namespace named fmtc
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1491, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:26905)
File "C:/DVD/Sample.vpy", line 6, in
video = core.d2v.Source(r'C:\DVD\Sample.d2v')
File "C:\Program Files\Python35\lib\site-packages\havsfunc.py", line 943, in QTGMC
bobbed = Bob(clip, 0, 0.5, TFF)
File "C:\Program Files\Python35\lib\site-packages\havsfunc.py", line 4128, in Bob
clip = core.std.SeparateFields(clip, tff).fmtc.resample(scalev=2, kernel='bicubic', a1=b, a2=c, interlaced=1, interlacedd=0)
File "src\cython\vapoursynth.pyx", line 833, in vapoursynth.VideoNode.__getattr__ (src\cython\vapoursynth.c:16042)
AttributeError: There is no attribute or namespace named fmtc
I have following 64bit dll files in Vapoursynth plugins 64 folder : AddGrain, continuity, d2vsource, dctfilter, DFTTest, ffms2, FFT3DFilter, flash3kyuu_deband, KNLMeansCL, libawarpsharp2, libbifrost, libfftw3-3, libfftw3f-3, libfftw3l-3, libmvtools, libnnedi3, ReduceFlicker, scenechange, TDeintMod, temporalsoften, TNLMeans, vcmod, vs_sangnommod, vsavsreader & vslsmashsource. All these dll files have been copied to SysWOW64 as well as system32 folder.
Here is my script :
import vapoursynth as vs
import adjust
import havsfunc as haf
core = vs.get_core()
video = core.d2v.Source(r'C:\DVD\Sample.d2v')
video = haf.QTGMC(video, Preset='Medium', TFF=True)
video.set_output()
Any help in getting QTGMC working would be highly appreciated... :thanks:
ChaosKing
9th January 2017, 14:10
1. Don't copy the filters in system32.
2. As the error msg shows, you are missing another plugin: fmtc
Here's a nearly complete list of availible plugins: http://www.vapoursynth.com/doc/pluginlist.html
You need fmtconv – High quality bitdepth, colorspace conversion and resizing
Jindadil007
9th January 2017, 15:12
1. Don't copy the filters in system32.
2. As the error msg shows, you are missing another plugin: fmtc
Here's a nearly complete list of availible plugins: http://www.vapoursynth.com/doc/pluginlist.html
You need fmtconv – High quality bitdepth, colorspace conversion and resizing
Hi CK...Many Thanks :)... Looks I am just close... Now this error is showing up :
2017-01-09 19:40:43.605
Core freed but 4 filter instances still exist
Core freed but 4 filter instances still exist
Core freed but 1612800 bytes still allocated in framebuffers
Core freed but 1612800 bytes still allocated in framebuffers
What's this all about ?
Thanks
Mystery Keeper
9th January 2017, 15:41
Hi CK...Many Thanks :)... Looks I am just close... Now this error is showing up :
2017-01-09 19:40:43.605
Core freed but 4 filter instances still exist
Core freed but 4 filter instances still exist
Core freed but 1612800 bytes still allocated in framebuffers
Core freed but 1612800 bytes still allocated in framebuffers
What's this all about ?
ThanksIt is a leak caused by faulty plugins not freeing references on destruction. Please post your script.
Jindadil007
9th January 2017, 18:11
It is a leak caused by faulty plugins not freeing references on destruction. Please post your script.
Many Thanks MK...Resolved it by downloading nnedi3_weights :o
Myrsloik
9th January 2017, 18:27
Many Thanks MK...Resolved it by downloading nnedi3_weights :o
The leak happens in a few rare error paths on nnedi3. It will be fixed soon.
Jindadil007
10th January 2017, 02:57
The leak happens in a few rare error paths on nnedi3. It will be fixed soon.
That would be great...However while rendering a 23.976 fps clip with QTGMC with default command of preset and TFF, it gave an output which doubled the output fps, in Avisynth I used selecteven() or distributor() to keep original fps. How should it be used in python ? Thanks !!!
Sent from my GT-N8000 using Tapatalk
VS_Fan
10th January 2017, 07:34
From the python reference (http://www.vapoursynth.com/doc/pythonreference.html) at the vapoursynth website (silicing a clip (http://www.vapoursynth.com/doc/pythonreference.html#slicing-and-other-syntactic-sugar)):
Select even numbered frames:
video = clip[::2]
Select odd numbered frames:
video = clip[1::2]
Also, from the SelectEvery (http://www.vapoursynth.com/doc/functions/selectevery.html) function:
Return even numbered frames, starting with 0:
SelectEvery(clip=clip, cycle=2, offsets=0)
Return odd numbered frames, starting with 1:
SelectEvery(clip=clip, cycle=2, offsets=1)
Remember Search (https://www.google.com/search?q=selecteven+site%3Avapoursynth.com&ie=utf-8&oe=utf-8) is your fiend
Jindadil007
10th January 2017, 16:57
From the python reference (http://www.vapoursynth.com/doc/pythonreference.html) at the vapoursynth website (silicing a clip (http://www.vapoursynth.com/doc/pythonreference.html#slicing-and-other-syntactic-sugar)):
Select even numbered frames:
video = clip[::2]
Select odd numbered frames:
video = clip[1::2]
Also, from the SelectEvery (http://www.vapoursynth.com/doc/functions/selectevery.html) function:
Return even numbered frames, starting with 0:
SelectEvery(clip=clip, cycle=2, offsets=0)
Return odd numbered frames, starting with 1:
SelectEvery(clip=clip, cycle=2, offsets=1)
Remember Search (https://www.google.com/search?q=selecteven+site%3Avapoursynth.com&ie=utf-8&oe=utf-8) is your fiend
Hi Thanks... i read it but was confused with odd no. Or even no. Frames. What function i should use to keep intact 23.976 fps & 29.970 fps. It would be great if you explain this...
Sent from my GT-N8000 using Tapatalk
Boulder
10th January 2017, 17:02
As far as I know, QTGMC has the option to output single-rate video. The FPSDivisor parameter controls the output. There's also the option to use some motion blur.
buchanan
10th January 2017, 18:44
Hi,
I tried to run QTGMC with the latest version of havsfunc.py (9th november) from github and on Vapoursynth R35, but i get a "No attribute with the name focus2 exists" in relation to the line "return core.focus2.TemporalSoften2 etc"
What could be the problem ?
Are_
10th January 2017, 19:44
http://forum.doom9.org/showthread.php?t=166769 and on the second page there is a 64bit version.
buchanan
10th January 2017, 19:56
http://forum.doom9.org/showthread.php?t=166769 and on the second page there is a 64bit version.
I use the 64bit version and now that I loaded temporalsoften.dll and scenechange.dll from the x64 package, I get a similar error:
"No attribute with the name focus exists", related to core.focus.TemporalSoften :-S
Are_
10th January 2017, 19:59
For focus you need https://github.com/dubhater/vapoursynth-temporalsoften
buchanan
10th January 2017, 20:04
For focus you need https://github.com/dubhater/vapoursynth-temporalsoften
Thanks ! It's working now.
I don't remember that I needed those plugins with Vapoursynth R33.1, which I used until now.
Jindadil007
13th January 2017, 14:21
[QUOTE=HolyWu;1603132]https://github.com/HomeOfVapourSynthEvolution/havsfunc
Hi...Thanks for sharing this script. I have successfully render the file with QTGMC. However, I do not know how I can keep the original frame rate intact. After rendering, I am getting double frame rate instead of original.
Pl. guide how to fix this. In avisynth I used functions but its not working in python.
Thanks...:thanks:
Jindadil007
13th January 2017, 14:22
My preset for x264 encoding with Y4M header in VapourSynth Editor r13:--demuxer y4m
--pass 1
--bitrate 3000
--stats "{sd}/{sn}.stats"
--slow-firstpass
--min-keyint 1
--b-adapt 1
--ref 5
--bframes 4
--vbv-init 1.0
--ratetol 100.0
--qcomp 0
--cplxblur 0
--qblur 0
--rc-lookahead 250
--aq-mode 2
--merange 64
--me tesa
--subme 11
--partitions all
--trellis 2
--no-dct-decimate
--stitchable
--direct auto
--no-psy
--no-progress
-
-o "{sd}/{sn}.mkv"
Hi MK...this is 1 pass or 2 pass ?
Mystery Keeper
13th January 2017, 16:14
Hi MK...this is 1 pass or 2 pass ?This is a template for multipass.
"--pass 1" for the first pass.
Change it to "--pass 3" for subsequent passes or "--pass 2" for the final pass. I personally just use "--pass 3" for every subsequent pass even if I only do 2 passes. The difference is that "--pass 3" updates the stat files and "--pass 2" doesn't.
Jindadil007
14th January 2017, 03:50
This is a template for multipass.
"--pass 1" for the first pass.
Change it to "--pass 3" for subsequent passes or "--pass 2" for the final pass. I personally just use "--pass 3" for every subsequent pass even if I only do 2 passes. The difference is that "--pass 3" updates the stat files and "--pass 2" doesn't.
Many Thanks MK...Is this right...Bitrate can be changed based on target file size...
--demuxer y4m
--pass 3
--bitrate 3000
--stats "{sd}/{sn}.stats"
--slow-firstpass
--min-keyint 1
--b-adapt 1
--ref 5
--bframes 4
--vbv-init 1.0
--ratetol 100.0
--qcomp 0
--cplxblur 0
--qblur 0
--rc-lookahead 250
--aq-mode 2
--merange 64
--me tesa
--subme 11
--partitions all
--trellis 2
--no-dct-decimate
--stitchable
--direct auto
--no-psy
--no-progress
-
-o "{sd}/{sn}.mkv"
One more thing...is it incorrect to mention these command parameters ?
--level 4.1 --preset slower --deblock -1:-1 --qpmin 10 --qpmax 51 --vbv-bufsize 78125 --vbv-maxrate 62500
Thanks !!!
Mystery Keeper
14th January 2017, 04:21
Many Thanks MK...Is this right...Bitrate can be changed based on target file size...
--demuxer y4m
--pass 3
--bitrate 3000
--stats "{sd}/{sn}.stats"
--slow-firstpass
--min-keyint 1
--b-adapt 1
--ref 5
--bframes 4
--vbv-init 1.0
--ratetol 100.0
--qcomp 0
--cplxblur 0
--qblur 0
--rc-lookahead 250
--aq-mode 2
--merange 64
--me tesa
--subme 11
--partitions all
--trellis 2
--no-dct-decimate
--stitchable
--direct auto
--no-psy
--no-progress
-
-o "{sd}/{sn}.mkv"
One more thing...is it incorrect to mention these command parameters ?
--level 4.1 --preset slower --deblock -1:-1 --qpmin 10 --qpmax 51 --vbv-bufsize 78125 --vbv-maxrate 62500
Thanks !!!Sorry, but I'm not expert either. I made my preset based on how I understood the help.
HolyWu
14th January 2017, 14:08
Hi...Thanks for sharing this script. I have successfully render the file with QTGMC. However, I do not know how I can keep the original frame rate intact. After rendering, I am getting double frame rate instead of original.
Pl. guide how to fix this. In avisynth I used functions but its not working in python.
Thanks...:thanks:
By default QTGMC outputs video at "double-rate", twice the frame rate of the source. By setting FPSDivisor to 2, every second frame is dropped and the output frame rate is the same as the source ("single-rate").
Jindadil007
14th January 2017, 16:57
By default QTGMC outputs video at "double-rate", twice the frame rate of the source. By setting FPSDivisor to 2, every second frame is dropped and the output frame rate is the same as the source ("single-rate").
Hi...Thanks...would appreciate if you share the command example...i am a newbie to python...
Sent from my GT-N8000 using Tapatalk
tObber166
14th January 2017, 20:30
@Jindadil007:
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
v = core.lsmas.LWLibavSource(source = r'F:\clip.mkv')
v = haf.QTGMC(v, Preset='Fast', TFF=True, FPSDivisor=2)
v.set_output()
Or:
v = haf.QTGMC(v, Preset='Fast', TFF=True)
v = v[::2]
Jindadil007
15th January 2017, 05:33
@Jindadil007:
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
v = core.lsmas.LWLibavSource(source = r'F:\clip.mkv')
v = haf.QTGMC(v, Preset='Fast', TFF=True, FPSDivisor=2)
v.set_output()
Or:
v = haf.QTGMC(v, Preset='Fast', TFF=True)
v = v[::2]
Many Thanks tObber...It was really helpful:thanks:
AMED
20th February 2017, 09:56
Would it be possible to add in the prefilter 1 and prefilter 2 modes for SMDegrain please?
(prefilter==1) ? input8.MinBlur(1,Chr,planar)
(prefilter==2) ? input8.MinBlur(2,Chr,planar)
HolyWu
21st February 2017, 05:00
Would it be possible to add in the prefilter 1 and prefilter 2 modes for SMDegrain please?
I replace MinBlur with sbr for prefilter 1&2 on purpose. sbr is faster on 16-bit input, especially prefilter 2. You can still feed the prefiltered clip with your favorite denoiser to SMDegrain like this:
foo = haf.SMDegrain(foo, prefilter=haf.MinBlur(foo, 2))
AMED
21st February 2017, 08:36
My apologies, I didn't notice that it had been put in the else statement.
KingLir
17th April 2017, 17:47
Hi, I am having a problem with srestore. Maybe I just don't know how to use it properly. I am using latest VapourSynth and HAvsFunc.
I am running the following script on PAL DVD (tv animation) and it finish encoding on the first frame - but runs OK (on all frames) when I remove the srestore row.
clip = core.ffms2.Source(source=filename)
clip = haf.QTGMC(clip, Preset='Placebo', TFF=True)
clip = haf.srestore(source=clip)
clip.set_output()
Anyone have an idea ?
Selur
17th April 2017, 18:16
Using Interframe:
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'G:/Hybrid/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/vsfilters/FrameFilter/Interframe/svpflow2_vs64.dll")
core.std.LoadPlugin(path="G:/Hybrid/vsfilters/FrameFilter/Interframe/svpflow1_vs64.dll")
core.std.LoadPlugin(path="G:/Hybrid/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import havsfunc as havsfunc
# Loading F:\TestClips&Co\test.avi using LWLibavSource
clip = core.lsmas.LWLibavSource(source="F:/TESTCL~1/test.avi", format="YUV420P8", cache=0)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg")
# making sure input color range is set to TV (16-235) scale.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# adjusting frame count with Interframe/SVP
clip = havsfunc.InterFrame(clip, Preset="fastest", NewNum=60, NewDen=1, GPU=True)
# Output
clip.set_output()
I get: "SVSmoothFps: unable to init GPU-based renderer - code 255" any clue what I'm missing? (Got an NVIDIA Geforce 980 Ti with driver version 381.65)
(Interframe works fine when using through Avisynth)
Cu Selur
HolyWu
18th April 2017, 17:30
Hi, I am having a problem with srestore. Maybe I just don't know how to use it properly. I am using latest VapourSynth and HAvsFunc.
I am running the following script on PAL DVD (tv animation) and it finish encoding on the first frame - but runs OK (on all frames) when I remove the srestore row.
clip = core.ffms2.Source(source=filename)
clip = haf.QTGMC(clip, Preset='Placebo', TFF=True)
clip = haf.srestore(source=clip)
clip.set_output()
Anyone have an idea ?
It works fine here. Can you preview your script in VapourSynth Editor?
HolyWu
18th April 2017, 17:36
I get: "SVSmoothFps: unable to init GPU-based renderer - code 255" any clue what I'm missing? (Got an NVIDIA Geforce 980 Ti with driver version 381.65)
(Interframe works fine when using through Avisynth)
Cu Selur
I just tried it on my GTX 660 with driver 378.78 and it works fine. Since it's an initialization error in the filter itself, I guess you need to report the issue to the SVP team rather than here.
Selur
18th April 2017, 18:01
@HolyWu: Thank for testing. Will do. -> https://www.svp-team.com/forum/viewtopic.php?pid=64820
KingLir
18th April 2017, 21:12
Can you preview your script in VapourSynth Editor?
Thank you for checking. I don't know how to use VapourSynth Editor - can you instruct me on macOS ?
Maybe you can just figure it out by looking at the mkv ? I tested with other mkvs (from NTSC DVDs) - and the issue didn't happen.
As my script shows, I am trying to run srestore after QTGMC x2 (50 fps) and if I just comment out the srestore row - it runs OK.
I test encoding with:
vspipe --y4m --arg "filename=input.mkv" deinterlacer_QTGMC_PAL_script.vpy - | ffmpeg -thread_queue_size 1024 -i pipe: -map 0:0 -aspect 720:540 -c:v h264 -preset ultrafast -crf 0 input1.mkv
And getting:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Finishing stream 0:0 without any data written to it.
Here is download link for a small test (that still reproduce the issue):
https://mega.nz/#!4tZxmYxD!lvoe7etj_Oelx_P8_xl7m_u6-PKwJ1ryoaadAuA6NCA
And here is it's mediainfo:
https://pastebin.com/LfYr6gpr
Selur
19th April 2017, 04:23
SVSmoothFps: unable to init GPU-based renderer - code 255
Was fixed by reinstalling the drivers,..
Pat357
19th April 2017, 15:23
I get: "SVSmoothFps: unable to init GPU-based renderer - code 255" any clue what I'm missing? (Got an NVIDIA Geforce 980 Ti with driver version 381.65)
(Interframe works fine when using through Avisynth)
Cu Selur
I suspect that you use the SVP 4.x DDL's, aren't you ?
They have a different syntax then the older DLL's from the Interframe project.
This works on my system :
import vapoursynth as vs
core = vs.get_core(threads=8)
core.std.LoadPlugin(r"c:\Program Files (x86)\VapourSynth\filters\svpflow-4.0.0.128\x64\svpflow1_vs64.dll")
core.std.LoadPlugin(r"c:\Program Files (x86)\VapourSynth\filters\svpflow-4.0.0.128\x64\svpflow2_vs64.dll")
clip = core.ffms2.Source(r"k:\film\Beyond.2014.1080p.BluRay.H264.AAC-RARBG\Beyond.2014.1080p.BluRay.H264.AAC-RARBG.mp4")
super_params="{pel:2,gpu:1}"
analyse_params="{}"
smoothfps_params="{rate:{num:5,den:2}}"
super = core.svp1.Super(clip,super_params)
vectors= core.svp1.Analyse(super["clip"],super["data"],clip,analyse_params)
smooth = core.svp2.SmoothFps(clip,super["clip"],super["data"],vectors["clip"],vectors["data"],smoothfps_params)
# smooth = core.std.AssumeFPS(smooth,fpsnum=smooth.fps_num,fpsden=smooth.fps_den)
smooth.set_output()
Selur
19th April 2017, 17:21
I suspect that you use the SVP 4.x DDL's, aren't you ?
I used the latest plugins download from their homepage: (http://www.svp-team.com/files/gpl/svpflow-4.0.0.128.zip)
and like I post reinstalling the drivers fixed the issue for me, no need to change the script.
HolyWu
19th April 2017, 18:55
I test encoding with:
vspipe --y4m --arg "filename=input.mkv" deinterlacer_QTGMC_PAL_script.vpy - | ffmpeg -thread_queue_size 1024 -i pipe: -map 0:0 -aspect 720:540 -c:v h264 -preset ultrafast -crf 0 input1.mkv
And getting:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Finishing stream 0:0 without any data written to it.
Here is download link for a small test (that still reproduce the issue):
https://mega.nz/#!4tZxmYxD!lvoe7etj_Oelx_P8_xl7m_u6-PKwJ1ryoaadAuA6NCA
And here is it's mediainfo:
https://pastebin.com/LfYr6gpr
The core resize filter complains about unrecognized transfer characteristics and unrecognized color primaries with your mkv, so the script can't be evaluated at all. I'm not sure why _Transfer=5 and _Primaries=5 are not accepted. Anyway, I update srestore to only do format conversion when necessary. Grab the latest raw file from GitHub then.
ChaosKing
20th April 2017, 09:19
I just downloaded the newest version of your script.
But I get this error:
567: fmask = core.misc.Hysteresis(core.std.Median(sobelm, planes=[0]), sobelm, planes=[0])
AttributeError: There is no function named Hysteresis
I works when I change misc to generic. I'm using genericfilters from R32.
Is there a newer version available somewhere?
HolyWu
20th April 2017, 15:52
But I get this error:
567: fmask = core.misc.Hysteresis(core.std.Median(sobelm, planes=[0]), sobelm, planes=[0])
AttributeError: There is no function named Hysteresis
I works when I change misc to generic. I'm using genericfilters from R32.
Is there a newer version available somewhere?
There is something wrong in your VS installation. It loads a misc plugin that doesn't have the Hysteresis filter, which is not possible as it's already included since R36.
ChaosKing
20th April 2017, 16:29
hmm I re-downloaded the R37 coreplugins and removed all dlls from the plugins folder. Only left ffms2.
Also tried a fresh R37 x64 portable. Same error :/
Genericfilters is not a seperate plugin (dll) anymore, correct?
HolyWu
20th April 2017, 18:37
hmm I re-downloaded the R37 coreplugins and removed all dlls from the plugins folder. Only left ffms2.
Also tried a fresh R37 x64 portable. Same error :/
Genericfilters is not a seperate plugin (dll) anymore, correct?
Search for filename "miscfilter" in your entire hard drive and see what you get.
GenericFilters is obsolete and not included in the windows installer anymore.
ChaosKing
20th April 2017, 18:42
Found nothing. But I'm only using the portable version. So maybe it is not included?
TheFluff
20th April 2017, 19:24
MiscFilters.dll appears to be missing from the portable .7z, yes (it should be in the coreplugins folder).
KingLir
20th April 2017, 20:02
The core resize filter complains about unrecognized transfer characteristics and unrecognized color primaries with your mkv, so the script can't be evaluated at all. I'm not sure why _Transfer=5 and _Primaries=5 are not accepted. Anyway, I update srestore to only do format conversion when necessary. Grab the latest raw file from GitHub then.
Thank you! Seems to work well.
ChaosKing
20th April 2017, 21:52
I took the miscfilters.dll from the installer. All good now.
Pat357
24th April 2017, 22:40
I'm trying to use SMDegrain with pelclip, but got an error on
"import nnedi3_resample as nnrs" , nnedi3_resample not found.
Can you please point me were to get this ?
Why not include all the needed scripts for HAvsFunc to work inside HAvsFunc ?
Thanks !
Are_
24th April 2017, 22:44
https://github.com/mawen1250/VapourSynth-script
tuanden0
12th May 2017, 04:38
Can someone help me fix that error?
Failed to evaluate the script:
Python exception: No attribute with the name scd exists. Did you mistype a plugin namespace?
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1821, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:36464)
File "E:/Download/test.vpy", line 9, in
video = haf.LSFmod(video)
File "C:\Users\Home\AppData\Local\Programs\Python\Python36\lib\site-packages\havsfunc.py", line 4072, in LSFmod
diff = core.std.Expr([diff, TemporalSoften(diff, 1, 255 File "C:\Users\Home\AppData\Local\Programs\Python\Python36\lib\site-packages\havsfunc.py", line 4312, in TemporalSoften
clip = set_scenechange(clip, scenechange)
File "C:\Users\Home\AppData\Local\Programs\Python\Python36\lib\site-packages\havsfunc.py", line 4344, in set_scenechange
sc = core.scd.Detect(sc, thresh)
File "src\cython\vapoursynth.pyx", line 1390, in vapoursynth.Core.__getattr__ (src\cython\vapoursynth.c:29151)
AttributeError: No attribute with the name scd exists. Did you mistype a plugin namespace?
I fixed, there were missing some file in here:
https://forum.doom9.org/showthread.php?t=166769
HolyWu
6th June 2017, 14:05
Update r26.
srestore: Only do format conversion when necessary.
Deprecate the use of focus2/scd plugin and use misc plugin instead.
MinBlur: Remove workaround for CTMF in r=2 when input is 16 bits.
HolyWu
23rd October 2017, 15:16
Update r27.
Add TemporalDegrain and aaf functions. (Hinterwaeldlers)
HQDeringmod: Keep up with the changes in std.Sobel.
santiag, QTGMC: Use the optimized eedi3 filter instead of the bundled one.
daa, santiag, QTGMC: Add opencl parameter. The OpenCL version of eedi3/nnedi3 will be used when set to true. By default it's set to false and uses the CPU version like before.
KingLir
25th November 2017, 20:26
When adding the new opencl parameter to my working QTGMC line (below) I am getting the following error. Any ideas what I need to do ?
clip = haf.QTGMC(clip, Preset='Placebo', MatchPreset='Placebo', MatchPreset2='Placebo', EdiQual=2, SourceMatch=3, TR1=2, TR2=3, Lossless=2, EZKeepGrain=0.0, EZDenoise=0.4, Sharpness=0.5, TFF=True, opencl=True)
File "/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/havsfunc.py", line 1114, in QTGMC
edi1 = QTGMC_Interpolate(ediInput, InputType, EdiMode, NNSize, NNeurons, EdiQual, EdiMaxD, bobbed, ChromaEdi, TFF, opencl)
File "/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/havsfunc.py", line 1401, in QTGMC_Interpolate
interp = myNNEDI3(Input, field=field, planes=planes, nsize=NNSize, nns=NNeurons, qual=EdiQual)
File "src/cython/vapoursynth.pyx", line 1722, in vapoursynth.Function.__call__
vapoursynth.Error: NNEDI3CL: Invalid Program
HolyWu
26th November 2017, 05:42
When adding the new opencl parameter to my working QTGMC line (below) I am getting the following error. Any ideas what I need to do ?
vapoursynth.Error: NNEDI3CL: Invalid Program
Can you confirm that your GPU supports OpenCL 1.2? If so, can you run the latest version of KNLMeansCL as well?
KingLir
26th November 2017, 11:29
Can you confirm that your GPU supports OpenCL 1.2? If so, can you run the latest version of KNLMeansCL as well?
The GPU does support it. I got iMac (Retina 5K, 27-inch, Late 2015) with AMD Radeon R9 M395X (4GB VRAM) with OpenCL 1.2 support as shown here:
https://support.apple.com/en-il/HT202823
Latest macOS (and therefore latest drivers and OpenCL Apple framework Version 2.8.11) installed.
Actually latest KNLMeansCL version works (but with some artifacts - precision issue). KNLMeansCL log also state that i got OpenCL 1.2 .
HolyWu
26th November 2017, 20:00
The GPU does support it. I got iMac (Retina 5K, 27-inch, Late 2015) with AMD Radeon R9 M395X (4GB VRAM) with OpenCL 1.2 support as shown here:
https://support.apple.com/en-il/HT202823
Please recompile the source from debug branch (https://github.com/HomeOfVapourSynthEvolution/VapourSynth-NNEDI3CL/tree/debug) and post the result to somewhere like pastebin.
KingLir
26th November 2017, 22:48
Please recompile the source from debug branch (https://github.com/HomeOfVapourSynthEvolution/VapourSynth-NNEDI3CL/tree/debug) and post the result to somewhere like pastebin.
Thanks. Here:
https://pastebin.com/8PMj2ZEm
HolyWu
27th November 2017, 08:14
Thanks. Here:
https://pastebin.com/8PMj2ZEm
Please try the latest commit in debug branch again, thanks.
KingLir
27th November 2017, 13:07
Please try the latest commit in debug branch again, thanks.
Thanks ! It works now.
1. The output is different as without OpenCL use - smaller file size. I also used binary compare and found 1975 changes all across the file - not limited to specific part of the file.
These are 2 new encodes I just did with the only different is the added " opencl=True ".
Although playing both looks the same.
Any idea why ?
2. Will you be able to set the configure file to use " -framework OpenCL " instead of " -lOpenCL " when creating the makefile on macOS ? I am doing it manually each time.
3. The performance of QTGMC CL (the specific line I use is on my previous post) is a bit slower comparing to without the opencl=True .
I guess my CPU is just better for this than my GPU.
EDIT: WRONG - SEE MY TESTING BELOW
4. KLMeansCL still produce artifacts. Got any ideas I can pass on to Khanattila ?
BTW- Does this OpenCL feature for QTGMC is only available for us VapourSynth users or AviSynth users have also access to something similar ?
HolyWu
27th November 2017, 21:10
Thanks ! It works now.
1. The output is different as without OpenCL use - smaller file size. I also used binary compare and found 1975 changes all across the file - not limited to specific part of the file.
These are 2 new encodes I just did with the only different is the added " opencl=True ".
Although playing both looks the same.
2. Will you be able to set the configure file to use " -framework OpenCL " instead of " -lOpenCL " when creating the makefile on macOS ? I am doing it manually each time.
3. The performance of QTGMC CL (the specific line I use is on my previous post) is a bit slower comparing to without the opencl=True .
I guess my CPU is just better for this than my GPU.
4. KLMeansCL still produce artifacts. Got any ideas I can pass on to Khanattila ?
BTW- Does this OpenCL feature for QTGMC is only available for us VapourSynth users or AviSynth users have also access to something similar ?
1. There is no point in comparing binary output. Both the CPU version and the OpenCL version have their own technique of trading quality off against speed, hence you never get bit-exact output.
2. Will fix.
3. Probably. And I just push a commit to use znedi3 instead of the original nnedi3 now.
4. Either https://forum.doom9.org/showthread.php?t=171379 or https://github.com/Khanattila/KNLMeansCL/issues.
The AviSynth's nnedi3ocl only has nsize=0 implemented and has no prescreener so nobody really cares to use it in QTGMC.
KingLir
27th November 2017, 23:15
1. There is no point in comparing binary output. Both the CPU version and the OpenCL version have their own technique of trading quality off against speed, hence you never get bit-exact output.
I see. So how can I know which gives better image quality ?
2. Will fix.
Thanks!
3. Probably. And I just push a commit to use znedi3 instead of the original nnedi3 now.
Nice. Can you help me build a macOS version ?
This (https://github.com/sekrit-twc/znedi3) doesn't have autogen/configure and I am getting the following from:
A. simple "make" :
c++ -c -o vsznedi3/vsznedi3.o vsznedi3/vsznedi3.cpp
vsznedi3/vsznedi3.cpp:8:10: fatal error: 'znedi3.h' file not found
B. simple gcc command:
https://pastebin.com/mmitrMCV
4. Either https://forum.doom9.org/showthread.php?t=171379
This link just show the OP of KMLMeans.... did you mean something else ?
The AviSynth's nnedi3ocl only has nsize=0 implemented and has no prescreener so nobody really cares to use it in QTGMC.
Good to know :)
DJATOM
27th November 2017, 23:57
KingLir
Try to google for those warnings, you might find a solution. At least for C++11 warnings CXXFLAGS=-g -std=c++11 -Wall -pedantic should help.
About "'znedi3.h' file not found": compiler can't find your includes. Set them with "-I./path/to/include/dir". You can add a couple of -I options if needed.
DJATOM
28th November 2017, 00:47
https://github.com/thebombzen/znedi3 - repo with Makefile.
HolyWu
28th November 2017, 06:43
I see. So how can I know which gives better image quality ?
By eyes. For instance, you probably won't notice significant differences using Interleave([nnedi3(clip, field=1, exp=0), nnedi3(clip, field=1, exp=2)]), even zoom in at 300%. But if you use MakeDiff(nnedi3(clip, field=1, exp=0), nnedi3(clip, field=1, exp=2)).Levels(min_in=127, max_in=129, min_out=0, max_out=255) you can easily see there are a pile of pixel differences. However do you or anyone bother to turn off those speed-ups which sacrifice precision? I guess no. Then why bother now?
Nice. Can you help me build a macOS version ?
This (https://github.com/sekrit-twc/znedi3) doesn't have autogen/configure and I am getting the following from:
A. simple "make" :
c++ -c -o vsznedi3/vsznedi3.o vsznedi3/vsznedi3.cpp
vsznedi3/vsznedi3.cpp:8:10: fatal error: 'znedi3.h' file not found
The makefile in the official repo works fine for me: https://pastebin.com/un1TvN7b
This link just show the OP of KMLMeans.... did you mean something else ?
I don't get it. Don't you want to report something to Khanattila? Then don't you need to post in the relevant thread or file an issue in the relevant github repo?
KingLir
28th November 2017, 16:36
By eyes. For instance, you probably won't notice significant differences using Interleave([nnedi3(clip, field=1, exp=0), nnedi3(clip, field=1, exp=2)]), even zoom in at 300%. But if you use MakeDiff(nnedi3(clip, field=1, exp=0), nnedi3(clip, field=1, exp=2)).Levels(min_in=127, max_in=129, min_out=0, max_out=255) you can easily see there are a pile of pixel differences. However do you or anyone bother to turn off those speed-ups which sacrifice precision? I guess no. Then why bother now?
I see your point :)
Just for my knowledge, how does one turn off those speed-ups in QTGMC ?
The makefile in the official repo works fine for me: https://pastebin.com/un1TvN7b
Thanks, I don't know why I got the errors before. Anyway, I update the makefile for .dylib instead of .o creation and seems to work for macOS.
I don't get it. Don't you want to report something to Khanattila? Then don't you need to post in the relevant thread or file an issue in the relevant github repo?
I actually post in the past and Khanattila don't have a lead for the precision issues (that he estimate are the cause for the artifacts). I asked if you got ideas after your quickly managed to fix QTGMC CL for me....
KingLir
28th November 2017, 17:19
Something else... I did a more correct testing (below) and found out that:
A. OpenCL is significantly faster than nnedi3 on my System, Although I got a good CPU and only laptop-grade GPU ( details below ).
B. Something is wrong with znedi3 (at least for me). It's super slow. How can I help to debug this ?
My System:
CPU- Intel Core i7 Skylake 4.0 GHz quad-core (Turbo Boost up to 4.2 GHz) 8 MB shared L3 cache (i7-6700K)
GPU - AMD Radeon R9 M395X 4 GB ("Laptop-grade" GPU)
RAM- 24 GB 1867 MHz DDR3
Output 1236 frames:
opencl (HAvsFunc latest github) - in 49.95 seconds (24.75 fps)
nnedi3 (HAvsFunc r27) - in 74.88 seconds (16.51 fps)
znedi3 (HAvsFunc latest github) - in 362.15 seconds (3.41 fps)
HolyWu
30th November 2017, 19:51
I see your point :)
Just for my knowledge, how does one turn off those speed-ups in QTGMC ?
At the moment you can't 'coz the relevant parameters haven't been exposed for years, unless you manually edit the script. I'll probably add them in a few days though.
B. Something is wrong with znedi3 (at least for me). It's super slow. How can I help to debug this ?
You should test by the filter itself first, not by a complex function. The vpy should only contain a source filter followed by nnedi3/znedi3 and nothing else. If the result is still the same, fire an issue on the GitHub repo and provide necessary information.
KingLir
30th November 2017, 21:32
At the moment you can't 'coz the relevant parameters haven't been exposed for years, unless you manually edit the script. I'll probably add them in a few days though.
Cool. Thanks !
You should test by the filter itself first, not by a complex function. The vpy should only contain a source filter followed by nnedi3/znedi3 and nothing else. If the result is still the same, fire an issue on the GitHub repo and provide necessary information.
Sorry if I making hard time for you here. Just want to help out.
But may I ask you post the simplest vpy ffms2-based you recommend for testing ? since simple is a relative term :)
Also, what exactly should be included in "necessary information" ?
KingLir
30th November 2017, 22:46
You probably did not compile it with x86 support ("make X86=1").
Thank you. I just pulled the latest push from today and built a new dylib with make X86=1. Still the same performance:
encoded 1236 frames in 351.54s (3.52 fps)
KingLir
30th November 2017, 22:58
BTW- this is the rough patch I did (.diff) to add macOS build support:
https://pastebin.com/FUaSBPYZ
KingLir
1st December 2017, 09:08
Did you "make clean"? Do you see x86 object files in the Makefile output? What if you pass "x_cpu='avx2'"?
Thanks! I did forgot the cleaning. Used for it being done automatically after build. Maybe you should also add that to the makefile (in addition to macOS support I sent in my .diff) ?
So it seems fixed now. BTW I did another clean and then make x_cpu='avx2' - it was back to being super slow.
Still OpenCL is significantly faster on my system. And once I test on faster "desktop-class" GPU I am assuming it will be much faster.
znedi3:
Output 1236 frames in 62.87 seconds (19.66 fps)
OpenCL:
Output 1236 frames in 50.26 seconds (24.59 fps)
KingLir
1st December 2017, 22:08
Maybe your memory is too slow to support higher performance. 24 GB sounds like it is running in single-channel mode.
Doesn't seem like the issue:
https://preview.ibb.co/cTXofG/Screen_Shot_2017_12_01_at_22_47_50.png
It does make sense that znedi3 will be faster. Any ideas for me to try ?
KingLir
2nd December 2017, 09:19
Based on the results in the other thread, znedi3 should be 50% faster than nnedi3 per-clock on Haswell and Skylake. However, running nnedi3 50% faster is not the same as running QTGMC 50% faster.
By the way, the "laptop-grade" R9 M395X has 3 TFLOPS of compute, so it is not surprising for it to be faster than the i7-6700K's 512 GFLOPS. znedi3 only begins outperforming GPUs on HEDT, particularly Skylake-X (i7-7800K has 1.5 TFLOPS).
Thank you for the explanation ! So it seems everything is normal on my system.
masterkivat
3rd December 2017, 21:27
Can someone help me posting a usage example of LogoNR from HAvsFunc? :thanks:
lansing
4th December 2017, 06:58
Can someone help me posting a usage example of LogoNR from HAvsFunc? :thanks:
You'll need to get the delogo package here:
https://github.com/HomeOfVapourSynthEvolution/VapourSynth-DeLogo
And then look for your lgd logo file from this logo collection (https://down.7086.in/lgd/), they attached all the (l,t,r,b) settings already.
Original from nmm:
https://www.nmm-hd.org/newbbs/viewtopic.php?f=7&t=1244
If you can't find your logo, then you'll need to make it yourself, in which I don't know how.
import vapoursynth as vs
import havsfunc as haf
src = core.avisource.AVISource(r"abc.avi")
dlg = core.delogo.EraseLogo(src, r"logo.lgd")
clip = haf.logoNR(dlg, src, l=1280, t=40, r=-40, b=-960)
HolyWu
4th December 2017, 07:40
Unlike the fashion of AviSynth's Crop, the values of r and b need to be positive, just like std.Crop.
masterkivat
4th December 2017, 08:06
You'll need to get the delogo package here:
https://github.com/HomeOfVapourSynthEvolution/VapourSynth-DeLogo
And then look for your lgd logo file from this logo collection (https://down.7086.in/lgd/), they attached all the (l,t,r,b) settings already.
Original from nmm:
https://www.nmm-hd.org/newbbs/viewtopic.php?f=7&t=1244
If you can't find your logo, then you'll need to make it yourself, in which I don't know how.
import vapoursynth as vs
import havsfunc as haf
src = core.avisource.AVISource(r"abc.avi")
dlg = core.delogo.EraseLogo(src, r"logo.lgd")
clip = haf.logoNR(dlg, src, l=1280, t=40, r=-40, b=-960)
Thank you, lansing!
To be honest, I'm familiar with logoNR from avisynth, but I'm start learning how to vapoursynth and sometimes I get lost with some strings and hierarchy, but I'll get there. Thanks again! :thanks:
STJAM
11th February 2018, 03:02
I would like to use both havsfunc.py - Stab and FFT3Dfilter in the same script but
when I load plugin DePan which require libfftw3f-3.dll to be in the search path I receive the following.
vsedit: vsedit.exe - Entry Point Not Found
The proceedure entry point fftwf_make_planner_thread_safe
could not be located in the dynamic link library
C:\VapourSynth-FFT3DFilter_test3\x64\fft3dfilter.dll.
I was experiencing the same problem using DFFtest with FFT3DFilter until I realized I was using an older release of DFTest. Which makes me think an update for Depan is in order and it is not a problem with fft3dfilter.
The Stab in havsfunc.py is using as far as I can tell http://github.com/HomeOfVapourSynthEvolution/VapourSynth-DePan/tree/master/DePan
instead of http://github.com/dubhater/vapoursynth-mvtools/releases. If Stab could be written to use the mvtools release.
HolyWu
11th February 2018, 04:19
I would like to use both havsfunc.py - Stab and FFT3Dfilter in the same script but
when I load plugin DePan which require libfftw3f-3.dll to be in the search path I receive the following.
vsedit: vsedit.exe - Entry Point Not Found
The proceedure entry point fftwf_make_planner_thread_safe
could not be located in the dynamic link library
C:\VapourSynth-FFT3DFilter_test3\x64\fft3dfilter.dll.
I was experiencing the same problem using DFFtest with FFT3DFilter until I realized I was using an older release of DFTest. Which makes me think an update for Depan is in order and it is not a problem with fft3dfilter.
The Stab in havsfunc.py is using as far as I can tell http://github.com/HomeOfVapourSynthEvolution/VapourSynth-DePan/tree/master/DePan
instead of http://github.com/dubhater/vapoursynth-mvtools/releases. If Stab could be written to use the mvtools release.
Neither DePan nor DFTTest uses fftwf_make_planner_thread_safe, but FFT3DFilter. I have a feeling that there is an old version of libfftw3f-3 in your system got loaded, which doesn't have fftwf_make_planner_thread_safe.
I'd like to use the depan-related filters in mvtools long time ago. But DepanEstimate in mvtools lacks the range parameter for unknown reason, which is set to 1 by default in Stab. I have quite few experence in using Stab. If the result is still fine when range=0 then I can simply change it in the next release.
HolyWu
10th March 2018, 16:40
Update r28.
Replace nnedi3 with more optimized znedi3.
daa, santiag, QTGMC: Expose more parameters of nnedi3/eedi3.
ivtc_txt60mc: Add 'opencl' parameter and fix framerate mismatch error.
logoNR: Change the default values for KNLMeansCL.
Deblock_QED: Use renewed DCTFilter.
MinBlur: Performance improvement (Z4ST1N).
QTGMC: Fix incorrect noiseCentre when Denoiser='KNLMeansCL'.
QTGMC: Keep up with the changes in FFT3DFilter.
Add MCTemporalDenoise function (no post-processor).
Selur
10th March 2018, 17:50
Thanks! :)
poisondeathray
10th March 2018, 17:51
Add MCTemporalDenoise function (no post-processor).
Thanks :)
lansing
10th March 2018, 18:56
Wow we finally got the best denoiser in vapoursynth, thanks
Selur
11th March 2018, 10:41
For me using settings="very high":
# Imports
import os
import sys
import ctypes
# Loading Support Files
Dllref = ctypes.windll.LoadLibrary("G:/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'G:/Hybrid/64bit/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/DenoiseFilter/FFT3DFilter/vsfft3dfilter.dll")
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/Support/DCTFilter.dll")
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/DeblockFilter/Deblock/Deblock.dll")
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import havsfunc
# Loading F:\TestClips&Co\SILVERFANG_multiple_subs.mkv using LWLibavSource
clip = core.lsmas.LWLibavSource(source="F:/TESTCL~1/SILVER~1.MKV", format="YUV420P8", cache=0)
# denoising using MCTemporalDenoise
clip = havsfunc.MCTemporalDenoise(i=clip, settings="very high")
# Output
clip.set_output())
Simply crashes vsedit and vspipe. All other 'settings' values work fine.
Using 'clip = havsfunc.MCTemporalDenoise(i=clip, settings="very high", twopass=False)' doesn't help either, so it's not the twopass setting.
Cu Selur
ChaosKing
11th March 2018, 10:56
No problems here with very high settings. Have you updated to latest fft3dfilter? I had to download Test3 https://forum.doom9.org/showthread.php?t=175199
Edit:
My CPU is a Ryzen 1700
Edit2:
I use a sliglty newer libfftw3f-3.dll version (not the one bundled with Test3)
Selur
11th March 2018, 10:57
Okay, will try to investigate some further may be it's one of the dlls I use,..
-> yes, seems like I used an old fft3dfilter version which was buggy :)
ChaosKing
11th March 2018, 11:24
@HolyWu could you add an float opacity parameter to Overlay() like in avisynth?
hydra3333
11th March 2018, 11:59
znedi3
Is that https://github.com/sekrit-twc/znedi3/releases ?
I'm not sure if it's 32bit or 64bit (no separate folders provided).
Selur
11th March 2018, 12:03
@hydra3333: Works here, so it should be 64bit, since I use 64bit Vapoursynth. :)
Cu Selur
HolyWu
11th March 2018, 14:27
@HolyWu could you add an float opacity parameter to Overlay() like in avisynth?
Added.
ChaosKing
11th March 2018, 18:05
Thank you, works good!
yoon
19th March 2018, 21:10
Is there any way to limit qtgmc's memory usage? It completely freezes my Mac.
My script is really simple:
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
video = core.lsmas.LWLibavSource(source=path)
video = haf.QTGMC(video, Preset="Slower", TFF=True)
video = core.fmtc.resample(video, 629,354, kernel = "bilinear", invks = True, css="444")
video = core.std.CropRel(video, left=180, top=3, right=181, bottom=1)
video = core.fmtc.resample(video, css="420")
video = core.fmtc.bitdepth(video, bits=8)
Pipe:
vspipe --y4m test.vpy - | ffmpeg -f yuv4mpegpipe -colorspace bt709 -i - -vcodec rawvideo -pix_fmt bgr24 -y output.mov
It never goes past the tenth frame : (
My Mac specs:
OS: High Sierra
Intel Core i5 2.4GHz
Intel HD Graphics + Nvidia GT 330M
4GB RAM
HolyWu
20th March 2018, 04:02
Is there any way to limit qtgmc's memory usage? It completely freezes my Mac.
You can use max_cache_size (http://www.vapoursynth.com/doc/pythonreference.html#Core.max_cache_size) to set the upper framebuffer cache size after obtaining the core instance, such as core.max_cache_size = 2048.
yoon
22nd March 2018, 11:54
You can use max_cache_size (http://www.vapoursynth.com/doc/pythonreference.html#Core.max_cache_size) to set the upper framebuffer cache size after obtaining the core instance, such as core.max_cache_size = 2048.
This worked like a charm, thank you.
fAy01
28th March 2018, 14:36
https://github.com/4re/vapoursynth-modules/commit/1bc27dc2a2680838dfa7a0696f9283cb66425af1
Could you please update this and add to HAvsFunc?
HolyWu
29th March 2018, 15:35
Update r29.
Overlay: Add opacity parameter.
srestore: Fix dclip parameter being no effect.
MCTemporalDenoise: Add useTTmpSm and stabilize parameters.
Toon: Remove unnecessary workaround for AWarpSharp2.
Add EdgeCleaner function.
fAy01
2nd April 2018, 07:25
Update r29.
Overlay: Add opacity parameter.
srestore: Fix dclip parameter being no effect.
MCTemporalDenoise: Add useTTmpSm and stabilize parameters.
Toon: Remove unnecessary workaround for AWarpSharp2.
Add EdgeCleaner function.
Thank you. Why does vs' Santiag require fmtconv whereas avs' Santiag doesn't require dither?
HolyWu
2nd April 2018, 15:55
Thank you. Why does vs' Santiag require fmtconv whereas avs' Santiag doesn't require dither?
Because the center shift correction has to take chroma subsampling into account, and the relevant parameter of fmtconv is of array type hence I can specify different values for different planes. The center shift correction of chroma planes in avs' santiag is wrong.
HolyWu
4th April 2018, 10:41
Update r30.
ContraSharpening: Set default radius value according to resolution. Change default rep value to 13. Add planes parameter and process all planes by default.
LUTDeCrawl: Remove unnecessary workaround for SCDetect.
MCTemporalDenoise: Change default search value to 4. Add pfMode, refine, thSADC and thSADC2 parameters. Now uses DFTTest instead of FFT3DFilter for prefiltering by default.
srestore: Fix format conversion error.
Boulder
7th April 2018, 10:01
Radius > 1 seems to totally kill performance in ContraSharpening if the input clips are 16-bit video. Is there any way around this (i.e. a Vapoursynth bug) or is it just the way it is?
HolyWu
7th April 2018, 10:38
Radius > 1 seems to totally kill performance in ContraSharpening if the input clips are 16-bit video. Is there any way around this (i.e. a Vapoursynth bug) or is it just the way it is?
If radius=2 is slow for you then you probably are not using the latest version of CTMF because a special path is added for radius=2 in r4 and the workaround is removed in MinBlur(2) afterward. For radius=3 it is indeed slow because the calculation complexity is greatly affected by bit depth and that's how the original algorithm is designed.
Boulder
7th April 2018, 11:46
Thanks, works perfectly now. I must have missed the update of CTMF last summer, so I just subscribed to the corresponding thread in case of further developments :)
fAy01
10th April 2018, 15:32
I've got another request. Could you update and improve vs' FineDehalo port? It's also not being developed.
https://gist.github.com/SX91/bcd427ec0fa8fdf7c45433917521bac4
AVS code: http://avisynth.nl/index.php/FineDehalo (There's also a mod at the bottom of the page)
Question regarding Santiag, is it possible to adjust contrast sharp values?
Thank you!
DJATOM
10th April 2018, 19:03
FineDehalo fixed version from me. Also mt_edge and std.Prewitt produce different results, so I made some additions into code to use masktools version for that mask.
https://pastebin.com/pBXL0ubQ
Myrsloik
11th April 2018, 10:28
FineDehalo fixed version from me. Also mt_edge and std.Prewitt produce different results, so I made some additions into code to use masktools version for that mask.
https://pastebin.com/pBXL0ubQ
I can't remember which issue of all the ones that exist you've found here again so I'm going to list them:
1. Many avisynth authors are very confused about sobel/prewitt/whatever kernels. Some of them are horribly misnamed.
2. All avisynth implementations seem to simply add the absolute values together in order to avoid a square root. This gives diagonal edges a disproportionately big intensity.
3. I think some filter tried to combine the two kernels without realizing why it just doesn't work.
I'm sorry if the correct output has offended you.
DJATOM
11th April 2018, 12:11
Original port had issues with proper values conversion (haf.scale(255, bits) where proper way to convert value is haf.scale(255, peak)). Output mask was plain black due to that.
> I'm sorry if the correct output has offended you.
No problem with that. I just noticed the difference while checked avs versus vs versions of output masks, so I checked plain std.Prewitt/mt_edge(mode="prewitt", thY1=0, thY2=255, U=0, V=0) and confirmed that difference occurs there.
https://slowpics.org/comparison/9500bb72-61e4-4808-91d5-0f93e2617498 - actual comparison.
HolyWu
11th April 2018, 13:32
Question regarding Santiag, is it possible to adjust contrast sharp values?
um...what is contrast sharp value? Did you mean contra-sharpening? If so, it's a standalone function and you can use it on your own.
> I'm sorry if the correct output has offended you.
No problem with that. I just noticed the difference while checked avs versus vs versions of output masks, so I checked plain std.Prewitt/mt_edge(mode="prewitt", thY1=0, thY2=255, U=0, V=0) and confirmed that difference occurs there.
https://slowpics.org/comparison/9500bb72-61e4-4808-91d5-0f93e2617498 - actual comparison.
You never get identical results between them, since the kernels in masktools differ greatly from the standard definitions, like Sobel operator (https://en.wikipedia.org/wiki/Sobel_operator#Formulation) or Prewitt operator (https://en.wikipedia.org/wiki/Prewitt_operator#Formulation). For example, the doc of masktools says that "prewitt" is equivalent to mt_logic(mt_logic(mt_edge("1 1 0 1 0 -1 0 -1 -1 1"), mt_edge("1 1 1 0 0 0 -1 -1 -1 1"), mode="max"), mt_logic(mt_edge("1 0 -1 1 0 -1 1 0 -1 1"), mt_edge("0 -1 -1 1 0 -1 1 1 0 1"), mode="max"), mode="max"). To get the same incorrect output as masktools', you have to use:
# mt_edge("prewitt", 0, 255)
clip1 = core.std.Expr([core.std.Convolution(clip, matrix=[1, 1, 0, 1, 0, -1, 0, -1, -1], saturate=False), core.std.Convolution(clip, matrix=[1, 1, 1, 0, 0, 0, -1, -1, -1], saturate=False)], 'x y max')
clip2 = core.std.Expr([core.std.Convolution(clip, matrix=[1, 0, -1, 1, 0, -1, 1, 0, -1], saturate=False), core.std.Convolution(clip, matrix=[0, -1, -1, 1, 0, -1, 1, 1, 0], saturate=False)], 'x y max')
clip = core.std.Expr([clip1, clip2], 'x y max')
Now here comes the problem. What's the point? :)
DJATOM
11th April 2018, 13:38
HolyWu
Thanks, I'll use it instead of loading avs plugin.
Myrsloik
11th April 2018, 13:39
HolyWu
Thanks, I'll use it instead of loading avs plugin.
Do you have en example where the output is actually better/worse because of the difference? I mean at most I'd expect you to have to scale up the mask intensity by about 20% to compensate for the lower values on average but that's it.
DJATOM
11th April 2018, 13:56
Do you have en example where the output is actually better/worse because of the difference? I mean at most I'd expect you to have to scale up the mask intensity by about 20% to compensate for the lower values on average but that's it.
Check the 1st comparison from my link. https://i.imgur.com/mnA8gLr.png this part is missing with native VS mask.
TheFluff
11th April 2018, 14:28
The Masktools Prewitt is super weird, yes. To refresh the maths: the Prewitt operator as commonly implemented in image processing calculates the magnitude of a gradient in a 3x3 pixel grid, horizontally and vertically, by applying two convolutions, one for the horizontal and one for the vertical direction, commonly referred to as Gx and Gy respectively:
Gx (horizontal):
-1 0 1
-1 0 1
-1 0 1
Gy (vertical):
1 1 1
0 0 0
-1 -1 -1
The total gradient magnitude is then calculated as sqrt(Gx² + Gy²). A common optimization to avoid the square root is to approximate the magnitude by simply adding the absolute values of Gx and Gy, i.e. abs(Gx) + abs(Gy). This is a decent approximation if one of them is small (that is, the edge is straight, either vertically or horizontally) but pretty bad otherwise.
The Vapoursynth implementation (https://github.com/vapoursynth/vapoursynth/blob/master/src/core/genericfilters.cpp#L1239) is just straight up the canonical Prewitt - the pixel values on the 3x3 grid are called a<column><row>, so the upper left corner of the grid is a11 and the bottom right corner is a33:
float scale = params.scale;
float gx, gy;
gx = a31 + a32 + a33 - a11 - a12 - a13;
gy = a13 + a23 + a33 - a11 - a21 - a31;
return std::sqrt(static_cast<float>(gx * gx + gy * gy)) * scale;
(Some surrounding code omitted for clarity.)
Masktools does something completely different (https://github.com/pinterf/masktools/blob/16bit/masktools/filters/mask/edge/edgemask.cpp#L69) - I guess it works in practice, but it's not what is typically called a Prewitt operator:
const int p90 = a11 + a21 + a31 - a13 - a23 - a33;
const int p180 = a11 + a12 + a13 - a31 - a32 - a33;
const int p45 = a12 + a11 + a21 - a33 - a32 - a23;
const int p135 = a13 + a12 + a23 - a31 - a32 - a21;
const int max1 = max<int>( abs<int>( p90 ), abs<int>( p180 ) );
const int max2 = max<int>( abs<int>( p45 ), abs<int>( p135 ) );
const int maxv = max<int>( max1, max2 );
return threshold<Byte, int>( maxv, nLowThreshold, nHighThreshold );
p90 and p180 are the same as Gx and Gy, but then there's also a "diagonal Prewitt" calculation, using these two kernels:
"G45"
1 1 0
1 0 -1
0 -1 -1
"G135"
0 1 1
-1 0 1
-1 -1 0
Instead of the usual Prewitt which kinda sums the horizontal and vertical magnitude, this returns the maximum magnitude - max(max(Gx, Gy), max(G45, G135)).
fAy01
11th April 2018, 14:32
This is a big ask but amDCT performs significantly well than Deblock_QED. Could you port it? https://forum.doom9.org/showthread.php?p=1801244#post1801244
A request thread was created before but no dice: https://forum.doom9.org/showthread.php?t=173866
TheFluff
11th April 2018, 15:05
This is a big ask but amDCT performs significantly well than Deblock_QED. Could you port it? https://forum.doom9.org/showthread.php?p=1801244#post1801244
A request thread was created before but no dice: https://forum.doom9.org/showthread.php?t=173866
Porting amDCT would be a Herculean task. It's an incredibly messy codebase even by Avisynth plugin standards, and that's saying something. It's got everything - copypasted code (a bunch of it from other projects, even), dead code, wildly inconsistent indentation, a custom memcpy, inline asm, internal Windows-only multithreading, global debugging variables, comments that go "this doesn't work" and "this isn't used at the moment", etc etc. Just figuring out which parts of the code are actually reachable would probably take a week of hard work. Just load it via the Avisynth compatibility wrapper if you want it.
fAy01
11th April 2018, 15:24
Porting amDCT would be a Herculean task. It's an incredibly messy codebase even by Avisynth plugin standards, and that's saying something. It's got everything - copypasted code (a bunch of it from other projects, even), dead code, wildly inconsistent indentation, a custom memcpy, inline asm, internal Windows-only multithreading, global debugging variables, comments that go "this doesn't work" and "this isn't used at the moment", etc etc. Just figuring out which parts of the code are actually reachable would probably take a week of hard work. Just load it via the Avisynth compatibility wrapper if you want it.
I see your point but it performs better than most Deblock plugins. I tested it against other deblock filters before asking.
TheFluff
11th April 2018, 15:30
I’m not saying it doesn’t work, I’m just saying it would be really hard to port.
fAy01
11th April 2018, 15:33
Yeah, but avs is somewhat limiting and extremely slow compared to vs, hence the request for port. Anyway, Smartfade/mod might be an easier port: https://pastebin.com/3ePs7WHD
Thank you!
HolyWu
13th April 2018, 15:42
This is a big ask but amDCT performs significantly well than Deblock_QED. Could you port it? https://forum.doom9.org/showthread.php?p=1801244#post1801244
A request thread was created before but no dice: https://forum.doom9.org/showthread.php?t=173866
Porting amDCT is definitely no go. Maybe you can try something like DeblockPP7 or AutoDeblock in fvsfunc (https://github.com/Irrational-Encoding-Wizardry/fvsfunc). The former is probably one thousand times easier to port for me.
ChaosKing
13th April 2018, 17:32
You could also try the "low quality" version of Oyster https://forum.doom9.org/showthread.php?p=1780389#post1780389
fAy01
14th April 2018, 10:04
Porting amDCT is definitely no go. Maybe you can try something like DeblockPP7 or AutoDeblock in fvsfunc (https://github.com/Irrational-Encoding-Wizardry/fvsfunc). The former is probably one thousand times easier to port for me.
How about this?
Yeah, but avs is somewhat limiting and extremely slow compared to vs, hence the request for port. Anyway, Smartfade/mod might be an easier port: https://pastebin.com/3ePs7WHD
Thank you!
Selur
14th April 2018, 10:43
@HolyWu: any preferences where to post requests? Here or over in github?
Posted a small request there, and wasn't sure whether it would have been more convenient for you if I had posted it here (https://github.com/HomeOfVapourSynthEvolution/havsfunc/issues/12).
Cu Selur
fAy01
16th April 2018, 18:30
I tried calling chroma=true in haf.logoNR and it is not set. Could you please explain?
HolyWu
17th April 2018, 03:04
I tried calling chroma=true in haf.logoNR and it is not set. Could you please explain?
In Python the first letter of the boolean value needs to be capitalized, i.e., chroma=True.
fAy01
17th April 2018, 11:29
Thanks!
There's another variant of smartfade with masking: https://forum.doom9.org/showpost.php?p=1685277&postcount=25
fAy01
22nd April 2018, 04:23
Hi, again. Could you please add another function: https://pastebin.com/xyVhfQFe or https://forum.doom9.org/showpost.php?p=1665492&postcount=27
kgrabs
22nd April 2018, 04:41
Hi, again. Could you please add another function: https://pastebin.com/xyVhfQFe or https://forum.doom9.org/showpost.php?p=1665492&postcount=27
DeCross, mt_motion, and TEMmod/TEdgeMask are not available in Vapoursynth
Edit: I lied, TEdgeMask is a function now (https://github.com/WolframRhodium/muvsfunc/blob/master/muvsfunc.py#L1146) (but adding it would create another dependency)
Also life hack about the chroma=true thing: use 0 for False and 1 for True to save yourself some keystrokes, since python treats them the same. You can actually use any non-zero for True but you know what they say, KISS
fAy01
22nd April 2018, 06:20
DeCross, mt_motion, and TEMmod/TEdgeMask are not available in Vapoursynth
Edit: I lied, TEdgeMask is a function now (https://github.com/WolframRhodium/muvsfunc/blob/master/muvsfunc.py#L1146) (but adding it would create another dependency)
Also life hack about the chroma=true thing: use 0 for False and 1 for True to save yourself some keystrokes, since python treats them the same. You can actually use any non-zero for True but you know what they say, KISS
I see. Thanks for the clarification.
fAy01
26th April 2018, 06:26
I called LUTDeCrawl with default settings and I am seeing image distortion in some areas.
https://diff.pics/1CsGIqJz_aur/1
Image 1 - The edges of the clouds (blur)
Sample: https://www26.zippyshare.com/v/RySrd4MX/file.html
Image 2 - Somehow the green color is being displaced (check frame 22)
Sample: https://www26.zippyshare.com/v/BeqbFVsU/file.html
HolyWu
26th April 2018, 08:22
I called LUTDeCrawl with default settings and I am seeing image distortion in some areas.
https://diff.pics/1CsGIqJz_aur/1
Image 1 - The edges of the clouds (blur)
Sample: https://www26.zippyshare.com/v/RySrd4MX/file.html
Image 2 - Somehow the green color is being displaced (check frame 22)
Sample: https://www26.zippyshare.com/v/BeqbFVsU/file.html
Unfortunately that's the defect of the function itself, not that I did something wrong when porting. Something you can try is to lower the default values, like LUTDeCrawl(ythresh=5, cthresh=5, maxdiff=25), or another decrawl filter TComb.
fAy01
26th April 2018, 09:28
Unfortunately that's the defect of the function itself, not that I did something wrong when porting. Something you can try is to lower the default values, like LUTDeCrawl(ythresh=5, cthresh=5, maxdiff=25), or another decrawl filter TComb.
Unfortunately, it suffers from the same issue. Just tested LUTDeCrawl(ythresh=5, cthresh=5, maxdiff=25) <-- causes the same issue with lower values. So there might not be anything wrong with your port but there might be something within the code.
Selur
27th May 2018, 00:20
Got a question related to LUTDeRainbow: Does LUTDeRainbow only support YUV420P8-10?
I thought it was supposed to support YUVXXXP8-YUVXXXP10, but when actually testing it, everything that isn't 4:2:0, gives me:
Lut2: only clips with integer samples, same dimensions, same subsampling and up to a total of 20 indexing bits supported
-> Was my assumption that it was supposed to support YUVXXXP8-YUVXXXP10 wrong or is this a bug somewhere in the code?
HolyWu
27th May 2018, 02:16
Got a question related to LUTDeRainbow: Does LUTDeRainbow only support YUV420P8-10?
I thought it was supposed to support YUVXXXP8-YUVXXXP10, but when actually testing it, everything that isn't 4:2:0, gives me:
-> Was my assumption that it was supposed to support YUVXXXP8-YUVXXXP10 wrong or is this a bug somewhere in the code?
Fixed. Thanks for the report.
Selur
27th May 2018, 07:41
Thanks for fixing. :)
poisondeathray
6th June 2018, 01:02
LSFmod crashes on a single frame input
e.g
clip = core.std.BlankClip(format=vs.YUV420P8)
#clip = clip[0] # return single frame 0 => crash
#clip = clip[0:2] # return 0,1 (2 frames) => ok
clip = haf.LSFmod(clip)
clip.set_output()
error message
Attempted to read key 'clip' from a map with error set: Trim: last frame beyond clip end
HolyWu
6th June 2018, 02:24
LSFmod crashes on a single frame input
Well, it's caused by misc.SCDetect which is used indirectly when soothe=True. In misc.SCDetect it uses Trim (https://github.com/vapoursynth/vapoursynth/blob/master/src/filters/misc/miscfilters.cpp#L93) to "shift" the frames for scene change detection. Since it's a one-frame clip so the range gets out of bounds. But misc.SCDetect doesn't properly check whether there is an error set in the map or not, hence you get abnormal crash in this case.
Myrsloik
6th June 2018, 20:10
Well, it's caused by misc.SCDetect which is used indirectly when soothe=True. In misc.SCDetect it uses Trim (https://github.com/vapoursynth/vapoursynth/blob/master/src/filters/misc/miscfilters.cpp#L93) to "shift" the frames for scene change detection. Since it's a one-frame clip so the range gets out of bounds. But misc.SCDetect doesn't properly check whether there is an error set in the map or not, hence you get abnormal crash in this case.
Fixed, it will now return an error on pointless 1 frame clips.
poisondeathray
7th June 2018, 22:38
Fixed, it will now return an error on pointless 1 frame clips.
Thanks
Now back to my pointless adventures :D
fAy01
30th June 2018, 09:40
Could you please update: http://avisynth.nl/index.php/QTGMC & http://avisynth.nl/index.php/Srestore ?
And please add these functions as well: https://pastebin.com/GyM2N6km ++ https://pastebin.com/Z7k3ZXBr ++ http://putin999.blog.fc2.com/blog-entry-4.html
Thank you.
Myrsloik
11th July 2018, 10:58
You should probably replace the use of depan by mvtools since it has all the required functions now. Just an observation when i checked the used plugins.
Myrsloik
11th July 2018, 12:18
I just realized that you depend on nnedi3_resample which is missing the conditional use of znedi3. So nnedi3 is still required and used in that script part. I've reported it as an issue for nnedi3_resample but thought I should mention it.
fAy01
13th July 2018, 01:23
https://www.mediafire.com/file/sygi04y47eknvc2/xaa_v1.2.1.avsi
Please add this, if you can. Thanks.
lansing
21st July 2018, 05:10
I was testing out the fast presets of QTGMC on my video, I was deinterlacing a 1080i clip and downscale it to 720p, here's the benchmark with vs editor.
faster: 23.6 fps
very fast: 24.8 fps
super fast: 36.1 fps
ultra fast: 36 fps
draft: 85.5 fps
The presets doesn't really scale in speed, "faster" is the same as "very fast" and "super fast" is the same as "ultra fast". Though there was a 130% speed increase when going from "ultra fast" to "draft". It just doesn't look right to me.
I am looking for a preset for fast encoding and it seems like I have no choice except to use "draft", but it just feels cheap to use the lowest setting. Can there be some changes in the "ultra fast" so to make it less cheap than "draft" but be significantly faster than "super fast"?
HolyWu
21st July 2018, 07:07
I am looking for a preset for fast encoding and it seems like I have no choice except to use "draft", but it just feels cheap to use the lowest setting. Can there be some changes in the "ultra fast" so to make it less cheap than "draft" but be significantly faster than "super fast"?
You can compare what values are changed between "ultra fast" and "draft" at https://github.com/HomeOfVapourSynthEvolution/havsfunc/blob/master/havsfunc.py#L896 and tweak the relevant parameters then.
lansing
21st July 2018, 09:16
You can compare what values are changed between "ultra fast" and "draft" at https://github.com/HomeOfVapourSynthEvolution/havsfunc/blob/master/havsfunc.py#L896 and tweak the relevant parameters then.
Here's my test result:
ultra fast: 36 fps
Changing Rep2 from 3 to 0 increased the speed to 48 fps.
Changing Smode from 2 to 0 increased it to 41 fps.
Changing EdiMode from "nnedi3" to "bob" increased it to 40.7 fps.
Changing all three together increased it to 68.1 fps. It looks like a good reasonable fps for the name.
HolyWu
28th October 2018, 11:09
Update r31.
daa, santiag, QTGMC, ivtc_txt60mc: Add device parameter.
Add smartfademod and FineDehalo functions.
LUTDeRainbow: Fix incompatibility with different subsampling.
LUTDeCrawl: Change default cthresh value to 10.
Stab: Use depan filters in mvtools plugin.
TemporalDegrain: Fix hqdn3d's namespace and filter name.
LSFmod: Speed up preblur by using MinBlur(1).
tormento
1st November 2018, 18:01
Update r31.
I'd like to give VapourSynth a run. The only filter I use is SMDegrain (oh yeah.. CompTest xD too). Could you please update your script to reflect the 100s (https://forum.videohelp.com/threads/369142-Simple-MDegrain-Mod-v3-1-2d-A-Quality-Denoising-Solution/page5#post2413356) version?
ChaosKing
1st November 2018, 19:45
If you want tr > 3 use the hnwvsfunc.SMDegrain version by Wolfberry https://forum.doom9.org/showthread.php?t=175614
poisondeathray
29th December 2018, 06:07
Would it be possible to add a smoothcurve function or similar ?
(I'm aware of SigmoidInverse and SigmoidDirect , it would be useful to have a function where you remap values directly )
Thanks
lansing
8th April 2019, 18:05
What color format does GrainFactory3 supports? My clip is RGBS and it turns it blueish.
HolyWu
8th April 2019, 22:40
What color format does GrainFactory3 supports? My clip is RGBS and it turns it blueish.
I didn't put format restriction to much of the functions in the script. Some (or many) of them probably don't work with RGB or even floating point.
FortMax
6th May 2019, 20:48
Any chance of you updating the QTGMC port to 3.362? Some older versions (including 3.33) have some weird blending issues that the newest ones fix.
ChaosKing
7th May 2019, 00:11
This is the newest avs version btw https://pastebin.com/JLGwn7mE
HolyWu
7th May 2019, 02:47
Any chance of you updating the QTGMC port to 3.362? Some older versions (including 3.33) have some weird blending issues that the newest ones fix.
I don't have spare time at the moment. Will look into it in 1~2 months. And, what's the exact settings you used for QTGMC? I need to make sure I can reproduce the issue with the same settings.
FortMax
7th May 2019, 21:38
I don't have spare time at the moment. Will look into it in 1~2 months. And, what's the exact settings you used for QTGMC? I need to make sure I can reproduce the issue with the same settings.
I was using Preset="slow", TFF=True, FPSDivisor=2.
It's more noticeable in animation, especially on thicker lines, than it is with live-action stuff. It also can mess with stuff like overlayed text that just appears and disappears as opposed to fading.
pcroland
27th May 2019, 18:30
Dear HolyWu!
I really appreciate your work. Would you be so kind to add/port the following AviSynth script to your collection: FixRowBrightnessMod (and also its Column variant).
Here's the AVS code:
Function FixRBr(clip c, int row, float adj_val, int "prot_val")
{
Assert(adj_val <= 100, "adj_val max value 100")
Assert(adj_val >= -100, "adj_val min value -100")
p = Pow(2, BitsPerComponent(c))-1
b = p-10*(Pow(2, (BitsPerComponent(c)-8)))
prot_val = Default(prot_val, 0)
Assert(prot_val <= Pow(2, BitsPerComponent(c))-1, "prot_val max value = max luma of the current bit depth")
Assert(prot_val >= 0, "prot_val min value 0")
c
ExtractY()
Crop(0,row,0,1)
adj_val >= 0 ? Expr("x 16 scaleb - 0 <= 16 scaleb 235 scaleb " + string(adj_val*2.19) + " scaleb - 16 scaleb - 0 <= 0.01 235 scaleb " + string(adj_val*2.19) + " scaleb - 16 scaleb - ? / 219 scaleb * x 16 scaleb - 235 scaleb " + string(adj_val*2.19) + " scaleb - 16 scaleb - 0 <= 0.01 235 scaleb "\
+ string(adj_val*2.19) + " scaleb - 16 scaleb - ? / 219 scaleb * 16 scaleb + ? x " + string(p-prot_val) + " - -10 scaleb / 0 max 1 min * x x " + string(b-prot_val) + " - 10 scaleb / 0 max 1 min * + 16 scaleb 235 scaleb clip") : \
Expr("x 16 scaleb - 0 <= 16 scaleb 219 scaleb / 235 scaleb " + string(adj_val*2.19) + " scaleb + 16 scaleb - * x 16 scaleb - 219 scaleb / 235 scaleb " + string(adj_val*2.19) + " scaleb + 16 scaleb - * 16 scaleb + ? x " + string(p-prot_val) + " - -10 scaleb / 0 max 1 min * x x " + string(b-prot_val) + \
" - 10 scaleb / 0 max 1 min * + 16 scaleb 235 scaleb clip")
Overlay(c.ExtractY(),last,0,row,mode="luma")
CombinePlanes(last, c, planes="YUV", sample_clip=c)
}
Function FixCBr(clip c, int column, float adj_val, int "prot_val")
{
Assert(adj_val <= 100, "adj_val max value 100")
Assert(adj_val >= -100, "adj_val min value -100")
p = Pow(2, BitsPerComponent(c))-1
b = p-10*(Pow(2, (BitsPerComponent(c)-8)))
prot_val = Default(prot_val, 0)
Assert(prot_val <= Pow(2, BitsPerComponent(c))-1, "prot_val max value = max luma of the current bit depth")
Assert(prot_val >= 0, "prot_val min value 0")
c
ExtractY()
Crop(column,0,1,0)
adj_val >= 0 ? Expr("x 16 scaleb - 0 <= 16 scaleb 235 scaleb " + string(adj_val*2.19) + " scaleb - 16 scaleb - 0 <= 0.01 235 scaleb " + string(adj_val*2.19) + " scaleb - 16 scaleb - ? / 219 scaleb * x 16 scaleb - 235 scaleb " + string(adj_val*2.19) + " scaleb - 16 scaleb - 0 <= 0.01 235 scaleb "\
+ string(adj_val*2.19) + " scaleb - 16 scaleb - ? / 219 scaleb * 16 scaleb + ? x " + string(p-prot_val) + " - -10 scaleb / 0 max 1 min * x x " + string(b-prot_val) + " - 10 scaleb / 0 max 1 min * + 16 scaleb 235 scaleb clip") : \
Expr("x 16 scaleb - 0 <= 16 scaleb 219 scaleb / 235 scaleb " + string(adj_val*2.19) + " scaleb + 16 scaleb - * x 16 scaleb - 219 scaleb / 235 scaleb " + string(adj_val*2.19) + " scaleb + 16 scaleb - * 16 scaleb + ? x " + string(p-prot_val) + " - -10 scaleb / 0 max 1 min * x x " + string(b-prot_val) + \
" - 10 scaleb / 0 max 1 min * + 16 scaleb 235 scaleb clip")
Overlay(c.ExtractY(),last,column,0,mode="luma")
CombinePlanes(last, c, planes="YUV", sample_clip=c)
}
Thank you very much for your effort.
Natty
30th May 2019, 15:17
If you want tr > 3 use the hnwvsfunc.SMDegrain version by Wolfberry https://forum.doom9.org/showthread.php?t=175614
invalid thread
ChaosKing
30th May 2019, 15:35
invalid thread
See here https://forum.doom9.org/showthread.php?p=1862691
Selur
30th May 2019, 16:58
-> https://github.com/Helenerineium/G41Fun/blob/master/G41Fun.py
HolyWu
5th July 2019, 16:03
I was using Preset="slow", TFF=True, FPSDivisor=2.
It's more noticeable in animation, especially on thicker lines, than it is with live-action stuff. It also can mess with stuff like overlayed text that just appears and disappears as opposed to fading.
Hi, I need a short sample for investigation since you said that it's more noticeable in specific content type. 2-3 seconds are sufficient.
HolyWu
7th July 2019, 16:35
Dear HolyWu!
I really appreciate your work. Would you be so kind to add/port the following AviSynth script to your collection: FixRowBrightnessMod (and also its Column variant).
Here's the AVS code:
Thank you very much for your effort.
Hi, may I know where did you get this mod version? Essentially what's the difference or improvement compared to FixRowBrightnessProtect2? I can see the used expression is different though.
pcroland
9th July 2019, 12:31
To be honest, I don't remember where I found the code. For me it is also perfect if you port the Protect2 version. I don't think it would make much difference. Thank you in advance.
Selur
1st August 2019, 15:44
I got a problem on Linux using MCTemporalDenoise
on Windows:
# Imports
import os
import sys
import ctypes
# Loading Support Files
Dllref = ctypes.windll.LoadLibrary("I:/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'I:/Hybrid/64bit/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DenoiseFilter/TTempSmooth/TTempSmooth.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DenoiseFilter/FFT3DFilter/fft3dfilter.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/DCTFilter.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DeblockFilter/Deblock/Deblock.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/FFMS2/ffms2k.dll")
# Import scripts
import havsfunc
# Loading source using FFMS2K
clip = core.ffms2.Source(source="F:/TESTCL~1/files/test.avi",cachefile="E:/Temp/avi_078c37f69bb356e7b5fa040c71584c40_853323747.ffindex",format=vs.YUV420P8,alpha=False)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25/1
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# denoising using MCTemporalDenoise
clip = havsfunc.MCTemporalDenoise(i=clip, settings="low")
# Output
clip.set_output()
works fine.
On Linux (Ubuntu 19.04) calling:
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = '/home/selur/opt/hybrid/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="/home/selur/opt/hybrid/vsfilters/libttempsmooth.so")
core.std.LoadPlugin(path="/home/selur/opt/hybrid/vsfilters/libdfttest.so")
core.std.LoadPlugin(path="/home/selur/opt/hybrid/vsfilters/libfft3dfilter.so")
core.std.LoadPlugin(path="/home/selur/opt/hybrid/vsfilters/libdctfilter.so")
core.std.LoadPlugin(path="/home/selur/opt/hybrid/vsfilters/libdeblock.so")
core.std.LoadPlugin(path="/home/selur/opt/hybrid/vsfilters/libmvtools.so")
core.std.LoadPlugin(path="/home/selur/opt/hybrid/vsfilters/libffms2.so")
# Import scripts
import havsfunc
# Loading source using FFMS2
clip = core.ffms2.Source(source="/home/selur/Schreibtisch/test.avi",cachefile="/home/selur/Schreibtisch/HybridTemp/avi_77c74b7b15937c7267959c738c5ee2fa_936145377.ffindex",format=vs.YUV420P8,alpha=False)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25/1
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# denoising using MCTemporalDenoise
clip = havsfunc.MCTemporalDenoise(i=clip, settings="low")
# Output
clip.set_output()
I get:
Failed to evaluate the script:
Python exception: DFTTest: invalid entry in sigma string
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1942, in vapoursynth.vpy_evaluateScript
File "src/cython/vapoursynth.pyx", line 1943, in vapoursynth.vpy_evaluateScript
File "/home/selur/Schreibtisch/HybridTemp/tempPreviewVapoursynthFile16_39_42_491.vpy", line 28, in <module>
clip = havsfunc.MCTemporalDenoise(i=clip, settings="low")
File "/home/selur/opt/hybrid/vsscripts/havsfunc.py", line 2784, in MCTemporalDenoise
p = core.dfttest.DFTTest(i, tbsize=1, sstring='0.0:4.0 0.2:9.0 1.0:15.0', planes=planes)
File "src/cython/vapoursynth.pyx", line 1848, in vapoursynth.Function.__call__
vapoursynth.Error: DFTTest: invalid entry in sigma string
since when using:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="/home/selur/opt/hybrid/vsfilters/libdfttest.so")
core.std.LoadPlugin(path="/home/selur/opt/hybrid/vsfilters/libffms2.so")
# Loading source using FFMS2
clip = core.ffms2.Source(source="/home/selur/Schreibtisch/test.avi",cachefile="/home/selur/Schreibtisch/HybridTemp/avi_77c74b7b15937c7267959c738c5ee2fa_936145377.ffindex",format=vs.YUV420P8,alpha=False)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25/1
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# denoising using DFTTest
clip = core.dfttest.DFTTest(clip=clip)
# Output
clip.set_output()
works fine, I don't think it's an issue of my DFTTest build.
The python version on my linux system is "Python 3.7.3 (default, Apr 3 2019, 05:39:12)" in case it matters.
Is there some way I need to modify:
p = core.dfttest.DFTTest(i, tbsize=1, sstring='0.0:4.0 0.2:9.0 1.0:15.0', planes=planes)
to make it working, or does anyone know what could be causing this?
Cu Selur
Myrsloik
1st August 2019, 15:57
Could the decimal separator by any chance be , instead of . on your linux system?
Selur
2nd August 2019, 19:54
Yes,... but that's also true for my Window system.
I assumed, like in C++ it's a thing defined by the language not the current 'local' or similar.
(that's really scary,...)
-> you are right, when I replace the dots with commas it works.
There must be a way to write such code dependent of the 'local' of the system
Myrsloik
2nd August 2019, 21:48
Yes,... but that's also true for my Window system.
I assumed, like in C++ it's a thing defined by the language not the current 'local' or similar.
(that's really scary,...)
-> you are right, when I replace the dots with commas it works.
There must be a way to write such code dependent of the 'local' of the system
It's all locale hell. There are many ways to get around it and use functions where you can specify the locale (sscanf_l instead of sscanf if available) or C++ streams or whatever.
It's also blindingly obvious dfttest got a lazy port. The arguments sstring, ssx, ssy and sst should simply be arrays of float in VS.
Selur
3rd August 2019, 08:17
opened an issue over at https://github.com/HomeOfVapourSynthEvolution/VapourSynth-DFTTest/issues/8
Something like (I don't know how to do the 'if' part properly):
if float('1.0') != float('1')
p = core.dfttest.DFTTest(i, tbsize=1, sstring='0,0:4,0 0,2:9,0 1,0:15,0', planes=planes)
else
p = core.dfttest.DFTTest(i, tbsize=1, sstring='0.0:4.0 0.2:9.0 1.0:15.0', planes=planes)
should work as a workaround, but how to write this in python3 syntax?
Git it using:
if (float("1.0") != float("1")):
p = core.dfttest.DFTTest(i, tbsize=1, sstring='0.0:4.0 0.2:9.0 1.0:15.0', planes=planes)
else:
p = core.dfttest.DFTTest(i, tbsize=1, sstring='0,0:4,0 0,2:9,0 1,0:15,0', planes=planes)
in MCTemporalDenoise
and if (float("1.0") != float("1")):
pref = core.std.MaskedMerge(core.dfttest.DFTTest(inputP, tbsize=1, sstring='0.0:4.0 0.2:9.0 1.0:15.0', planes=planes),
inputP,
core.std.Expr([mvf.GetPlane(inputP, 0)], [expr]),
planes=planes)[
else:
pref = core.std.MaskedMerge(core.dfttest.DFTTest(inputP, tbsize=1, sstring='0,0:4,0 0,2:9,0 1,0:15,0', planes=planes),
inputP,
core.std.Expr([mvf.GetPlane(inputP, 0)], [expr]),
planes=planes)
in SMDegrain, seems to fix the issue
ChaosKing
3rd August 2019, 10:21
Maybe it is easier to use locale https://docs.python.org/2/library/locale.html -> locale.setlocale(locale.LC_ALL, 'en_us')
Python returns this on a german Windows 10:
python -c "import locale; print(locale.localeconv())"
{'int_curr_symbol': '', 'currency_symbol': '', 'mon_decimal_point': '', 'mon_thousands_sep': '', 'mon_grouping': [], 'positive_sign': '', 'negative_sign': '',
'int_frac_digits': 127, 'frac_digits': 127, 'p_cs_precedes': 127, 'p_sep_by_space': 127, 'n_cs_precedes': 127,
'n_sep_by_space': 127, 'p_sign_posn': 127, 'n_sign_posn': 127, 'decimal_point': '.', 'thousands_sep': '', 'grouping': []}
Selur
3rd August 2019, 12:15
I don't like the idea of switching the locale since loading different sub-scripts from different authors inside a script that might also contain some code written by me I hate the idea that the last script that changed the locale changes the local not just for the sub-script but for the all the scripts,..
So if you change the locale it should be changed per function and restored to the previous value.
best solution would be if:
dfttest adjusts the interface to use float arrays and MCTemporalDenoise&SMDegrain would be adjusted accordingly.
-> hoping HolyWu will adjust DFTTest :)
Myrsloik
3rd August 2019, 15:50
Maybe it is easier to use locale https://docs.python.org/2/library/locale.html -> locale.setlocale(locale.LC_ALL, 'en_us')
Python returns this on a german Windows 10:
python -c "import locale; print(locale.localeconv())"
{'int_curr_symbol': '', 'currency_symbol': '', 'mon_decimal_point': '', 'mon_thousands_sep': '', 'mon_grouping': [], 'positive_sign': '', 'negative_sign': '',
'int_frac_digits': 127, 'frac_digits': 127, 'p_cs_precedes': 127, 'p_sep_by_space': 127, 'n_cs_precedes': 127,
'n_sep_by_space': 127, 'p_sign_posn': 127, 'n_sign_posn': 127, 'decimal_point': '.', 'thousands_sep': '', 'grouping': []}
That is a really horrible idea. Now imagine using VS from inside an application that itself sets the locale to something in order to work. You've now broken everything.
LIBRARIES MUST NEVER MODIFY GLOBAL APPLICATION STATE
ChaosKing
3rd August 2019, 15:57
In my head it was only for a script and not global... :D
But you could change it back at the end of the script.
Selur
4th August 2019, 08:50
Holywo adjusted the library by changing the local to us and back,..
HolyWu
6th August 2019, 16:05
Update r32:
MCTemporalDenoise: Add option edgeclean.
Add functions dec_txt60mc, ivtc_txt30mc, FixColumnBrightness, FixRowBrightness, FixColumnBrightnessProtect, FixRowBrightnessProtect, FixColumnBrightnessProtect2, FixRowBrightnessProtect2, and bbmod.
Keep up with the changes in DFTTest.
Boulder
16th August 2019, 18:15
I have a weird issue with QTGMC. If I use it to get a double-rate output out of this clip here, there are some weird vertical artifacts. I tested both presets very slow and very fast, and the same issue is there.
Take a closer look at the bass player in the screenshot.
https://drive.google.com/open?id=1BuRWBaX7BjFp3nBjCSDEDEu7ZuaM9NQV (sample m2ts)
https://drive.google.com/open?id=1AMxv9F6taHSoCGGGxbIEF71cFbl-fcJl (screenshot)
If I just separate the fields, there's nothing strange there.
poisondeathray
16th August 2019, 19:33
I have a weird issue with QTGMC. If I use it to get a double-rate output out of this clip here, there are some weird vertical artifacts. I tested both presets very slow and very fast, and the same issue is there.
Take a closer look at the bass player in the screenshot.
https://drive.google.com/open?id=1BuRWBaX7BjFp3nBjCSDEDEu7ZuaM9NQV (sample m2ts)
https://drive.google.com/open?id=1AMxv9F6taHSoCGGGxbIEF71cFbl-fcJl (screenshot)
If I just separate the fields, there's nothing strange there.
I cannot reproduce with vapoursynth , using lsmash as the source filter . Looks ok in avisynth too.
Perhaps it's a source filter issue ? Check that it's decoding correctly
Your screenshot looks lossy despite being a PNG. Perhaps it's an encoder/encoding settings issue ?
Boulder
16th August 2019, 20:11
The source filter is DGDecNV, and there's no problem if I just separate the fields. I'd assume that a decoding issue would also show up there. I also tried bobbing with TDeintMod and it doesn't cause the artifacts.
poisondeathray
16th August 2019, 20:24
Vapoursynth 47.2 ?
Also check your plugin/dependency versions
ChaosKing
16th August 2019, 21:00
Can not reproduce. Tested with R47.2, DGDecNV + lsmas and latest havsfunc.
haf.QTGMC(dgi, Preset="slower", TFF=True)
Boulder
16th August 2019, 21:44
I'll have to try updating all the plugins and stuff, maybe there is something causing it.
lansing
17th August 2019, 02:25
I'll have to try updating all the plugins and stuff, maybe there is something causing it.
I can reproduce it with earlier vs version, it is okay with newest version.
Boulder
17th August 2019, 10:35
I can reproduce it with earlier vs version, it is okay with newest version.
That's true. I just upgraded from R47 to R47.2 and it's gone :)
Mystery Keeper
17th August 2019, 20:48
Same issue I had with mxNet. Yes, VS 47.2 fixes it.
fAy01
1st September 2019, 21:29
Thanks for filling my previous requests. Would you consider porting InpaintDelogo https://forum.doom9.org/showthread.php?t=176860 ? Furthermore, I'm interested to see how it'd perform against logoNR.
Also, please port SmoothD2 to as well. http://avisynth.nl/index.php/SmoothD2 <-- SmoothD2 performs better than other deblocking plugin and scripts (DeblockPP7, deblock_qed, and AutoDeblock).
poisondeathray
2nd October 2019, 05:02
Overlay bug? havsfunc r32
A foreground clip smaller in dimensions than the background clip, cuts out with black to fill the height
avisynth
https://i.postimg.cc/6pNPV4nf/overlay-avs.png
vapoursynth
https://i.postimg.cc/zX3DmMcc/overlay-vpy.png
avs
fg=blankclip(1,1024,640,"RGB24",color=color_darkred)
bg=blankclip(1,1280,720,"RGB24",color=color_gray)
overlay(bg,fg)
vpy
fg = core.std.BlankClip(width=1024, height=640, format=vs.RGB24, fpsnum=24, fpsden=1, length=1, color=[139, 1, 0])
bg = core.std.BlankClip(width=1280, height=720, format=vs.RGB24, fpsnum=24, fpsden=1, length=1, color=[128, 128, 128])
overl = haf.Overlay(bg, fg)
overl.set_output()
EDIT: also, x=, y= positioning do not seem to work in vpy overlay (e.g. x=20, y=20) - it just returns the bg clip; but works ok in avisynth
HolyWu
2nd October 2019, 08:16
Overlay bug? havsfunc r32
A foreground clip smaller in dimensions than the background clip, cuts out with black to fill the height
It likely is a MaskedMerge bug introduced in VS R47. Try again with VS R46.
poisondeathray
2nd October 2019, 15:32
It likely is a MaskedMerge bug introduced in VS R47. Try again with VS R46.
Works with R46.
_Al_
2nd October 2019, 15:47
for overlay you can use this overlay function (based on our discussion on ramping), I just simplified that, no moduls needed only numpy.
avantages: much faster, YUV does not need to be converted to 444, numpy does it on the fly even chroma resolutions, works with any vs format
cons: numpy modul needed
formats needs to be the same though, also make sure the lengths are same, and there is enough room for pasting pip did not troubleshoot that:
import vapoursynth as vs
from vapoursynth import core
import numpy as np
file1 = r'C:\path\background.mp4'
file2 = r'D:\path\pasted_video.avi'
X1,Y1 = (100,100)
clip = core.ffms2.Source(file1)
pip = core.ffms2.Source(file2)
#make sure clips have the same format and lenght, then continue
def overlay(clip, pip, X1, Y1):
pl = clip.format.num_planes
if clip.format.name == 'CompatBGR32':
Y1 = clip.height - (Y1 + pip.height) #Y is mirrored
X2,Y2 = (X1 + pip.width, Y1 + pip.height)
#shifting 0,1 or 2 to get chroma coordinates, equivalent of dividing Y plane coordinates by 1,2 or 4
X1CH,Y1CH = (X1 >> clip.format.subsampling_w, Y1 >> clip.format.subsampling_h)
X2CH,Y2CH = (X2 >> clip.format.subsampling_w, Y2 >> clip.format.subsampling_h)
def pip_func(n,f):
fout = f[0].copy()
for p in range(pl):
plane = np.asarray(f[0].get_read_array (p))
rectangle = np.asarray(f[1].get_read_array (p))
plane_out = np.asarray(fout.get_write_array(p))
if p: plane[Y1CH:Y2CH, X1CH:X2CH] = rectangle #p=1,2 U,V plane
else: plane[Y1:Y2, X1:X2] = rectangle #p=0 Y plane
np.copyto(plane_out, plane) #writing np.array plane into vapoursynth._memoryviewslice
del plane_out
return fout
return core.std.ModifyFrame(clip, [clip,pip], pip_func)
clip = overlay(clip, pip, X1, Y1)
clip.set_output()
poisondeathray
2nd October 2019, 16:04
Thanks _Al_ ;
I don't "need" it right now in terms of some pressing engagement :) ; but there are some functions and scripts that rely MaskedMerge and/or Overlay that are probably broken in R47.x
If that method is better in terms of pros/cons , maybe it can be implemented in vapoursynth core, maskedmerge, or havsfunc overlay ?
_Al_
2nd October 2019, 16:20
To be fully replaceable, opacity and mask arguments would need to be added. Havsfunc.Overlay offers arguments like that, in a sense if there is no opacity it might not be calledd overlay (as I named that function). It would involve some numpy calculations to achieve that. But MaskedMerge is a vs function, so it is fast, it would be interesting to compare it speed wise.
ChaosKing
20th October 2019, 20:46
Contrasharpen and smdegrain(contrasharp=True) produce a pink border. VS R48 RC1
clip = core.std.BlankClip(format=vs.YUV420P8)
clip=haf.SMDegrain(clip, contrasharp=True)
Myrsloik
20th October 2019, 21:07
Contrasharpen and smdegrain(contrasharp=True) produce a pink border. VS R48 RC1
clip = core.std.BlankClip(format=vs.YUV420P8)
clip=haf.SMDegrain(clip, contrasharp=True)
I can't reproduce it. Using the vsrepo version of everything. Try adding vs.core.std.SetMaxCPU("none") to the start of the script on your end.
ChaosKing
20th October 2019, 22:48
The pink border disappears with SetMaxCPU("none"). My cpu is a ryzen 2600
With SetMaxCPU("avx2") and "sse2" it's still pink.
EDIT
With BlankClip(format=vs.YUV420P16) (and 420P10) it's the same, except that sse2 produces vertical stripes.
EDIT
422, 444 is also affected.
l00t
21st October 2019, 07:42
bbmod also seems to be affected, it was OK with R47.2 and broken in R48-RC1
(tested with YUV420P8, YUV444P16 and YUV420P16)
Contrasharpen and smdegrain(contrasharp=True) produce a pink border. VS R48 RC1
clip = core.std.BlankClip(format=vs.YUV420P8)
clip=haf.SMDegrain(clip, contrasharp=True)
Myrsloik
21st October 2019, 08:11
bbmod also seems to be affected, it was OK with R47.2 and broken in R48-RC1
(tested with YUV420P8, YUV444P16 and YUV420P16)
I still can't reproduce it. What are you using to view the output?
l00t
21st October 2019, 08:39
VapourSynth Edtior r19
ChaosKing
21st October 2019, 08:46
vsedit r19
import vapoursynth as vs
import mvsfunc as mvf
import havsfunc as haf
core = vs.core
clip = core.std.BlankClip(width=200,height=100, format=vs.YUV420P8)
sm=haf.SMDegrain(clip, contrasharp=True) # havsfunc from master
clip=core.std.StackHorizontal([clip.text.Text("blank"), sm.text.Text("smdegrain +\ncontrasharp \ncpu default/not set")])
vs.core.std.SetMaxCPU("none")
clip2 = core.std.BlankClip(width=200,height=100, format=vs.YUV420P8)
sm=haf.SMDegrain(clip2, contrasharp=True) # havsfunc from master
clip2=core.std.StackHorizontal([clip2.text.Text("blank"), sm.text.Text("smdegrain +\ncontrasharp cpu none")])
c=core.std.StackVertical([clip, clip2])
vs.core.std.SetMaxCPU("sse2")
clip3 = core.std.BlankClip(width=200,height=100, format=vs.YUV420P16) #16!
sm=haf.SMDegrain(clip3, contrasharp=True) # havsfunc from master
clip3=core.std.StackHorizontal([clip3.text.Text("blank"), sm.text.Text("smdeg + contrasharp \ncpu sse2 16bit")])
c=core.std.StackVertical([c, mvf.Depth(clip3, 8)])
c.set_output()
https://i.imgur.com/ybD5pyT.png
Myrsloik
21st October 2019, 08:58
Nice, that manages to reproduce the green stripes. Oddly enough the pink border doesn't happen on my system.
ChaosKing
21st October 2019, 09:19
And if it helps. The problem is produced somewhere in contrahsrapening and not smdegrain: https://github.com/HomeOfVapourSynthEvolution/havsfunc/blob/master/havsfunc.py#L5406
It's a short script and the pink border still happens if you remove miniblur.
When I remove the only Expr line, the stripes disappear but the pink border is still there. Border could be Repair or MakeDiff. Will test later more.
EDIT
should this produce a pink image?
clip = core.std.BlankClip(width=200,height=100, format=vs.YUV420P8)
matrix1 = [1, 2, 1, 2, 4, 2, 1, 2, 1]
con = core.std.Convolution(clip, matrix=matrix1)
clip=core.std.MakeDiff(clip, con)
EDIT2
mode=0 -> green image. So I guess the pink border comes from MakeDiff.
https://i.imgur.com/5oXvbKc.png
EDIT3
This is how it looks in R47
https://i.imgur.com/QqzGMJG.png
Myrsloik
21st October 2019, 09:30
And if it helps. The problem is produced somewhere in contrahsrapening and not smdegrain: https://github.com/HomeOfVapourSynthEvolution/havsfunc/blob/master/havsfunc.py#L5406
It's a short script and the pink border still happens if you remove miniblur.
When I remove the only Expr line, the stripes disappear but the pink border is still there. Border could be Repair or MakeDiff. Will test later more.
EDIT
should this produce a pink image?
clip = core.std.BlankClip(width=200,height=100, format=vs.YUV420P8)
matrix1 = [1, 2, 1, 2, 4, 2, 1, 2, 1]
con = core.std.Convolution(clip, matrix=matrix1)
clip=core.std.MakeDiff(clip, con)
I've narrowed down the green lines. They happen with expr and 16 bit formats in the sse2 code path.
The script you posted definitely shouldn't be pink. For some odd reason it's not pink on my computer which should use exactly the same code path (threadripper 1950x).
Are_
21st October 2019, 12:36
AMD Ryzen 7 1700 here and no pink image, only the green strips bug.
ChaosKing
21st October 2019, 13:02
I tested now with the portable version and it only shows the green stripes. It seems I had still 48-test2 installed,.. I was sure it was the RC edition, sry :o
Installing the RC removed the pink border
At least my incompetence has found another bug :p
ChaosKing
22nd October 2019, 21:37
Is it possible to port also FineDehalo_contrasharp? It returns a nice sharp image.
avs+ version
# level == 1.0 : normal contrasharp
Function FineDehalo_contrasharp (clip dehaloed, clip src, float level)
{
bb = dehaloed.RemoveGrain (11, -1)
bb2 = bb.Repair (bb.Repair (bb.Medianblur (2, -256, -256), 1), 1)
xd = mt_makediff (bb, bb2)
xd = VersionNumber() < 2.6 ? xd.mt_lut ("x 128 - 2.49 * "+String(level)+" * 128 +")
\ : xd.mt_lut ("x range_half - 2.49 * "+String(level)+" * range_half +")
xdd = mt_lutxy (
\ xd,
\ mt_makediff (src, dehaloed),
\ VersionNumber() < 2.6 ? "x 128 - y 128 - * 0 < 128 x 128 - abs y 128 - abs < x y ? ?"
\ : "x range_half - y range_half - * 0 < range_half x range_half - abs y range_half - abs < x y ? ?"
\ )
dehaloed.mt_adddiff (xdd, y=3, u=2, v=2)
}
Function FineDehalo_contrasharp (clip dehaloed, clip src, float level)
{
bb = dehaloed.RemoveGrain (11, -1)
bb2 = bb.Repair (bb.Repair (bb.Medianblur (2, -256, -256), 1), 1)
xd = mt_makediff (bb, bb2)
xd = xd.mt_lut ("x 128 - 2.49 * "+String(level)+" * 128 +")
xdd = mt_lutxy (
\ xd,
\ mt_makediff (src, dehaloed),
\ "x 128 - y 128 - * 0 < 128 x 128 - abs y 128 - abs < x y ? ?"
\ )
dehaloed.mt_adddiff (xdd, y=3, u=2, v=2)
}
HolyWu
23rd October 2019, 03:40
Is it possible to port also FineDehalo_contrasharp? It returns a nice sharp image.
Doesn't FineDehalo already have a contra parameter for contrasharpening?
ChaosKing
23rd October 2019, 09:28
lol I never noticed xD
But an external "dehalo contrasharp" is still usefull. It can be used with other dehalo functions.
HolyWu
23rd October 2019, 09:45
But an external "dehalo contrasharp" is still usefull. It can be used with other dehalo functions.
I'd like to know how is the result compared to Didée's ContraSharpening function. Is it only suitable for denoising but not the others?
ChaosKing
23rd October 2019, 10:08
ContraSharpening adds halos back. It seems it is only usefull for denoised clips.
poisondeathray
6th March 2020, 03:10
Does the overlay function work for RGBS ? It seems values are incorrect, but correct with maskedmerge
a = core.std.BlankClip(format=vs.RGBS, color=[1, 1, 1])
b = core.std.BlankClip(format=vs.RGBS, color=[2, 2, 2])
c = core.std.BlankClip(format=vs.RGBS, color=[0.5, 0.5, 0.5])
opacity = 0.5
msk = core.std.BlankClip(a, color=[opacity, opacity, opacity])
ov = haf.Overlay(a,b,opacity=0.5)
mm = core.std.MaskedMerge(a,b,mask=msk)
ov.set_output()
#mm.set_output()
For example, a,b with opacity 0.5 correctly gives RGB [1.5,1.5,1.5] with maskedmerge, but some error value for overlay
HolyWu
6th March 2020, 04:38
Does the overlay function work for RGBS ? It seems values are incorrect, but correct with maskedmerge
Fixed.
poisondeathray
6th March 2020, 21:50
Fixed.
Thanks!
Would it be possible to add overlay blend modes? Such as "add", "multiply", "screen", etc..
HolyWu
12th March 2020, 13:41
Would it be possible to add overlay blend modes? Such as "add", "multiply", "screen", etc..
Added. But I don't see "screen" as one of the modes in http://avisynth.nl/index.php/Overlay :confused:
poisondeathray
12th March 2020, 15:50
Added. But I don't see "screen" as one of the modes in http://avisynth.nl/index.php/Overlay :confused:
Thanks!
"screen" is not in the overlay avs version, but it's one of the more common compositing/photoshop blend modes used
rr42 translated some here for uu_mt_blend based on maskttools, and there are some links to the math behind them in the 1st post. I don't think that version supports different bit depths
https://forum.doom9.org/showthread.php?t=170490
https://photoblogstop.com/photoshop/photoshop-blend-modes-explained
Screen
1−(1−A)×(1−B)
A inverted multiplied by B inverted, and the product is inverted
poisondeathray
25th March 2020, 05:50
YUV overlay mask transparency issue. Partial transparency issue on 100% white areas
-affects YUV overlay operations in 10bit, different subsamplings.
-RGB overlay operations seem ok
-does not matter if you mark YUV versions as "limited" range or "full"
-Works ok if you use Gray8 for the mask, and base clip / overlay clip are matching 8bit YUV ; or Gray16 and base/overlay are matching 16bit YUV . But there is no Gray10 format, so 10bit YUV overlay with mask is out of luck, or 12bit YUV
-works as expected if you go back to older havsfunc version a few months ago, with matching pixel format YUVxxxPx mask instead of using GRAYx mask. Not sure where the exact commit altered it, possibly the recent ones
eg.
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
orig = core.imwri.Read(r'testchart.png')
logo = core.imwri.Read(r'logo.png', alpha=True)
orig2 = core.resize.Bicubic(orig, format=vs.YUV420P10, matrix_s="709")
logobase2 = core.resize.Bicubic(logo[0], format=vs.YUV420P10, matrix_s="709", range_s="full")
logoalpha2 = core.resize.Bicubic(logo[1], format=vs.YUV420P10, matrix_s="709", range_s="full")
#logoalpha2 = core.std.SetFrameProp(logoalpha2, prop="_ColorRange", intval=1) # Mark video as limited range.
#logoalpha2 = core.resize.Bicubic(logo[1], format=vs.GRAY8, matrix_s="709", range_s="full")
#RGB24, RGB30, RGB48 work ok
#orig2 = core.resize.Bicubic(orig, format=vs.RGB30)
#logobase2 = core.resize.Bicubic(logo[0], format=vs.RGB30)
#logoalpha2 = core.resize.Bicubic(logo[1], format=vs.RGB30)
overl = haf.Overlay(orig2, logobase2, mask=logoalpha2)
overl.set_output()
Test images
https://www.mediafire.com/file/vy6k8c6eon4widc/overlay_test_images.zip/file
HolyWu
25th March 2020, 08:06
YUV overlay mask transparency issue. Partial transparency issue on 100% white areas
Thanks. Should be fixed now (rebased into the last commit).
But there is no Gray10 format, so 10bit YUV overlay with mask is out of luck, or 12bit YUV
You can use core.register_format (http://www.vapoursynth.com/doc/pythonreference.html#Core.register_format) for formats without constants predefined.
logoalpha2 = core.resize.Bicubic(logo[1], format=core.register_format(vs.GRAY, vs.INTEGER, 10, 0, 0).id, matrix_s="709", range_s="full")
poisondeathray
25th March 2020, 16:46
Thanks for the fix and the info HolyWu . Didn't know about core.register_format
poisondeathray
25th March 2020, 17:11
Sorry, it doesn't seem "fixed" . Same script as above
Or are you saying you should always use GRAY, and with core.register_format if it's not a predefined format ?
HolyWu
25th March 2020, 18:08
Sorry, it doesn't seem "fixed" . Same script as above
These are my results.
orig = core.imwri.Read(r'testchart.png')
logo = core.imwri.Read(r'logo.png', alpha=True)
orig2 = core.resize.Bicubic(orig, format=vs.YUV420P10, matrix_s="709")
logobase2 = core.resize.Bicubic(logo[0], format=vs.YUV420P10, matrix_s="709")
logoalpha2 = core.resize.Bicubic(logo[1], format=vs.YUV420P10, matrix_s="709", range_s="full")
overl = haf.Overlay(orig2, logobase2, mask=logoalpha2)
overl.set_output()
https://i.postimg.cc/bs7FrwVK/YUV420-P10.png (https://postimg.cc/bs7FrwVK)
orig = core.imwri.Read(r'testchart.png')
logo = core.imwri.Read(r'logo.png', alpha=True)
orig2 = core.resize.Bicubic(orig, format=vs.RGB30)
logobase2 = core.resize.Bicubic(logo[0], format=vs.RGB30)
logoalpha2 = core.resize.Bicubic(logo[1], format=vs.RGB30)
overl = haf.Overlay(orig2, logobase2, mask=logoalpha2)
overl.set_output()
https://i.postimg.cc/zVCTwDGm/RGB30.png (https://postimg.cc/zVCTwDGm)
poisondeathray
25th March 2020, 18:22
It's correct. Sorry for false alarm
It turns out wrong havsfunc.py version was loading
Thanks again
sl1pkn07
25th March 2020, 21:30
offtopic
dat logo. where?
greetings
EDIT: done! http://forum.doom9.net/showthread.php?p=1847472#post1847472
tormento
5th April 2020, 11:00
I am thinking about giving a try to VapourSynth.
I mainly use SMDegrain from real.finder and it basically needs MVTools, Masktools and KNLMeansCL.
AFAIK Masktools is included into VS core, KNLMeans is compatible but I have doubts about which versione of VS MVTools I have to use: single precision ones or the other one? What are the differences?
I'd like also to know if there is an implementation of CompTest.avsi:
function Comptest(clip c, float percent)
{
frange = floor(14./(percent/100.))
return SelectRangeEvery(c, frange, 14)
}
Myrsloik
5th April 2020, 11:11
I am thinking about giving a try to VapourSynth.
I mainly use SMDegrain from real.finder and it basically needs MVTools, Masktools and KNLMeansCL.
AFAIK Masktools is included into VS core, KNLMeans is compatible but I have doubts about which versione of VS MVTools I have to use: single precision ones or the other one? What are the differences?
I'd like also to know if there is an implementation of CompTest.avsi:
function Comptest(clip c, float percent)
{
frange = floor(14./(percent/100.))
return SelectRangeEvery(c, frange, 14)
}
1. ALWAYS use vsrepo. It's your friend and will give you the right versions of everything. Especially for things like HAvsFunc it will save you hours of looking for things.
2. MVTools differences; the single precision one is just what the name implies, a special version that only supports single precision float.
3. Untested but something like this:import math
def comptest(clip, percent)
frange = math.floor(1400/percent)
return clip.std.SelectEvery(cycle=frange, offsets=list(range(0, 14)))
tormento
5th April 2020, 11:14
MVTools differences; the single precision one is just what the name implies, a special version that only supports single precision float.
Thanks for your reply.
But what version do I need to run HAVSFunc? :)
Myrsloik
5th April 2020, 11:20
Thanks for your reply.
But what version do I need to run HAVSFunc? :)
Normal
tormento
5th April 2020, 11:25
Normal
As you are so kind, how would you translate this AVS script into VS script?
SetMemoryMax(8000)
SetFilterMTMode("DEFAULT_MT_MODE", 2)
LoadPlugin("D:\eseguibili\media\DGDecNV_x64\DGDecodeNV.dll")
DGSource("E:\in\something.dgi",ct=0,cb=0,cl=0,cr=0)
CompTest(1)
SMDegrain (tr=4, thSAD=500, refinemotion=false, n16=true, mode=0, contrasharp=false, PreFilter=4, truemotion=false, plane=4, chroma=true)
Prefetch(6)
ChaosKing
5th April 2020, 12:55
import vapoursynth as vs
import math
import havsfunc as haf
core = vs.core
core.max_cache_size = 8000
def comptest(clip, percent):
frange = math.floor(1400/percent)
return clip.std.SelectEvery(cycle=frange, offsets=list(range(0, 14)))
clip = core.dgdecodenv.DGSource(r"E:\in\something.dgi", ct=0,cb=0,cl=0,cr=0)
clip = comptest(clip, 1)
clip = haf.SMDegrain(clip, tr=3, thSAD=500, RefineMotion=False, truemotion=False, plane=4, chroma=True, prefilter=4)
clip.set_output()
mvtools only supports tr=3 or less.
You don't need prefetch or MTModes in VS.
tormento
5th April 2020, 14:23
mvtools only supports tr=3 or less.
:(
That's a big NO for me as I recover old videos with lot of noise/grain.
Is it a limit of the SMDegrain script implementation or of MVTools standard? I read that MVTools goes up to MDegrain24, at least for simple precision version.
tr [int: 1, "2", 3, 4, 5, 6, ...]
Temporal radius. Select between MDegrain 1, 2, 3, 4, 5, 6 or higher. Higher is generally better, but also much slower and improvements get less drastic.
This can be considered the strength of the denoising. tr 4, 5 and 6 (limit is tr=128, 64 for interlaced) require Dither's MVTools2 mod.
EDIT10:
test11
1. Binary Part: Extended Degrain to Degrain24 (24, it's my lucky number!)
2. Resurrected vmulti features from MVTools 2.6.0.5, implemented via a python module, "tr" works up to 24, guess no one will ever use a time radius > 24.... maybe?
You don't need prefetch or MTModes in VS.
How I set or limit the number of threads? DGSource and KNLMeansCL are very Video RAM demanding on multiple sessions with hi resolution video.
ChaosKing
5th April 2020, 14:37
You can use a different smdegrain version instead, it supports tr > 3: https://github.com/Selur/VapoursynthScriptsInHybrid/blob/master/G41Fun.py
It uses the single precision MVTools version from here
https://forum.doom9.org/showthread.php?t=172525
that means you must filter it in 32 float precision.
Add also this then:
import mvsfunc as mvf
import math, mvmulti
clip = mvf.Depth(clip, 32) # this before smdegrain
How to limit thread count: http://www.vapoursynth.com/doc/pythonreference.html#Core.num_threads
tormento
5th April 2020, 14:46
that means you must filter it in 32 float precision.
Thanks, man!
And how will I dither back to 8 bit?
ChaosKing
5th April 2020, 14:55
Thanks, man!
And how will I dither back to 8 bit?
clip = mvf.Depth(clip, 8)
tormento
5th April 2020, 16:03
clip = mvf.Depth(clip, 8)
I ended to do a try with your first script before using higher TR and I get lower fps on VS than AVS+, i.e. 10,58 vs 14,43.
So I watched at the created mkv: the VS is a slideshow of the same lenght of the original movie, made of still pictures, the AVS+ is the correct sampled video.
There is something wrong with the comptest. When you have time, would you please debug it for me? :p
P.S: I tried to use the other function with tr=4 and VS crashed miserably. Is there anything wrong?
import vapoursynth as vs
import math
import G41Fun as G41
import mvsfunc as mvf
import math, mvmulti
core = vs.get_core()
core.max_cache_size = 8000
core.std.LoadPlugin("d:/eseguibili/media/DGDecNV_x64/DGDecodeNV.dll")
clip = core.dgdecodenv.DGSource("E:/in/2_06trinita/chiamarlo.dgi",ct=136,cb=136,cl=0,cr=0)
clip = mvf.Depth(clip, 32) # this before smdegrain
clip = G41.SMDegrain(clip, tr=4, thSAD=500, prefilter=4)
clip = mvf.Depth(clip, 8)
clip.set_output()
ChaosKing
5th April 2020, 17:22
Script looks correct to me. Have you looked at the fps of your created video?
You can also see some infos in vsedit if you press F6, like this
Script was successfully evaluated. Output video info:
Frames: 28621 | Time: 0:19:53.734 | Size: 1920x1080 | FPS: 24000/1001 = 23.976 | Format: YUV420P8
tormento
5th April 2020, 19:21
Script looks correct to me. Have you looked at the fps of your created video?
No video created, as it crashed.
Could you please apply to a real clip and tell me?
ChaosKing
5th April 2020, 20:10
The Mvtools dll by feisty2 expects avx2 instruction set. Does you cpu support avx2?
You could try another compiled version from here https://forum.doom9.org/showthread.php?p=1823382#post1823382
tormento
6th April 2020, 09:25
The Mvtools dll by feisty2 expects avx2 instruction set. Does you cpu support avx2?
Nope. :D
Will give it a try.
Could you please find some spare time to write a working comptest?
Thanks!
EDIT: not crashing anymore but painfully slow, such as 1.0 fps instead of the 10-12 I was getting with standard MVTools.
ChaosKing
6th April 2020, 10:48
Nope. :D
Will give it a try.
Could you please find some spare time to write a working comptest?
Thanks!
EDIT: not crashing anymore but painfully slow, such as 1.0 fps instead of the 10-12 I was getting with standard MVTools.
The comptest output is the same except for the fps
This should use the original video fps
def comptest(clip, percent):
frange = math.floor(1400/percent)
return clip.std.SelectEvery(cycle=frange, offsets=list(range(0, 14))).std.AssumeFPS(clip)
tormento
6th April 2020, 10:55
The comptest output is the same except for the fps
This should use the original video fps
def comptest(clip, percent):
frange = math.floor(1400/percent)
return clip.std.SelectEvery(cycle=frange, offsets=list(range(0, 14))).std.AssumeFPS(clip)
Thanks, I will try when this movie will finish to encode.
No hint anyway for MVTools single precision. Too slow to have acceptable performance. I asked for another no AVX2 binary and the author replied me that the script is a whole mess.
How I wish standard MVTools would support highter TR...
Boulder
7th April 2020, 15:55
Do you absolutely need SMDegrain or would some other denoiser do? Off the top of my head, I'd say that any details will be long gone with radius 3 at strong settings anyway so you could do with something faster.
tormento
8th April 2020, 10:55
Do you absolutely need SMDegrain or would some other denoiser do?
I am open to alternatives with same level of detail retaining/performance. Not found any, until now.
Sharc
8th April 2020, 11:16
I am open to alternatives with same level of detail retaining/performance. Not found any, until now.
Difficult to advise when we don't know your source.....
tormento
8th April 2020, 11:19
Difficult to advise when we don't know your source.....
Mostly old reels with lot of grain, the type of movies that drive you crazy to denoise.
Sharc
8th April 2020, 11:23
Mostly old reels with lot of grain, the type of movies that drive you crazy to denoise.
KNLMeansCL? dfttest? MDegrain? TemporalDegrain2(degrainTR=8)? Any of these possibly followed by a pure temporal denoiser ... Have you tried all these?
Much depends on the particular noise/grain of the source. There is no one fits all filter.
Boulder
8th April 2020, 12:39
KNLMeansCL could be one to test. Maybe add some motion compensation with MVTools.
tormento
8th April 2020, 12:43
KNLMeansCL could be one to test. Maybe add some motion compensation with MVTools.
I.e. SMDegrain that I correctly use.
On some reels I have to use tr>3 and it’s where VS stops being of any use.
tormento
8th April 2020, 12:47
I'd say that any details will be long gone with radius 3 at strong settings anyway so you could do with something faster.
The higher tr is, the better the results, mostly on fast speed scenes. Strong settings is all another matter. On really old BW movies I have to use tr=9 with lot less detail loss than tr=3.
Sharc
8th April 2020, 12:54
I.e. SMDegrain that I correctly use.
On some reels I have to use tr>3 and it’s where VS stops being of any use.
Try Avisynth TemporalDegrain2(degrainTR=xx). xx=16 for example. It's slow though.
Boulder
8th April 2020, 12:55
I.e. SMDegrain that I correctly use.
On some reels I have to use tr>3 and it’s where VS stops being of any use.
SMDegrain uses MDegrain to denoise as far as I know, a very different method compared to KNLMeans.
It would be interesting to have sample clips of before and after filtering of one severe case where a high temporal radius is needed. I personally never go above 1 when denoising, but then again, I prefer keeping things as close to the original as it's possible.
tormento
8th April 2020, 12:57
SMDegrain uses MDegrain to denoise as far as I know, a very different method compared to KNLMeans.
KNLMeans is applied as prefilter.
Again: higher tr means more precise results as motion vectors.
High thSAD is where details start be lost.
Sharc
8th April 2020, 12:58
Maybe tormento's original has very low details?
For VHS tapes a higher TR can be beneficial.
tormento
8th April 2020, 13:00
Maybe tormento's original has very low details?
For VHS tapes a higher TR can be beneficial.
Old BW movies have way lot more details than anything produced now.
On very high quality scans, i.e. 4k or more, you can easily see the single silver particle grain.
Anyway we are going OT. All i need is a VS MVTools with support for tr>3 :)
Boulder
8th April 2020, 13:14
KNLMeans is applied as prefilter.Only affects the detection of motion, indirectly to the results.
Again: higher tr means more precise results as motion vectors.
Now there is a dilemma we all often have to deal with. How do you know the motion vector predicted to for example 10 frames in the future is any good? Often the detection is difficult already for 2-3 frames from the current frame.
tormento
8th April 2020, 13:16
Now there is a dilemma we all often have to deal with. How do you know the motion vector predicted to for example 10 frames in the future is any good? Often the detection is difficult already for 2-3 frames from the current frame.
Unless scene change (and it is the main limit of MVTools), object mostly tend to move in a way that the more frames you sample, the best interpolation you can get. I don't know exactly the MV algorithm but at least on math, to have good interpolation and extrapolation, you need data, the more, the better.
ChaosKing
8th April 2020, 13:32
Also every mvtools based deboiser can't really denoise single frames with sudden changes like flashes, explosions etc (typically found in action animes) becouse it does not have any reference frames to work with.
tormento
8th April 2020, 13:38
Also every mvtools based demoiser can't really denoise single frames with sudden changes like flashes, explosions etc (typically found in action animes) becouse it does not have any reference frames to work with.
Nothing last one frame only, unless it is flash from a photo. The more frames you can sample, the better results. With very grainy noise, it’s absolutely impossible to denoise a fast moving object with tr=3. You could have to rise until 9 on some material. I did many many times. I have a collection of almost 3 thousand DVD and BD, plus digital transfers of reels. I am not rich, I simply collect things people want to throw. I know what I am talking about.
Boulder
12th April 2020, 18:06
By the way, changing SMDegrain to support tr 1-6 should not be very hard. If you take a look at MCTemporalDenoise inside havsfunc, you can see how it is done there. I didn't check the function thoroughly, but there are a few things that need to be done, basically copying the functionality which is already done for deltas 1-3 and then do the degraining with weighted merging.
feisty2
12th April 2020, 18:17
By the way, changing SMDegrain to support tr 1-6 should not be very hard. If you take a look at MCTemporalDenoise inside havsfunc, you can see how it is done there. I didn't check the function thoroughly, but there are a few things that need to be done, basically copying the functionality which is already done for deltas 1-3 and then do the degraining with weighted merging.
the result is different from native MDegrain(tr=6), the mdegrain algorithm is here (https://github.com/IFeelBloated/vapoursynth-mvtools-sf/blob/master/src/MVDegrains.h), do the math.
Boulder
12th April 2020, 18:46
the result is different from native MDegrain(tr=6), the mdegrain algorithm is here (https://github.com/IFeelBloated/vapoursynth-mvtools-sf/blob/master/src/MVDegrains.h), do the math.
Too bad I suck at maths. What is the actual real-world difference? Just a different output but impossible to tell which one looks better or something that can be pointed out as a real flaw in the workaround?
feisty2
12th April 2020, 18:51
Too bad I suck at maths. What is the actual real-world difference? Just a different output but impossible to tell which one looks better or something that can be pointed out as a real flaw in the workaround?
the difference is pretty notable, the home-assembled version in MCTD is usually notably blurrier. there's no better or worse, just two completely different algorithms
Boulder
12th April 2020, 18:57
I don't think tormento would mind blurring :) And the limit parameter could be used to control it quite well as the default seems to be 255..
feisty2
12th April 2020, 19:04
this is insane, just grab dubhater's code and do some copy-paste and you got a legit MDegrain6 in less than 5 minutes, why bother with all that homegrown mess.
tormento
12th April 2020, 19:05
I don't think tormento would mind blurring :) And the limit parameter could be used to control it quite well as the default seems to be 255..
I'd like to see results on par as with AVS+ or it would be useless, don't you think?
If VS would prove to be faster, with same quality, as AVS+, I could consider to jump on the wagon for every day jobs. For the rare ones, unfortunately, my VS script programming in not existing.
Boulder
12th April 2020, 19:10
I don't know if there is any substantial difference in speed between the two frameworks. The biggest thing VS brought was 100% stable multithreading out of the box and the latest AVS+ builds by pinterf should be quite good indeed.
tormento
12th April 2020, 19:13
I don't know if there is any substantial difference in speed between the two frameworks.
That is what I want to discover...
I have absolutely no problems here with AVS+ and MT but 1fps more sometimese can make big difference.
Boulder
12th April 2020, 19:16
Should be quite easy to test. Create a simple script with enough frames and with the same settings (tr=3 in SMDegrain) and run "vspipe -p script.vpy ." and you'll see how many fps you get. Then do the same with AVS+, AVSMeter should be able to do the same thing.
tormento
12th April 2020, 19:48
Should be quite easy to test. Create a simple script with enough frames and with the same settings (tr=3 in SMDegrain).
Already did with tr=3. The difference is 1 FPS on 12 of average. I need to know with heavier tasks.
NullNix
26th April 2020, 21:42
So I was trying to use TemporalDegrain2 for the umpteenth time (version now off-the-net) to do some denoising of the X-Men blurays in conjunction with vapoursynth 49 and it was going badly: frames from the start were duplicated several seconds later, and other frames were dropped, changing the length of the clip and desynchronizing the audio and video. Since denoising blurays is not optional for me (the link to my home cinema is wifi and can't handle the bandwidth of a noisy bluray, even if the pointless noise didn't give me a headache), this is unfortunate.
But that's OK, I thought! I'll use QTGMC! I've denoised with that before and it was all fine: QTGMC is my go-to workhorse and always does a good-enough job, even if it doesn't quite keep all the detail TemporalDegrain2 does. But... it really isn't. The damage is so severe that it is visible even in ShowNoise=True mode: several frames of *unmodified* clip appear half a second or so after the clip's start. In non-ShowNoise mode it's even more obvious, with frames displaced up to half a second from their proper places and with some settings (see below) frames removed entirely, as previously observed with TemporalDegrain2. This is with havsfunc HEAD as of today, commit b2258c21f1713a6592a0dfd948fb358351850124.
This is all on Linux, vapoursynth r49, 10-core hyperthreaded Broadwell EP (E5-2640v4), AVX2-capable (but not AVX512-capable), everything compiled with GCC 9.3.0 (a bit after the 9.3.0 release, commit c78b41b23b360e21a43bb161c7381c71680da8f3). Python from the 3.8 branch, commit 8c3ab189ae552401581ecf0b260a96d80dcdae28.
Example (biggish uncompressed original clip, QTGMCed output, script to do it) is at http://www.esperi.org.uk/~nix/encoding/. And holy hell is this horrible. Look at the unbelievable mess around 7.5s in! At least the frame count is unchanged so the audio and video are still in sync: they're just in very much the wrong order (most obvious at 34s in, where some speech happens).
From the above link, the QTGMC call I'm using here is
ret = hv.QTGMC(ret, InputType=1, Preset="slower", EZDenoise=1.5, NoisePreset="Slower", StabilizeNoise=False)
If you take EZDenoise out, the obvious frame-chopping is gone, but you *do* suddenly get desynchronized audio, exactly as I observed with TemporalDegrain2, so the number of frames has been changed (obviously a bad thing): this actually happens in the first second or two of the clip, but it's quite hard to see in this sample. Changing the denoiser has no effect; nor does dropping StabilizeNoise.
QTGMC has never given me problems like this before, so I presume something very silly is going on, and I bet it's my fault. So, what have I done wrong? :)
(Alternatively, it might be another instance of the zero-divide-yields-NaN bug: but I doubt it somewhat, because TemporalDegrain2 was rife with them, so I squashed them, and nothing changed. Or vapoursynth itself, or one of the libraries havsfunc depends on, is being miscompiled...)
Boulder
27th April 2020, 09:22
Sounds more like problems with the source filter.
NullNix
27th April 2020, 10:10
Sounds more like problems with the source filter.
Now why didn't I think of that?! Probably because my eye skips over it because it's so routine.
... but no, source filter blameless: you do *need* a call to QTGMC in there. Going straight from source to set_output is fine.
I'm going to have to bisect this to see if it's purely a vs core bug: since I know QTGMC *used* to work perfectly well back in the vapoursynth r45.1 days and it's not the only thing now failing, that's a strong possibility. That's going to be extra fun given the Python 3.7 -> 3.8 transition in there :( (GCC got upgraded too, but for now I'll ignore that one.)
NullNix
27th April 2020, 10:33
I'm going to have to bisect this to see if it's purely a vs core bug: since I know QTGMC *used* to work perfectly well back in the vapoursynth r45.1 days and it's not the only thing now failing, that's a strong possibility. That's going to be extra fun given the Python 3.7 -> 3.8 transition in there :( (GCC got upgraded too, but for now I'll ignore that one.)
OK, it can't be just the vs core: I have proof that r48 worked late last year, but now, rebuilding r48, it has the same problem. So it is one of the other changes (GCC, Python 3.7 -> 3.8, Cython 0.29.14 -> 0.29.16, or even zimg or tesseract though I doubt it) or the source material. I'll try some source material I know worked and see if it still works.
NullNix
27th April 2020, 15:54
OK, it can't be just the vs core: I have proof that r48 worked late last year, but now, rebuilding r48, it has the same problem. So it is one of the other changes (GCC, Python 3.7 -> 3.8, Cython 0.29.14 -> 0.29.16, or even zimg or tesseract though I doubt it) or the source material. I'll try some source material I know worked and see if it still works.
More things it isn't: the input (re-ripped input that used to work now fails); Python 3.7 -> 3.8; GCC (at least as applied to VS or Python, since I restored the old versions from backups rather than recompiling with the newer GCC); MakeMKV (reripping with a version that used to work now produces ripped output that when vapoursynthed fails: the output from MakeMKV is not visibly flawed). I'm running out of ideas for things to revert and might have to resort to actually trying to debug this rather than just trying to find some combination of things that works, since nothing appears to work any more. (Not that I have any real idea where to start when trying to debug this.)
NullNix
27th April 2020, 23:15
OK, it can't be just the vs core: I have proof that r48 worked late last year, but now, rebuilding r48, it has the same problem. So it is one of the other changes (GCC, Python 3.7 -> 3.8, Cython 0.29.14 -> 0.29.16, or even zimg or tesseract though I doubt it) or the source material. I'll try some source material I know worked and see if it still works.
I've been doing a bit of idle parameter-space searching. This does not happen with the ultrafast preset, but does happen with Slower. Of the settings Slower changes, Rep0 = 4 (rather than, say, 0) causes the massive frame-chopping: TR0 > 0 causes the extra frames (early frame mangling/duplication) and audio desync. Ultimate cause not yet known: will dig deeper, but it feels to me like Merge or AverageFrames in the vs core must be fubar somehow. I fear miscompilation... particularly if (as seems likely) nobody else is seeing this.
lansing
28th April 2020, 00:50
I'm using R49, and I didn't see the frame skipping problem with your script.
jackoneill
28th April 2020, 12:25
but it feels to me like Merge or AverageFrames in the vs core must be fubar somehow.
You can put
core.std.SetMaxCPU("none")
before QTGMC. If the problem goes away then try also "sse2" and "avx2" instead of "none".
This only affects the internal filters. Several bugs were introduced in recent versions in the SSE2/AVX2 functions. Maybe you found another one.
ChaosKing
28th April 2020, 12:41
I had also the feeling that the AverageFrames function did nothing, but it was late so I thought I just used it wrong...
Tested again and:
clip.misc.AverageFrames(weights=30) # or any other weights value -> seems to do nothing at all. setting setcpu to none does not help
clip.misc.AverageFrames(weights=3, scale=1) -> pink image even with a blank YUV420P8 clip, rgb seems fine with a blank clip. But is looks like a rainbow with a rgb video
EDIT: https://github.com/vapoursynth/vapoursynth/issues/565
Myrsloik
28th April 2020, 13:03
I had also the feeling that the AverageFrames function did nothing, but it was late so I thought I just used it wrong...
Tested again and:
clip.misc.AverageFrames(weights=30) # or any other weights value -> seems to do nothing at all. setting setcpu to none does not help
clip.misc.AverageFrames(weights=3, scale=1) -> pink image even with a blank YUV420P8 clip, rgb seems fine with a blank clip. But is looks like a rainbow with a rgb video
EDIT: https://github.com/vapoursynth/vapoursynth/issues/565
If I'm not mistaken the scale is the sum of weights unless it's explicitly specified. So no change sounds about right. (multiply by 30 and then divide by 30)
The second one generates a huge amount of overflow so no wonder it looks bad.
Basically the case with only one weight is pointless.
ChaosKing
28th April 2020, 14:00
ok but is a pink image correct or not?
left clip.misc.AverageFrames(weights=5, scale=1.1), right untouched
https://i.imgur.com/T3kQUGZ.png
The doc says "If a single clip is supplied then an odd number of weights are needed and they will instead be temporally centered on the current frame of the clip"
shouldn't I be seeing temporal "artifacs" then, lets say, weights=5?
Myrsloik
28th April 2020, 14:10
ok but is a pink image correct or not?
left clip.misc.AverageFrames(weights=5, scale=1.1), right untouched
https://i.imgur.com/T3kQUGZ.png
Does it look identical to expr "x 5 * 1.1 /" applied to all planes? If so the answer is mostly yes.
ChaosKing
28th April 2020, 14:21
It looks almost the same. MergeDiff diff shows some differences on edges and black hair, basically on dark colors. Is this to be expected?
a = clip.misc.AverageFrames(weights=5, scale=1.1)
e = core.std.Expr([clip], expr=["x 5 * 1.1 /"])
#clip = core.std.StackHorizontal([a,e])
clip = core.std.MergeDiff(e,a)
HolyWu
28th April 2020, 15:43
shouldn't I be seeing temporal "artifacs" then, lets say, weights=5?
There is no temporal processing since you specified only one weight with a single clip. To have actual temporal processing with a single clip you need specify at least three weights.
NullNix
28th April 2020, 15:51
You can put
core.std.SetMaxCPU("none")
before QTGMC. If the problem goes away then try also "sse2" and "avx2" instead of "none".
This only affects the internal filters. Several bugs were introduced in recent versions in the SSE2/AVX2 functions. Maybe you found another one.
All problems persist even with "none". But this eliminates a bunch of tricksy assembler in the vs core as a possible cause, as well as its corresponding non-assembler variants, which is extremely valuable! Thank you!
(hmm, that's an idea. I'll roll back not only vapoursynth but also all vs plugins containing native code to the versions as of last year and see if the problem persists.)
ChaosKing
28th April 2020, 16:36
There is no temporal processing since you specified only one weight with a single clip. To have actual temporal processing with a single clip you need specify at least three weights.
Ahh yes, now I can see what I expected to see :p
:thanks:
NullNix
1st May 2020, 15:49
All problems persist even with "none". But this eliminates a bunch of tricksy assembler in the vs core as a possible cause, as well as its corresponding non-assembler variants, which is extremely valuable! Thank you!
(hmm, that's an idea. I'll roll back not only vapoursynth but also all vs plugins containing native code to the versions as of last year and see if the problem persists.)
No effect. What on earth is going on?!
So let's look closer. The clip I've been using starts out with blankness, concealing any funny stuff going on at its start. If you slice that blankness off (and take advantage of that to reduce the clip length to 10s to speed up experiments), it's clear that even with preset="ultra fast", TR=2, funny stuff is definitely still going on: it's just concentrated entirely at the start. It's obvious even without the soundtrack. The first frame is preserved, but the next second of the input appears to be silently erased: http://www.esperi.org.uk/~nix/encoding/slice.orig.vid vs the post-QTGMC http://www.esperi.org.uk/~nix/encoding/slice.qtgmc.y4m.
Small wonder the audio and video are desynchronized after that!
I'm fairly sure QTGMC isn't meant to silently drop frames :(
HolyWu
24th June 2020, 16:55
"screen" is not in the overlay avs version, but it's one of the more common compositing/photoshop blend modes used
More blend modes are added now. Please give it a try.
poisondeathray
24th June 2020, 18:03
More blend modes are added now. Please give it a try.
Thanks,
Something is buggy with the "normal" overlay mode with mask in the 20200624 version.
The overlay is partially transparent (but mask area seems correct; 100% white, 1023 in 10bit), and background colors change.
If I revert back to an older version, say 20200524 , it works ok
Test example
https://www.mediafire.com/file/fgyvklebtemnvoe/overlay_tests.7z/file
v = core.imwri.Read(r'RGB_10bit_grad_1024x480.dpx')
v = core.resize.Point(v, width=1024 , height=480, format=vs.YUV444P10, matrix_s="709", range_s="full")
ovr = core.imwri.Read(r'8bit_overlay.png', alpha=True)
ovr[0] = core.resize.Point(ovr[0], format=vs.YUV444P10, matrix_s="709", range_s="full")
ovr[1] = core.resize.Point(ovr[1], format=vs.YUV444P10, matrix_s="709", range_s="full")
v2 = haf.Overlay(v, ovr[0], mask=ovr[1])
#ovr[0].set_output()
#ovr[1].set_output()
#v.set_output()
v2.set_output()
monohouse
24th June 2020, 21:47
hi I have some problem with MCTD, it creates more noise looks like adding noise, it looks like white squares, very visible in the top left but if you look closely they are everywhare :x
http://manoa.dream.org.il/Pics/noise.png
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
core.set_max_cache_size(7000)
clip = core.ffms2.Source("/mnt/2TWDPrimary/Babylon 5/Season 1/03. Born to the Purple.mkv")
clip = haf.QTGMC( clip, TFF=True, Preset="Placebo", ShowSettings=False, opencl=False, TR0=2, TR1=2, SourceMatch=0, TR2=0, Lossless=0, Sharpness=0 )
clip = haf.MCTemporalDenoise(clip, radius=3, limit=2, twopass=False, limit2=2, refine=True, useTTmpSm=True, stabilize=True, maxr=1, TTstr=1, chroma=False, MVsharp=False, sigma=0, pfMode=-1,search=3, searchparam=4, pel=4, pelsearch=4, bwbh=512, owoh=256, blksize=4, overlap=2, deblock=False, post=0,bt=4,thSAD=2000, thSAD2=2000, thSCD1=1000, thSCD2=200)
clip = haf.LSFmod(clip, defaults="slow",strength=20,Smode=3,Smethod=3,Lmode=0,overshoot=0,preblur="OFF",secure=False,edgemode=0,soft=0,soothe=False,ss_x=1.00,ss_y=1.00)
clip.set_output()
don't affraid the parameters, my system do this with encoding in 48 hours :)
this problem only exist in my new linux compiled vapoursynth system, I build all from source include the plugins, the python the vs iteself, the problem don't exist on windows, I tested without the QTGMC and without the LFSMOD to see that it's the MCTD the problem, funny there are no error messages, it just running and adding this noise, I try everything: remove and invert many of the MCTD parameters, nothing have effect, the processor is phenom 2 1090T, linux is devuan jessi.
edited: core.std.SetMaxCPU("none") fixed the problem :) ..... what's going on ?
ChaosKing
25th June 2020, 00:09
Could be a bug in the sse code path.
But does sigma=0 make sense?
You can also use presets and override them
settings : Global MCTemporalDenoise settings [default="low"] |
- "very low" |
- "low" |
- "medium" |
- "high" |
- "very high
monohouse
25th June 2020, 00:33
yhe I tested sigma many times, it was a littel too strong at the time.... but at the time I was doing radius=2 limit=1, now with radius=3 limit=2 it possible that sigma might beter :) the true is I don't realy know the real diffrence between radius+limit and sigma, my guess is that sigma is design for speed and radius+limit design for quality.
you know I realy like this system, almost all if not all plugins vectorized, many have vectorization written manually :) some have AVX2, even many latest games don't use AVX2 and use at most AVX1 if you lucky
I can't wait to build my faildozer system to see diffrence from phenom 2 becuase he have AVX1
the 4790K system runs some laps around the phenom 2, 3 times faster, all cpu no openCL, for some reason I don't get that mutch from OpenCL, mybe 0.04 fps faster out of 0.90
x264 also don't get almost nothing from OpenCL and I using latest version v160-3000, the card is almost not used at all like highest I ever see was 5%
someone with modern system that have AVX512 probably run many laps around the 4790K xD
HolyWu
25th June 2020, 04:53
The overlay is partially transparent (but mask area seems correct; 100% white, 1023 in 10bit), and background colors change.
When you manually convert a clip of Gray format to YUV format, the pixel values of chroma planes are set to 512 rather than 0, hence you get 50% transparency in the chroma planes during masking. Preferably the users should just leave the mask as Gray format when the mask is already of Gray format. Anyway I just added a mask_first_plane parameter to let the users decide whether only the first plane of the mask is used for masking.
poisondeathray
25th June 2020, 05:07
When you manually convert a clip of Gray format to YUV format, the pixel values of chroma planes are set to 512 rather than 0, hence you get 50% transparency in the chroma planes during masking. Preferably the users should just leave the mask as Gray format when the mask is already of Gray format. Anyway I just added a mask_first_plane parameter to let the users decide whether only the first plane of the mask is used for masking.
Right,
The problem in this case is the base clip is 10bit, but the overlay is 8bit, so you have to either scale on or the other to match.
So use Gray10 instead of YUV . And since there is no Gray10, you have to register it. I think you mentioned this already earlier...
ovr[1] = core.resize.Point(ovr[1], format=core.register_format(vs.GRAY, vs.INTEGER, 10, 0, 0).id, matrix_s="709", range_s="full")
Thanks for adding that parameter; I think many people are used to using a YUV clip with the "Y" plane as the mask
HolyWu
25th June 2020, 05:08
this problem only exist in my new linux compiled vapoursynth system, I build all from source include the plugins, the python the vs iteself, the problem don't exist on windows, ..., the processor is phenom 2 1090T, linux is devuan jessi.
edited: core.std.SetMaxCPU("none") fixed the problem :) ..... what's going on ?
Interestingly, you are using the same CPU as the one at https://github.com/vapoursynth/vapoursynth/issues/531, um...or you two are the same person? :D
If core.std.SetMaxCPU("none") fixed your problem, then there must be undiscovered bugs lying around, most probably Expr. Could you reproduce it with using only one function? Using three complex functions at once is difficult to hunt down the culprit.
monohouse
25th June 2020, 17:28
here it says that I runned 3 but the problem happen when only MCTD running, MCTD is the problem
I am testing now this
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
core.set_max_cache_size(7000)
clip = core.ffms2.Source("/mnt/2TWDPrimary/Babylon 5/Season 1/03. Born to the Purple.mkv")
core.std.SetMaxCPU("sse2")
clip = haf.QTGMC( clip, TFF=True, Preset="Placebo", ShowSettings=False, opencl=False, TR0=2, TR1=2, SourceMatch=0, TR2=0, Lossless=0, Sharpness=0 )
core.std.SetMaxCPU("none")
clip = haf.MCTemporalDenoise(clip, radius=3, limit=2, twopass=False, limit2=2, refine=True, useTTmpSm=True, stabilize=True, maxr=1, TTstr=1, chroma=False, MVsharp=False, sigma=0, pfMode=-1,search=3, searchparam=4, pel=4, pelsearch=4, bwbh=512, owoh=256, blksize=4, overlap=2, deblock=False, post=0,bt=4,thSAD=2000, thSAD2=2000, thSCD1=1000, thSCD2=200)
core.std.SetMaxCPU("sse2")
clip = haf.LSFmod(clip, defaults="slow",strength=20,Smode=3,Smethod=3,Lmode=0,overshoot=0,preblur="OFF",secure=False,edgemode=0,soft=0,soothe=False,ss_x=1.00,ss_y=1.00)
clip.set_output()
but I have a new problem, probably nonsence but I don't know what it is :x
File "src/cython/vapoursynth.pyx", line 1956, in vapoursynth.vpy_evaluateScript
File "src/cython/vapoursynth.pyx", line 1957, in vapoursynth.vpy_evaluateScript
File "/mnt/b5/01. 3.vpy", line 23, in <module>
clip = haf.LSFmod(clip, defaults="slow",strength=20,Smode=3,Smethod=3,Lmode=0,overshoot=0,preblur=0,secure=False,edgemode=0,soft=0,soothe=False,ss_x=1.00,ss_y=1.00)
File "/mnt/apps/python-3.6.9/lib/python3.6/site-packages/havsfunc.py", line 4913, in LSFmod
normsharp = pre.cas.CAS(sharpness=min(Str, 1))
File "src/cython/vapoursynth.pyx", line 1233, in vapoursynth.VideoNode.__getattr__
AttributeError: There is no attribute or namespace named cas
this could be it ? https://github.com/HomeOfVapourSynthEvolution/VapourSynth-CAS
ChaosKing
25th June 2020, 17:45
this could be it ? https://github.com/HomeOfVapourSynthEvolution/VapourSynth-CAS
correct
monohouse
25th June 2020, 18:10
should I change the parameters like strenth or the new CAS method look the same in term of amount ?
I wanne ask you something else: phenom 2, have SSE3 (not suplemental) and SSE4A, some other call 3dnow and some mmx, whay all this is not used with manually written asembly in any of the plugins ?
they are not used in vs iteself too
I am testing now this
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
core.set_max_cache_size(7000)
clip = core.ffms2.Source("/mnt/2TWDPrimary/Babylon 5/Season 1/03. Born to the Purple.mkv")
core.std.SetMaxCPU("sse2")
clip = haf.QTGMC( clip, TFF=True, Preset="Placebo", ShowSettings=False, opencl=False, TR0=2, TR1=2, SourceMatch=0, TR2=0, Lossless=0, Sharpness=0 )
core.std.SetMaxCPU("none")
clip = haf.MCTemporalDenoise(clip, radius=3, limit=2, twopass=False, limit2=2, refine=True, useTTmpSm=True, stabilize=True, maxr=1, TTstr=1, chroma=False, MVsharp=False, sigma=0, pfMode=-1,search=3, searchparam=4, pel=4, pelsearch=4, bwbh=512, owoh=256, blksize=4, overlap=2, deblock=False, post=0,bt=4,thSAD=2000, thSAD2=2000, thSCD1=1000, thSCD2=200)
core.std.SetMaxCPU("sse2")
clip = haf.LSFmod(clip, defaults="slow",strength=20,Smode=3,Smethod=3,Lmode=0,overshoot=0,preblur="OFF",secure=False,edgemode=0,soft=0,soothe=False,ss_x=1.00,ss_y=1.00)
clip.set_output()
edited: this is working correctly :)
Interestingly, you are using the same CPU as the one at https://github.com/vapoursynth/vapoursynth/issues/531, um...or you two are the same person? :D
No, that was me :). And I'm only using the Phenom II until my Ryzen 3950 arrives...
I should note that I have not experience the expr issue with R49 or R50 of Vapoursynth. The expr bug has been fixed. @monohouse, be sure you are using current Vapoursynth if you are still experiencing this issue.
monohouse
27th June 2020, 00:15
is there a vs plugin that allow to adjust contrast ?
poisondeathray
27th June 2020, 00:24
is there a vs plugin that allow to adjust contrast ?
It depends on what you mean by "contrast".
adjust.py has "contrast" from avisynth's tweak ; or you can use smoothlevels or levels, or curve to adjust levels, and thus contrast
monohouse
27th June 2020, 01:07
thank :) adjust is nice :) whare do you think best to put it in this script ?
I used cont but he is not doing contrast, he is just putting everything down :x
contrast I meen: bright is a littel brighter, dark is a littel darker
I tryed this: haf.SmoothLevels(clip, input_low=8, output_low=0, input_high=247, output_high=255, gamma=1)
but what he is doing is cutting everything below 8 and throw it, I dont wanne cut it off and throw, I wanne reduce it, a littel and increase a littel
poisondeathray
27th June 2020, 01:31
contrast I meen: bright is a littel brighter, dark is a littel darker
You can use levels, smoothlevels, or curve
monohouse
27th June 2020, 04:41
LSFmod Smode=2 broked with git version
clip = haf.LSFmod(clip, defaults="slow",strength=20,Smode=2,Smethod=3,Lmode=0,overshoot=0,preblur=-1,secure=False,edgemode=0,soft=0,soothe=False,ss_x=1.00,ss_y=1.00)
http://manoa.dream.org.il/Pics/Smode2.png
poisondeathray
27th June 2020, 04:49
LSFmod Smode=2 broked with git version
clip = haf.LSFmod(clip, defaults="slow",strength=20,Smode=2,Smethod=3,Lmode=0,overshoot=0,preblur=-1,secure=False,edgemode=0,soft=0,soothe=False,ss_x=1.00,ss_y=1.00)
<snip>
Works for me as expected without those errors
What pixel type? what source filter?
Maybe it's related to one of the CPU instruction bugs ?
poisondeathray
27th June 2020, 05:01
thank :) adjust is nice :) whare do you think best to put it in this script ?
I used cont but he is not doing contrast, he is just putting everything down :x
contrast I meen: bright is a littel brighter, dark is a littel darker
I tryed this: haf.SmoothLevels(clip, input_low=8, output_low=0, input_high=247, output_high=255, gamma=1)
but what he is doing is cutting everything below 8 and throw it, I dont wanne cut it off and throw, I wanne reduce it, a littel and increase a littel
That does what you wanted, bright brighter, dark darker, increases contrast . But it also depends what you started with
The filter is not cutting and throwing. Clipping will be done by the RGB conversion for display if you have Y <16 , or >235 , not by the filter in YUV. The data is still there in YUV
Maybe you are not describing things correctly ? Maybe you want it closer to Y 16-235 ? Maybe posting a sample video would help?
monohouse
27th June 2020, 05:13
YUV420P, ffms2
problem start since version 72c1f8e6672c4aafabfd54d57a96eef9e969591d
whare it show mutch bigger squares than you see in this picture
it ok I fixed the contrast :)
clip = adj.Tweak(clip, bright=-1, cont=1.00392156862745098, coring=False)
poisondeathray
27th June 2020, 05:28
For smoothlevels, you can also use Lmode for limiting strength at the bright and dark ends 16-235. But it's not working in vapoursynth version . AVS version works ok
eg.
clip = haf.SmoothLevels(clip, input_low=16, gamma=1, input_high=235, output_low=0, output_high=255, Lmode=3)
"Python exception: SmoothLevels: Ecurve=0 is unusable at the moment due to missing sin operator in Expr"
:(
I can't reproduce the LSFMod error. What are your clip dimensions?
monohouse
27th June 2020, 05:37
720x480
HolyWu
27th June 2020, 05:45
LSFmod Smode=2 broked with git version
clip = haf.LSFmod(clip, defaults="slow",strength=20,Smode=2,Smethod=3,Lmode=0,overshoot=0,preblur=-1,secure=False,edgemode=0,soft=0,soothe=False,ss_x=1.00,ss_y=1.00)
Cannot reproduce it with the exactly same arguments. Have you tried core.std.SetMaxCPU("none")?
For smoothlevels, you can also use Lmode for limiting strength at the bright and dark ends 16-235. But it's not working in vapoursynth version . AVS version works ok
eg.
clip = haf.SmoothLevels(clip, input_low=16, gamma=1, input_high=235, output_low=0, output_high=255, Lmode=3)
"Python exception: SmoothLevels: Ecurve=0 is unusable at the moment due to missing sin operator in Expr"
Ecurve=1 is still usable for Lmode. Or maybe I should default Ecurve to 1 in the meantime...
poisondeathray
27th June 2020, 06:00
Ecurve=1 is still usable for Lmode. Or maybe I should default Ecurve to 1 in the meantime...
Yes, Ecurve=1 works...
(I thought there was an issue with Lmode=3, but the numbers correspond differently compared to AVS version. Lmode=1 is for both bright and dark in the VPY version)
monohouse
27th June 2020, 06:13
yip, look like you guys was right :) core.std.SetMaxCPU("none") fixed the problem :)
thank :) I tested
clip = haf.SmoothLevels(clip, input_low=2, gamma=1, input_high=254, output_low=0, output_high=255, Lmode=3, Ecurve=1)
but it look too bright and I don't know whay but also incrased noise, some geometry distortions too
clip = adj.Tweak(clip, bright=-2, cont=1.00392156862745098, coring=False)
worked bether in this movie, it also increased effect of all the other plugins when in the top of the list :)
HolyWu
6th July 2020, 09:57
Update r33:
aaf: Fix argument type error.
Add functions daa3mod and mcdaa3.
Make FineDehalo_contrasharp an external function.
Add 32 bit float support to Overlay, LSFmod, Deblock_QED, DeHalo_alpha, FineDehalo, Vinverse, Vinverse2, GrainFactory3, SmoothLevels, and FastLineDarkenMOD.
QTGMC: Always mark the output as frame based before returning clip.
Overlay: Add new blend modes addition, average, burn, darken, difference, divide, dodge, exclusion, extremity, freeze, glow, grainextract, grainmerge, hardlight, hardmix, heat, lighten, linearlight, multiply, negation, overlay, phoenix, pinlight, reflect, screen, softlight, subtract, and vividlight.
Overlay: Add parameters planes and mask_first_plane.
DeHalo_alpha: Fix division by zero in Expr.
DeHalo_alpha: Explicitly use Mitchell-Netravali in some Bicubic resizing since zimg has changed the default to Catmull-Rom and the filtering result differs.
EdgeCleaner, FineDehalo, HQDeringmod, MCTemporalDenoise: Create mask by AvsPrewitt instead of Sobel to more closely match the result.
LSFmod: Add Smode=3 and change the defaults.
LSFmod: Add new preblur modes.
SmoothLevels: Change default useDB to false.
SmoothLevels: Change default Ecurve to 1.
SMDegrain: Use MinBlur for prefilter 1 and 2 again.
ChaosKing
6th July 2020, 15:10
clip = mvf.Depth(clip, 32)
clip = haf.FineDehalo(clip, rx=2.7, darkstr=1, contra=0.5)
vapoursynth.Error: CTMF: only constant format 8, 10, 12, 14 or 16 bits integer input supported
And with haf.DeHalo_alpha(clip, rx=2.7, darkstr=1)
https://i.imgur.com/PRljbEA.png
HolyWu
6th July 2020, 17:01
clip = mvf.Depth(clip, 32)
clip = haf.FineDehalo(clip, rx=2.7, darkstr=1, contra=0.5)
vapoursynth.Error: CTMF: only constant format 8, 10, 12, 14 or 16 bits integer input supported
And with haf.DeHalo_alpha(clip, rx=2.7, darkstr=1)
Oops! DeHalo_alpha float issue should be fixed now. For CTMF...I totally forgot about it still not supporting float. Will add float support specifically for radius 2 later.
ChaosKing
6th July 2020, 18:48
32 looks good now.
But if you look closely 8 bit and 16bit are also a bit different...
EDIT
I had a mistake in my script, all good now.
ChaosKing
6th July 2020, 19:00
c32 = mvf.Depth(clip, 32)
c32 = haf.daa3mod (c32)
vapoursynth.Error: znedi3: failed to create nnedi3
8-16 = ok
HolyWu
7th July 2020, 02:21
vapoursynth.Error: znedi3: failed to create nnedi3
8-16 = ok
https://github.com/sekrit-twc/znedi3/commit/169b9958bd4fdb5131a6e81feb837bb32f33731b
Go pushing author to release a new version. :devil:
feisty2
7th July 2020, 03:15
I guess smdegrain could support arbitrary temporal radius (tr > 3) and cosine annealing (thSAD2), these features are present in the avs version and are now also natively supported by my fork of mvtools.
the logic would probably be something like
MAnalyze = None
MDegrain = None
if BitsPerSample == 32 or tr > 3 or thSAD2 is not None:
MAnalyze = core.mvsf.Analyze
MDegrain = core.mvsf.Degrain
else:
MAnalyze = core.mv.Analyse
MDegrain = core.mv.Degrain1/2/3
HolyWu
7th July 2020, 06:39
I guess smdegrain could support arbitrary temporal radius (tr > 3) and cosine annealing (thSAD2), these features are present in the avs version and are now also natively supported by my fork of mvtools.
Yeah...except its slowness outweighs usefulness for most users due to lack of SIMD optimizations. I'd rather just have a GPU port of mvtools for full 8-32 bit support...when I eventually decide to begin coding it.
ChaosKing
7th July 2020, 11:26
A GPU port would be a dream :eek:
ChaosKing
7th July 2020, 21:46
https://github.com/sekrit-twc/znedi3/commit/169b9958bd4fdb5131a6e81feb837bb32f33731b
Go pushing author to release a new version. :devil:
done, next problem:
vapoursynth.Error: Repair: Only 8-16 bit int formats supported
HolyWu
8th July 2020, 01:52
done, next problem:
vapoursynth.Error: Repair: Only 8-16 bit int formats supported
Currently I don't explicitly give an error for functions not supporting 32 bit float since in the end the underlying filters being used will throw an error anyway and hence the users will know it.
ChaosKing
8th July 2020, 08:17
For some reason I thought daa3mod was also mentioned in the "Add 32 bit float support to ..." line :o
Soichiro
10th July 2020, 05:44
Hi, since updating to r33, I get an error "AttributeError: There is no attribute or namespace named dfttest" when trying to use `havsfunc.MCTemporalDenoise`. I was able to use this filter before updating, and I attempted reinstalling dfttest as well. I'm on Arch Linux, Vapoursynth R50.
HolyWu
10th July 2020, 06:48
Hi, since updating to r33, I get an error "AttributeError: There is no attribute or namespace named dfttest" when trying to use `havsfunc.MCTemporalDenoise`. I was able to use this filter before updating, and I attempted reinstalling dfttest as well. I'm on Arch Linux, Vapoursynth R50.
I don't think your error has anything to do with havsfunc. You can try core.std.BlankClip().dfttest.DFTTest() without using havsfunc at all to make sure.
Did you compile DFTTest from source or install it via distribution package? Is it r6 or r7? What happen if you try the other version?
Soichiro
10th July 2020, 21:05
You're right, the example with BlankClip also does not work. I am installing dfttest (and all VS plugins) from the Arch AUR. I've tested with both r6 and r7 of dfttest, and r32 and r33 of muvsfunc. On manually adding a LoadPlugin call, I'm able to get vapoursynth to output the error that it can't find the symbol `fftwf_make_planner_thread_safe`, even though I have fftw installed. (Of course with autoloading, Vapoursynth just silently fails on plugins that have issues...) So, you're right, it does seem like a local machine issue, and not sure how my machine ended up in this state, but that means I'll keep debugging the separate issue. Thanks.
Soichiro
11th July 2020, 01:13
It looks like the issue is that, at least on Arch, fftw's pkgconfig files do not include -lfftw3f_threads, which is needed for dfttest to work. So, in case anyone else on Linux runs into the issue, the workaround is to add -lfftw3f_threads to the libs line in /usr/lib/pkgconfig/fftw3f.pc, then rebuild dfttest.
HolyWu
11th July 2020, 01:44
It looks like the issue is that, at least on Arch, fftw's pkgconfig files do not include -lfftw3f_threads, which is needed for dfttest to work. So, in case anyone else on Linux runs into the issue, the workaround is to add -lfftw3f_threads to the libs line in /usr/lib/pkgconfig/fftw3f.pc, then rebuild dfttest.
Ah, I missed that. Updated meson.build accordingly. :goodpost:
Soichiro
11th July 2020, 01:48
Thanks! Confirmed that the meson fix in dfttest fixes the issue.
NullNix
18th July 2020, 16:47
I finally tracked down the proximate cause of the bug I reported earlier where vapoursynth was generating horrifically chopped-up frames when QTGMC was run over it, at least enough to have a workaround of sorts. As others suggested, the source was at fault, though I still don't quite understand why.
If I use the (makemkv-derived) MKV as the vspipe source, all is well: if I mkvextract the video stream from it and use that (which is what I've been doing without incident for years before now), the chopped-up mess results, even though vspipe is only meant to be using the video stream in any case. I thought video streams were meant to be more-or-less separable from their containers, but this doesn't seem to be true with this one. mpv says that the extracted stream has no timestamps and that ffmpeg is going to make them up, and get them horribly wrong: maybe this is an unusual input, or maybe makemkv's behaviour has changed and it's sticking timestamps in in some unusual fashion now such that mkvextract is no longer cleanly extracting them (one downside of closed-source software is that I can't easily tell which it might be).
So... I guess I'll take my ever-more-obviously catastrophic ignorance on this subject and go away :) sorry to bother everyone.
lansing
6th August 2020, 23:22
Your github readme needs update to show the new functions. I was looking for the overlay function but couldn't find it until I searched for a specific overlay mode.
lansing
7th August 2020, 05:07
bug report, I Overlay() a YUV444P16 clip on top of a GRAY16 clip but there's no warning about format mismatch.
clip_yuv16 = core.resize.Bicubic(clip, format=vs.YUV444P16)
overlay_clip = core.std.BlankClip(clip_yuv16, color=[0, 220/255*MaxSize16bit, 0])
output_clip = haf.Overlay(clip_yuv16, overlay_clip, mode="lighten")
And here the "lighten" doesn't look right. I compared the result to "lighten" overlay in photoshop and they're so different.
And setting mode="darken" gives a greenish frame.
poisondeathray
7th August 2020, 06:22
bug report, I Overlay() a YUV444P16 clip on top of a GRAY16 clip but there's no warning about format mismatch.
clip_yuv16 = core.resize.Bicubic(clip, format=vs.YUV444P16)
overlay_clip = core.std.BlankClip(clip_yuv16, color=[0, 220/255*MaxSize16bit, 0])
output_clip = haf.Overlay(clip_yuv16, overlay_clip, mode="lighten")
And here the "lighten" doesn't look right. I compared the result to "lighten" overlay in photoshop and they're so different.
And setting mode="darken" gives a greenish frame.
That's not GRAY16 . GRAY16 has 1 channel
Photoshop works in RGB . RGB is an additive color model. You would expect different visual results with blend modes in YUV
lansing
7th August 2020, 07:09
That's not GRAY16 . GRAY16 has 1 channel
Photoshop works in RGB . RGB is an additive color model. You would expect different visual results with blend modes in YUV
I was reporting three separate issues, the code was referring to the second issue with "lighten" overlay mode.
I just tested with a RGB24 clip overlay on a RGB24 clip, the result matches the one from photoshop. So the Overlay function only works on RGB, it should have a check to restrict it to RGB clips only.
poisondeathray
7th August 2020, 16:18
I just tested with a RGB24 clip overlay on a RGB24 clip, the result matches the one from photoshop. So the Overlay function only works on RGB, it should have a check to restrict it to RGB clips only.
For some of the other blend modes the math only makes sense to work in RGB.
But in "normal" mode it works ok with other pixel formats . It's used all the time in YUV. Other programs like browsers use YUVA overlays (YUVA444P, YUVA420P) too . It's one of the main benefits of using Overlay in avisynth/vapoursynth or mt_merge . YUV overlays. No additional deterioration from going into RGB back to YUV.
MythCreator
3rd September 2020, 13:57
A issue about r33. I put CAS.dll under plugin64 folder, but when I use LSFmod, the Editor keep send error code "There is no attribute or namespace named cas"
ChaosKing
3rd September 2020, 14:44
Sound like cas.dll is not loaded. Try to load it manually and see what error code it shows. std.Loadplugin()
MythCreator
3rd September 2020, 18:24
Sound like cas.dll is not loaded. Try to load it manually and see what error code it shows. std.Loadplugin()
Thanks. std.Loadplugin works fine.
l00t
20th October 2020, 20:08
Dear HolyWu,
If you have some spare time, would you be so kind to port InpaintDelogo to VS? I only found DelogoHD available for VS, but making an lgd file is a pain-in-the-a** compared to VoodooFX's automated process...
https://forum.doom9.org/showthread.php?t=176860
Thanks in advance!
Adub
22nd October 2020, 19:01
InpaintDelogo requires AvsInpaint, which is a Avisynth plugin. So, a manual load of the Avisynth plugin may be required, since there's no native Vapoursynth equivalent. I have no idea if LoadPlugin works for AvsInpaint (it might - I haven't tried), but I'd be a little surprised if HolyWu wanted to add support for a function that requires non-native Vapoursynth plugins.
lansing
9th February 2021, 23:15
When running QTGMC, I'm getting a log "AvstpWrapper: cannot find avstp.dll.Usage restricted to single threading" in the console
Jukus
10th February 2021, 00:31
When running QTGMC, I'm getting a log "AvstpWrapper: cannot find avstp.dll.Usage restricted to single threading" in the console
I don't confirm.
ChaosKing
10th February 2021, 00:41
When running QTGMC, I'm getting a log "AvstpWrapper: cannot find avstp.dll.Usage restricted to single threading" in the console
Can you show your parameters? I never have seen this message with qtgmc.
lansing
10th February 2021, 00:53
Can you show your parameters? I never have seen this message with qtgmc.
I was catching this log in the Qt Creator's debug console. I tried all QTGMC presets and they all have this message.
ChaosKing
10th February 2021, 09:19
Ah yes, I can see it in DebugView++ now. Could be some of the used filters in QTGMC. I think I saw once Myrsloik posting an image of the generated filter graph by a VS script. I can't find it right now, but could be handy to quickly check which plugins are beiing used...
edit
Avisynth has DumpFilterGraph(), does VS has something similar build in?
Myrsloik
10th February 2021, 10:19
Ah yes, I can see it in DebugView++ now. Could be some of the used filters in QTGMC. I think I saw once Myrsloik posting an image of the generated filter graph by a VS script. I can't find it right now, but could be handy to quickly check which plugins are beiing used...
edit
Avisynth has DumpFilterGraph(), does VS has something similar build in?
Only in the API R4 test builds.
HolyWu
10th February 2021, 16:02
When running QTGMC, I'm getting a log "AvstpWrapper: cannot find avstp.dll.Usage restricted to single threading" in the console
https://github.com/EleonoreMizo/fmtconv/blob/4f187bf5b7fe116d98a55910d597146b6b3a79a8/src/AvstpWrapper.cpp#L160
lansing
11th February 2021, 05:15
https://github.com/EleonoreMizo/fmtconv/blob/4f187bf5b7fe116d98a55910d597146b6b3a79a8/src/AvstpWrapper.cpp#L160
So does that mean I'm running something single thread?
Julek
16th February 2021, 13:33
Since you have ported TDeint, is there any chance that you also port MTCombMask?
https://github.com/Asd-g/MTCombMask
In some cases it does better than the current CombMask, capturing some areas that CombMask ignores.
lansing
30th September 2021, 03:33
QTGMC() needs update as of R56 since filters under core.misc namespace has been changed.
ChaosKing
30th September 2021, 07:22
Namespace has been changed? misc is an external plugin now. So "vsrepo install misc" and everything is back to where it was.
lansing
30th September 2021, 12:35
Namespace has been changed? misc is an external plugin now. So "vsrepo install misc" and everything is back to where it was.
Thanks it works.
cogman
4th October 2021, 20:51
Any path forward for us linux folk? How hard is it to build the v3 libs and use them with v4?
Myrsloik
4th October 2021, 21:09
Any path forward for us linux folk? How hard is it to build the v3 libs and use them with v4?
Same as windows. Very easy. Almost all API3 stuff still works.
All split out plugins can be found here. Build system included with most.
https://github.com/vapoursynth
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.