View Full Version : AviSynth+ thread Vol.2
FranceBB
29th September 2021, 12:51
There's already 3 plugins that support topleft (type 2) chroma placement :p so you can already do that. But seeing how the convert functions already support "Rec2020" and "PC.2020" matrix I think it would be logical to also support the corresponding chroma placement.
Ah... Would you be kind enough to copy-paste the function call with the parameters for that so I can grab it and toss FFMpeg? xD
Reel.Deel
29th September 2021, 13:02
Ah... Would you be kind enough to copy-paste the function call with the parameters for that so I can grab it and toss FFMpeg? xD
Cross that out about there being 3 plugins, I thought ResampleMT and fmtconv mentioned chromaloc type 2 but they don't. avsresize can change chroma placement, for example mpeg2 to topleft: chromaloc_op="mpeg2=>top_left"
But if pinter is right that DV is top left that means AviSynth, Dither, and fmtconv can do it also.
pinterf
29th September 2021, 14:33
https://en.wikipedia.org/wiki/Chroma_subsampling
see 4:2:0 section:
"In 4:2:0 DV ... also called top-left."
StvG
29th September 2021, 15:26
https://en.wikipedia.org/wiki/Chroma_subsampling
see 4:2:0 section:
"In 4:2:0 DV ... also called top-left."
4:2:0 DV implies interlaced content? ( here for example (https://www.mir.com/DMG/chroma.html) )
Currently fmtconv doesn't have cplace top-left (progressive) ( https://forum.doom9.org/showthread.php?p=1950533#post1950533 )
Dogway
29th September 2021, 22:18
Is this illegal call?
Expr("f32 x 0.5 +","",scale_inputs="intf")
I want to scale integer inputs to float so I skip a bunch of manual conversions.
Reel.Deel
30th September 2021, 09:26
https://en.wikipedia.org/wiki/Chroma_subsampling
see 4:2:0 section:
"In 4:2:0 DV ... also called top-left."
Im not sure about that. I did some test and avs' and fmtc_resample's output when cplace = dv do not match top_left from avsresize. Even avs' and fmtc_resample's dv placement differs.
Here's the script I used to check that:
Blankclip(width=288, height=48, pixel_type="RGBP8", color=$FF0000) #red
AddBorders(0,0,0,48,$00FF00) # green
AddBorders(0,0,0,48,$0000FF) # blue
AddBorders(0,0,0,48,$00FFFF) # cyan
AddBorders(0,0,0,48,$FF00FF) # magenta
AddBorders(0,0,0,48,$FFFF00) # yellow
StackHorizontal(last, last.Turnleft())
z_ConvertFormat(pixel_type="YUV444P8", colorspace_op="rgb:709:709:full=>709:709:709:limited")
avs = ConvertToYUV420(ChromaOutPlacement="dv", chromaresample="spline36")
avsr = z_ConvertFormat(pixel_type="YUV420P8", chromaloc_op = "center=>top_left", resample_filter_uv="spline36")
fmtc = fmtc_resample(css="420", cplaced="dv", kernel="spline36")
avst = Convert444to420Test(cplace="topleft")
diff(avsr, avst)
# Courtesy of pinterf :)
Function Diff(clip src1, clip src2)
{
return Subtract(src1.ConvertBits(8),src2.ConvertBits(8)).Levels(120, 1, 255-120, 0, 255, coring=false)
}
# little test fuction to see what the actual filters are doing
function Convert444to420Test(clip input, string "cplace")
{
default(cplace, "mpeg2")
Assert(cplace == "mpeg1" || cplace == "mpeg2" || cplace == "topleft", "Only mpeg1, mpeg2, topleft allowed")
Assert(Is444(input), "Only YUV444 allowed")
src_left = (cplace == "mpeg1") ? 0.0 : -0.50
src_top = (cplace == "topleft") ? -0.5 : 0.0
u = ExtractU(input).z_Spline36Resize(input.width/2, input.height/2, src_left, src_top)
v = ExtractV(input).z_Spline36Resize(input.width/2, input.height/2, src_left, src_top)
CombinePlanes(input, U, V, planes="YUV", source_planes="YYY", pixel_type="YUV420P8")
}
I even made a test function to see the offsets that are used when the chroma is scaled. To go from YUV444->YUV420:
topleft = src_left=-0.50, src_top=-0.50
mpeg2 = src_left=-0.50, src_top=0.0
mpeg1 = src_left=0.00, src_top=0.0
By the way, it would be nice if CombinePlanes accepted "YUV"/"RGB" as pixel_type and the choose the format based on bitdepth and chroma sampling.
pinterf
30th September 2021, 12:07
Shift for U and V shift is not the same for DV. I'm gonna make a test build.
pinterf
30th September 2021, 13:48
New build. ChromaInPlacement and ChromaOutPlacement allows "top_left" (and "jpeg" or "center" like "mpeg1"; "left" like "mpeg2")
Avisynth+ 3.7.1 test build 20 (20210930) (https://drive.google.com/uc?export=download&id=1b-sTu_IsnxalIp5QNI1ugW1DYcGUhl05)
Pls. test for interlaced as well.
pinterf
30th September 2021, 13:49
I do hope that I'm gonna put frameprop handling into avisynth before winter comes.
FranceBB
30th September 2021, 14:54
New build. ChromaInPlacement and ChromaOutPlacement allows "top_left" (and "jpeg" or "center" like "mpeg1"; "left" like "mpeg2")
Avisynth+ 3.7.1 test build 20 (20210930) (https://drive.google.com/uc?export=download&id=1b-sTu_IsnxalIp5QNI1ugW1DYcGUhl05)
Pls. test for interlaced as well.
Wow thanks! :D
I do hope that I'm gonna put frameprop handling into avisynth before winter comes.
https://i.imgur.com/PHFeAs9.png
TL;DR for those who are not familiar with the show, in Game of Thrones there's a scene in which they say "Winter is coming" but this meme swaps it with "Frame Properties are coming" as they will come before Winter...
pinterf
30th September 2021, 15:06
Thanks for the explanation :) I'm not watching TV/series/films other than a few actual trail running or MTB videos on Youtube. Or go to a cinema twice a year.
FranceBB
30th September 2021, 15:41
Thanks for the explanation :) I'm not watching TV/series/films
No worries. It doesn't matter if you're not familiar with tv series, you're very much familiar with ASM x86 and that's much much better xD
Reel.Deel
1st October 2021, 08:57
New build. ChromaInPlacement and ChromaOutPlacement allows "top_left" (and "jpeg" or "center" like "mpeg1"; "left" like "mpeg2")
Avisynth+ 3.7.1 test build 20 (20210930) (https://drive.google.com/uc?export=download&id=1b-sTu_IsnxalIp5QNI1ugW1DYcGUhl05)
Pls. test for interlaced as well.
Thanks pinterf! So far so good, I tested YUV420 "top_left" to and from "mpeg1"/"mpeg2" YUV420/YUV422/YUV444 (when applicable) and the input matches that of avsresize. There are some very minor differences only visible with the diff function and undetectable without it. I've yet to test interlaced.
FranceBB
1st October 2021, 09:33
Ok, so, now we have:
____________________________________________________________
#From normal 4:2:0 to 4:2:0 Type 2
z_ConvertFormat(chromaloc_op="mpeg2=>top_left")
____________________________________________________________
#From normal 4:2:0 8bit planar to 4:2:0 Type 2 8bit planar (Internal)
Converttoyv12(matrix="Rec2020", ChromaInPlacement="MPEG2", ChromaOutPlacement="top_left")
____________________________________________________________
#From normal 4:2:0 to 4:2:0 Type 2 (Internal)
ConverttoYUV420(matrix="Rec2020", ChromaInPlacement="MPEG2", ChromaOutPlacement="top_left")
So far so good, Ferenc! :D
https://i.imgur.com/KsBFusX.png
cretindesalpes
1st October 2021, 18:47
fmtc_resample also has top_left chroma location now on the Github repository (https://github.com/EleonoreMizo/fmtconv/commit/458cebf08e8bbf0839e70c381135d8014abcff03); it will be included in the next release.
DTL
2nd October 2021, 13:40
"ConverttoYUV420(matrix="Rec2020", ChromaInPlacement="MPEG2", ChromaOutPlacement="top_left")"
Tried to make tests for possible degradation on sharp colour transients between sub-sampled and full-band formats (4:2:2 and 4:4:4) -
results https://i2.imageban.ru/out/2021/10/02/20913dde5e930ae7554c6cb63221c1a8.png
It looks 'default=bicubic' cause continuous colour sharpness degradation. The most theoretically-perfect 'sinc' do not work best with 'too sharp to ring' transients (and looks like return ringing) + inherits kernel-edge issue that cause 'shadow' at about 'taps' distance from transient.
The most perfect in 8 generations of 4:2:2 -> 4:4:4 ->4:2:2 currently look 'lanczos4' (of the currently 3 tested kernels - default, sinc, lanczos4). May be make it default for typical use ?
Also the ConvertToYUV422() do not have ChromaOutPlacement param - it mean it always use 'left' i.e. odd-Y samples co-siting in output ?
Addition: With new samples-defining to clip method (post https://forum.doom9.org/showthread.php?p=1953693#post1953693 ) it looks 'lanczos4' also not very good. So the best multi-generation method of sub-sampled format to 4:4:4 and back still need to be discovered.
Reel.Deel
3rd October 2021, 00:17
Also the ConvertToYUV422() do not have ChromaOutPlacement param - it mean it always use 'left' i.e. odd-Y samples co-siting in output ?
Isn't YUV 4:2:2 always left aligned (mpeg2 chroma placement)?
FranceBB
3rd October 2021, 01:11
Isn't YUV 4:2:2 always left aligned (mpeg2 chroma placement)?
It is afaik.
Every time I've received a 4:2:2 HDR10 masterfile from companies it was always with the standard MPEG-2 chroma placement, so I think Type 2 is only for 4:2:0, but I might be wrong.
StainlessS
3rd October 2021, 06:01
See Here:- https://forum.doom9.org/showthread.php?p=1953742#post1953742
EDIT:
Several of above funcs [eg UPlaneMax "c[threshold]fi"] indicate a non optional final arg i of type int,
strictly speaking, I think all parameters following any optional parameter, MUST be also optional (I think they should maybe also be named optionals),
this is true in many if not all languages with optional arguments.
Some similar functions in AVS+ had similarly erroneous non optionals [now fixed I think].
EDIT: Actually, the same AVS+ builtin functions also have non optionals following an optional one, ie [below wrong in both Grunt and AVS+]
UPlaneMax "c[threshold]fi"
UPlaneMin "c[threshold]fi"
UPlaneMinMaxDifference "c[threshold]fi"
VPlaneMax "c[threshold]fi"
VPlaneMin "c[threshold]fi"
VPlaneMinMaxDifference "c[threshold]fi"
YPlaneMax "c[threshold]fi"
YPlaneMin "c[threshold]fi"
YPlaneMinMaxDifference "c[threshold]fi"
EDIT:
/* BAD trailing compulsory arg i, following an optional arg. [BAD in both AVS+ and Grunt]
UPlaneMin "c[threshold]fi"
UPlaneMinMaxDifference "c[threshold]fi"
VPlaneMax "c[threshold]fi"
VPlaneMin "c[threshold]fi"
VPlaneMinMaxDifference "c[threshold]fi"
YPlaneMax "c[threshold]fi"
YPlaneMin "c[threshold]fi"
YPlaneMinMaxDifference "c[threshold]fi"ing compulsory arg
*/
#YPlaneMin "c[threshold]fi"
Blankclip(pixel_type="YV12")
SSS="""
# y=YPlaneMin(0.4,1) # OK, Threshold = 0.4, Offset = 1 ie current_frame+1
y=YPlaneMin(threshold=0.4,1) # Script Error: The named argument "threshold" was passed more than once to YPlaneMin
# y=YPlaneMin(Last,threshold=0.4,1) # Script Error: The named argument "threshold" was passed more than once to YPlaneMin # EDIT: ADDED
RT_Subtitle("%d] Y=%d",current_frame,Y)
return last
"""
ScriptClip(SSS)
EDIT:
(I think they should maybe also be named optionals)
think above error message "# Script Error: The named argument "threshold" was passed more than once to YPlaneMin"
is down to requiring a named optional after using an optional name, but parameter 'i' dont have a name so cannot use 'i' arg together with Threshold=x.
EDIT: I'll [EDIT: try] knock up a parser to check all builtin parameter lists for un-named optionals or compulsary parameters after an optional parameter.
EDIT: From here:- http://avisynth.nl/index.php/User_defined_script_functions
Facts about user defined script functions
Functions can take up to sixty arguments and the return value can be of any type supported by the scripting language (clip, int, float, bool, string, AVS+array).
Although not recommended practice, an argument type may be omitted, and will default to val, the generic type.
If the function expects a video clip as its first argument, and that argument is not supplied, then the clip in the special Last variable will be used.
Functions support named arguments. Simply enclose an argument's name inside double quotes to make it a named argument. Note that after doing so the following apply:
All subsequent arguments in the argument list must be named also.
A named argument is an optional argument, that is, it need not be supplied by the caller.
One presumes that the rules for script functions also apply to builtin/plugin,
so after 1st named argument, all following others must also be named,
and when calling a function [script or plugin], after providing an optional name, so all following args must also be called with names.
[there seem to be a few rule breakers]
DTL
4th October 2021, 20:44
It looks like documentation of ConvertBits() is outdated: https://forum.doom9.org/showthread.php?p=1953899#post1953899
http://avisynth.nl/index.php/ConvertBits
says
bool fulls = (auto)
Use the default value unless you know what you are doing.
If true (RGB default), scale by multiplication: 0-255 → 0-65535;
if false (YUV default), scale by bit-shifting.
Use case: override greyscale conversion to fullscale instead of bit-shifts.
Conversion from and to float is always full-scale.
Alpha plane is always treated as full scale.
bool fulld = fulls
Use the default value unless you know what you are doing.
At the moment, must match fulls.
Nowdays (with last pinterf build) fulld may be not equal to fulls and fulld for float input may be false.
So correct conversion from float32 output of fmtc plugin to 8bit limited require ConvertBits(8,fulls=true,fulld=false) that works.
StainlessS
4th October 2021, 21:08
Thanks for pointing that out DTL. :)
FranceBB
6th October 2021, 07:52
Well, not that anyone cares or uses YUY2 anymore, but...
ConverttoYUY2(matrix="Rec2020")
and
ConverttoYUY2(matrix="PC.2020")
don't work, however since those have been added for Converttoyv12, Converttoyv16, Converttoyv24, ConverttoYV411, ConverttoY8, ConverttoRGB32, ConverttoRGB24, ConverttoRGB, ConverttoYUV420, ConverttoYUV422, ConverttoYUV444, I feel like it was worth reporting...
Avisynth 3.7.1 Test 20 x64 CUDA
Takoh
7th October 2021, 09:41
Apparently it doesn't work.
gives me while doesn't crash, but process doing nothing - it simply waiting for something.
Can someone help me. I finally built AviSynthCUDAFilters and masktools-cuda, but I'm having the same problem as DKATOM I think. When I run the script my GPU just sits at 100% using about 800mb of vram. And virtualdub has a blank box.
These are the files I built.
masktools2.dll (cuda version)
KTGMC.dll
AvsCUDA.dll
KFM.dll
KDebugTool.dll
GRunT.dll
KUtil.dll
(I renamed Kmasktools to masktools2 after it was built)
I'm using the avisynth cuda build that was posted in this thread avisynth 3.7.1 test4
My script looks something like this....
SetMemoryMax(8000, type=DEV_TYPE_CUDA)
srcfile="MyCLIP.avi"
AviSource(srcfile).converttoYV12()
OnCPU(2).KTGMC(preset="Fast").OnCUDA(2)
#OnCPU(2).KTGMC(SourceMatch=3, Lossless=2, tr0=1, tr1=1, tr2=1).OnCUDA(2)
I also tried this, with the same result.
AviSource(srcfile)
onCPU(2)
KTGMC()
onCUDA(2)
When I remove onCUDA, at the bottom of Virtualdub there's the error
"Avisynth read error: [KMasktoolsFilterBase] CUDA"... and some characters in another language.
I tried removing onCPU and Virtualdub gave the error:
Device unmatch: KTGMC_Bob[CUDA] does not support [CPU] frame
I tried using an older GPU and it doesn't hang at 100% usage. Instead VirtualDub gives an error at the bottom:
Avisynth Read Error: [CUDA Error] 400: invalid resource handle @948
Any help would be GREATLY appreciated. I'm not sure what to try next :')
Dogway
7th October 2021, 10:22
Just a friendly reminder for my question a week ago here (https://forum.doom9.org/showthread.php?p=1953427#post1953427). Some discussion here (https://forum.doom9.org/showthread.php?p=1953668#post1953668)too.
Currently it's not possible to evaluate an expression as float which is necessary for a range of operators like pow, exp, cos, sin, etc unless we do a bunch of "range_max /" and "range_max *".
I tried with f32 decorator and scale_inputs="intf" but I think it's not supported.
pinterf
7th October 2021, 11:37
Just a friendly reminder for my question a week ago here (https://forum.doom9.org/showthread.php?p=1953427#post1953427). Some discussion here (https://forum.doom9.org/showthread.php?p=1953668#post1953668)too.
Currently it's not possible to evaluate an expression as float which is necessary for a range of operators like pow, exp, cos, sin, etc unless we do a bunch of "range_max /" and "range_max *".
I tried with f32 decorator and scale_inputs="intf" but I think it's not supported.
Yes, it is not handled. I could not find out in a few minutes why I put there this limitation. Anyway, you can pass a ConvertBits(32) clip there and a back conversion after.
Dogway
7th October 2021, 12:37
Yes, it is not handled. I could not find out in a few minutes why I put there this limitation. Anyway, you can pass a ConvertBits(32) clip there and a back conversion after.
Yes I know, it was tested and performance dropped (https://forum.doom9.org/showthread.php?p=1953701#post1953701)to less than half. Anyway thanks when you got time.
DTL
7th October 2021, 12:58
"ConverttoYUY2(matrix="PC.2020")"
Documentation for Convert at http://avisynth.nl/index.php/Convert looks also outdated and not list PC.2020 option at all.
Takoh
7th October 2021, 14:11
Apparently it doesn't work.
gives me while doesn't crash, but process doing nothing - it simply waiting for something.
Can someone help me. I finally built AviSynthCUDAFilters and masktools-cuda, but I'm having the same problem as DKATOM I think. When I run the script my GPU just sits at 100% using about 800mb of vram. And virtualdub has a blank box.
These are the files I built.
masktools2.dll (cuda version)
KTGMC.dll
AvsCUDA.dll
KFM.dll
KDebugTool.dll
GRunT.dll
KUtil.dll
(I renamed Kmasktools to masktools2 after it was built)
I'm using the avisynth cuda build that was posted in this thread avisynth 3.7.1 test4
My script looks something like this....
SetMemoryMax(8000, type=DEV_TYPE_CUDA)
srcfile="MyCLIP.avi"
AviSource(srcfile).converttoYV12()
OnCPU(2).KTGMC(preset="Fast").OnCUDA(2)
#OnCPU(2).KTGMC(SourceMatch=3, Lossless=2, tr0=1, tr1=1, tr2=1).OnCUDA(2)
I also tried this, with the same result.
AviSource(srcfile)
onCPU(2)
KTGMC()
onCUDA(2)
When I remove onCUDA, at the bottom of Virtualdub there's the error
"Avisynth read error: [KMasktoolsFilterBase] CUDA"... and some characters in another language.
I tried removing onCPU and Virtualdub gave the error:
Device unmatch: KTGMC_Bob[CUDA] does not support [CPU] frame
I tried using an older GPU and it doesn't hang at 100% usage. Instead VirtualDub gives an error at the bottom:
Avisynth Read Error: [CUDA Error] 400: invalid resource handle @948
Any help would be GREATLY appreciated. I'm not sure what to try next :')
pinterf
7th October 2021, 14:36
"ConverttoYUY2(matrix="PC.2020")"
Documentation for Convert at http://avisynth.nl/index.php/Convert looks also outdated and not list PC.2020 option at all.
Packed RGB<->YUY2 conversion is a totally different code part, has tricky accelerations with differently scaled internal constants other than the generic planar approach. (There is no intermediate 4:4:4 conversion like e.g. for YV16<->RGB so it is much quicker). I'd better not touch it without a proper code refactor. E.g. conversion matrix calculation code and constants are reinvented at least three or four different places in the source. Now that I've seen it again I started making it look better.
pinterf
7th October 2021, 14:41
Yes I know, it was tested and performance dropped (https://forum.doom9.org/showthread.php?p=1953701#post1953701)to less than half. Anyway thanks when you got time.
All these parameter were introduced at the dawn of 10+ bits introduction because there had been a zillion of scripts that were using only 8 bit constants. So our aim was to make non-8 bit clips somehow to be handled with existing expression strings. Till I return to the topic in the future - if it is still hot - please use the existing infrastructure.
pinterf
7th October 2021, 14:51
Can someone help me. I finally built AviSynthCUDAFilters and masktools-cuda, but I'm having the same problem as DKATOM I think. When I run the script my GPU just sits at 100% using about 800mb of vram. And virtualdub has a blank box.
These are the files I built.
(I renamed Kmasktools to masktools2 after it was built)
I'm using the avisynth cuda build that was posted in this thread avisynth 3.7.1 test4
My script looks something like this....
I also tried this, with the same result.
When I remove onCUDA, at the bottom of Virtualdub there's the error
I tried removing onCPU and Virtualdub gave the error:
I tried using an older GPU and it doesn't hang at 100% usage. Instead VirtualDub gives an error at the bottom:
Any help would be GREATLY appreciated. I'm not sure what to try next :')
Unfortunately I'm not able to help you with it.
Back in January I was able to run this script:
Avisource("MyHi8.avi").killaudio().assumefps(25,1)
AssumeBFF()
SetMemoryMax(2048, type=DEV_TYPE_CUDA)
OnCPU(2).KTGMC(SourceMatch=3, Lossless=2, tr0=1, tr1=1, tr2=1).OnCUDA(2)
I don't remember but my GTX460 was too old (GeForce drivers stopped supporting it, while CUDA SDK had a mininum requested version against the driver), then I bought a 1030 and it worked then.
Also these filters are usually limited to 8 bit YV12 and a limited set of plugin parameters.
Dogway
7th October 2021, 16:36
I'm aware of the situations that's why I started my modernization efforts, to bring some sanity. everything in avisynth feels patches over patches, non descriptive filter names, slow scripts or plugins, etc
I'm going to focus back on transformspack soon to deliver serious color work to avisynth and expressions there typically work on float so I wanted to avoid to fill the conversions with:
bif = bi > 16 ? "" : "range_max /"
bii = bi > 16 ? "" : "range_max *"
expr("x "+bif+" y "+bif+" "+atan2t()+" "+bii+"", "")
videoh
7th October 2021, 17:49
I started my modernization efforts, to bring some sanity. everything in avisynth feels patches over patches, non descriptive filter names, slow scripts or plugins, etc The Saviour has arrived. Hallellujah!
/sarc
Dogway
7th October 2021, 18:15
The Saviour has arrived. Hallellujah!
/sarc
Now I understand why your high post count, all talk no work. Go do something productive.
videoh
7th October 2021, 18:42
Script kiddie didn't do his homework.
Dogway
7th October 2021, 19:00
Script kiddie didn't do his homework.
Oh, the dinosaur sticking out the leg. You might be those that dislike python, julia, avisynth/vs wonderful community scripts... please some moderator, warn this guy or at least delete all his babbling posts.
Takoh
7th October 2021, 20:49
Unfortunately I'm not able to help you with it.
I don't remember but my GTX460 was too old (GeForce drivers stopped supporting it, while CUDA SDK had a mininum requested version against the driver), then I bought a 1030 and it worked then.
Also these filters are usually limited to 8 bit YV12 and a limited set of plugin parameters.
Alright thank you pinterf :) I'll keep trying. Going to try and build avisynth myself next. And after that I might try a different set of nvidea drivers.
Edit: Also I noticed I forgot to build KNNEDI3. It's giving an error that it can't find "..\..\Common.props" so hopefully I can get it built.
And I installed CUDA Dev 11.4 but my drivers are using 11.2 so that could be an issue. I'll try uninstalling it...
Oh and I didn't notice an error that I don't have Windows SDK 8.1 for some things ^_^; lol . I'll try and get it... (I'd rather find these mistakes than have no mistakes, so I still have hope lol.)
Edit2: Oh ok, i guess KNNEDI3 wants to be under cudafilters
Takoh
7th October 2021, 22:54
Hello! I finally got a script to work! :D
Not KTGMC, but still a small win, so I'm really happy!
I used MagicYUV for encoding.
1)This gave about 170fps when saving. Increasing onCUDA(x) beyond 2 didn't seem to increase the speed. (Also, SetMemoryMax type=DEV_TYPE_CUDA didn't effect the speed.) AviSource(srcfile)
onCPU()
AvsCUDA_Spline64Resize (1280,720)
onCUDA(2)
2) This gave about 250fps and was pretty consistent. AviSource(srcfile)
onCPU(43)
AvsCUDA_Spline64Resize (1280,720)
onCUDA(2)
3) This gave about 17fpsAviSource(srcfile)
onCPU(43)
Spline64Resize (1280,720)
onCPU(43)
4) This gave around 90-150fps but it bounced around a lot.AviSource(srcfile)
onCPU(43)
Spline64Resize (1280,720)
Prefetch(43)
Anyway! I just wanted to share. I'm really excited that I finally got something working lol :p
Thank you pinterf for porting it :)
EDIT: KTemporalNR , KDeband and KEdgeLevel work.
https://github-com.translate.goog/nekopanda/AviSynthCUDAFilters/wiki/Post-Processing-Filters?_x_tr_sl=ja&_x_tr_tl=en&_x_tr_hl=en-GB&_x_tr_pto=nui,sc
videoh
8th October 2021, 00:59
Good stuff, Takoh.
pinterf
8th October 2021, 11:53
Hello! I finally got a script to work! :D
Not KTGMC, but still a small win, so I'm really happy!
Nice!
Your Prefetch and OnCPU numbers are a bit too much I think.
Translated doc from the original:
http://avisynth.nl/index.php/SetFilterMTMode#OnCPU
edit:
The CUDA environment which Nekopanda created was introduced because each consecutive filter can run on GPU, there is no copy-in-out overhead.
The whole KTGMC basically runs without coming back to CPU processing. Source filter - CUDA processing - Back to real file (CPU).
Keep experimenting and write your adventures.
tormento
8th October 2021, 13:02
#bump: I could kill to have CudaMDegrain. :)
magnetite
8th October 2021, 19:44
There is a KSMDegrain (https://github-com.translate.goog/nekopanda/AviSynthCUDAFilters/blob/master/TestScripts/KSMDegrain.avsi?_x_tr_sl=ja&_x_tr_tl=en&_x_tr_hl=en-GB&_x_tr_pto=nui,sc) script under the TestScripts folder.
Takoh
9th October 2021, 00:51
Nice!
Your Prefetch and OnCPU numbers are a bit too much I think.
Translated doc from the original:
http://avisynth.nl/index.php/SetFilterMTMode#OnCPU
Ah ok I'll give it a try with 2.
edit3: ya, onCPU(2) gives the same performance. Thanks :)
edit:
The CUDA environment which Nekopanda created was introduced because each consecutive filter can run on GPU, there is no copy-in-out overhead.
The whole KTGMC basically runs without coming back to CPU processing. Source filter - CUDA processing - Back to real file (CPU).
Keep experimenting and write your adventures.
Ahhh I wish i could get it to work. If anyone wants they can upload their built KTGMC dll etc for me to try in case mine is wonky.
I'm not sure if i tested KSMDegrain. I'll give it a try.
Edit: Unfortunately KSMDegrain is giving that same error. "Avisynth read error: [CUDA Error] 400: invalid resource handle @948"
It looks like it uses KTGMC. I'm going to double check to see if i'm missing any plugins that KTGMC.avsi mentions are required. (I bet I am lol). Although it mentions QTGMC under getting started so not sure if the plugins listed are correct for KTGMC.
Edit2: I updated/added all of the plugins mentioned but still get the same error message ;(
When I built the cuda filters solution, a few things were asking for CUDA 8.0, so I installed it. Not sure if I was supposed to update something there to use Cuda 11.2
-------------------------------------------------------------------------------------
I tried using this:
"D3DVP
Direct3D 11 Video Processing Avisynth / AviUtl Filter
A de-interlacing filter that uses the Direct3D 11 Video API. If the driver of your GPU is properly implemented, you can de-interlace with the GPU."
https://github-com.translate.goog/nekopanda/D3DVP?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB&_x_tr_pto=nui
But I get an error: CAVIStreamSynth: System exception - Access Violation... :(
He says, "Avisynth 2.6 or later? (Unknown because I have only tried it with AvisynthPlus CUDA)" so I guess it only works on his version. I've got vs2015 runtime installed as well.
pinterf
9th October 2021, 06:09
CUDA 8.0 rererences must be replaced to the actual SDK.afaik this had to be done before I was able to compile. Nvidia's 8.0 sdk and perhaps even 9 + Visual Studio 2019 is not supported combination.
tormento
9th October 2021, 08:55
There is a KSMDegrain
I think the dlls it relies upon are obsolete, to say the best.
Takoh
10th October 2021, 03:54
CUDA 8.0 rererences must be replaced to the actual SDK.afaik this had to be done before I was able to compile. Nvidia's 8.0 sdk and perhaps even 9 + Visual Studio 2019 is not supported combination.
OK thanks. :) I'll try and see if i can do that. I'm not very experienced with that sort of thing :D
Dogway
15th October 2021, 11:39
Is there such thing as clip properties as opposed to frame properties? I would like to set some properties at clip level.
tormento
15th October 2021, 12:46
New build.
I have incurred in the same error as described here (https://forum.doom9.org/showthread.php?p=1882153#post1882153) when enabling prefetch.
SetFilterMTMode("DEFAULT_MT_MODE", 2)
LoadPlugin("D:\Eseguibili\Media\DGDecNV\DGDecodeNV.dll")
DGSource("F:\In\1_48 Fantozzi\fantozzi.dgi",ct=24,cb=24,cl=0,cr=0)
ConvertBits(16)
SMDegrain (tr=6, thSAD=600, refinemotion=true, contrasharp=false, PreFilter=4, plane=4, chroma=true)
ConvertToRGB32()
AWB_Func(matrix="Rec709")
ConvertToYUV420()
fmtc_bitdepth (bits=8,dmode=8)
Prefetch(6)
Can you help me or fix it?
P.S: ConvertToYUV420() gives me a 8 bit clip. I can imagine it's because of RGB32. Perhaps it's better to move fmtc_bitdepth before ConvertToRGB32()?
real.finder
15th October 2021, 16:58
Is there such thing as clip properties as opposed to frame properties? I would like to set some properties at clip level.
there are old http://avisynth.nl/index.php/Clip_properties
but I think frame properties Functions (http://avisynth.nl/index.php/Internal_functions#Functions_for_frame_properties) can be updated to act like getparity() (that mean adding int "frame" to all them so they can be used outside runtime filters) similar as vs cheating (https://forum.doom9.org/showthread.php?p=1954997#post1954997)
FranceBB
15th October 2021, 19:35
Perhaps it's better to move fmtc_bitdepth before ConvertToRGB32()?
Definitely, you're already getting 8bit so having fmtc_bitdepth there is useless. Put it before RGB32 so that it dithers ;)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.