Log in

View Full Version : Dogway's Filters Packs


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 [56] 57 58 59 60 61 62

Sharc
29th September 2023, 15:08
Weird. For the first part try something like

converttoYV12(interlaced=true)
BWDIF(field=3).selecteven()
RestoreFPS(23.976,1.0)

Edit: still messy,sorry

anton_foy
8th October 2023, 08:40
Is there a special scene or frame you have issues with? I tested with the Carrie call (I use tr 1 and 2 and thSAD=400 for the 2nd call) and found it good enough.
Also keep in mind this is a BW film so plane=0 and chroma=false.

The film shows "fizz" grain. It's in between the Carrie example and something stronger like 300. I found that a blksize of 32 is good to avoid catching these kind of big grains, along refinemotion this is a good approach. Filters like SPresso or STTWM are not suited here because they only filter minimal change noise, these are more for DVDs or faint grain.
My general approach with strong grain is a rather strong prefilter (with LFR), and a rather not so strong filter without LFR.

Personally for my encodes I don't like the clean look because they either look psychovisually blurry or sometimes it shows the "screen" effect, like grain stuck over a glass, so I apply some artificial grain after denoising.

@Dogway, how to achieve the "screen" effect you mention here? You mean like applying temporal denoising on a spatial denoised difference kind of? I would like to try this technique just for an experiment.

Lan4
8th October 2023, 23:59
Hello. Question about FineSharpPlus.

I use values:
FineSharpPlus(mode=1, sstr=1, cstr=0.1, xstr=0, lstr=1, pstr=4, ldmp=0, hdmp=0)

If you increase "pstr" more than 4, the difference in the result will be almost invisible. If "lstr" is set to 2 (or above), then the difference at pstr=4 or higher becomes more noticeable. This is right?

Lan4
9th October 2023, 15:42
Question about using the kernel in DetailSharpen and FineSharpPlus. I'm watching the preview in AvsPmod.

Using gaussian kernel in DetailSharpen(mode=0). Look at the furrows in the image that are most noticeable on the face.
https://i.postimg.cc/fTCNXDpd/1.png

Using box kernel in DetailSharpen(mode=1). Now the furrows have disappeared.
https://i.postimg.cc/Ssc0KhcJ/2.png

Using gaussian kernel in FineSharpPlus(mode=1)
https://i.postimg.cc/SR4B2vGV/3.png

And using box kernel in FineSharpPlus(mode=-1).
https://i.postimg.cc/7hNpgns4/4.png

There is no difference. Furrows are present in both last examples, as if the kernel is not switching. Am I right or wrong?

The question is more of a scientific one, since furrows are not visible after encoding, or almost invisible.

fabioseixal
14th October 2023, 02:47
@Dogway, I've been experimenting ex_Vibrance(), to be more precise the Recovery mode to get back the proper saturation after rainbow removal.
The issue is that ex_Vibrance is working okish, i.e., it does recover contrast in areas that where lost, but the problem is that it is also getting back the rainbows in some places.
There also frames where the issue is even worse than before (see below)

Any idea why? I mean, any idea if this can be avoided?
This idea of getting back the contrast after removing the rainbows is a neat idea and it would be awesome to be able to make use of it.


Here is an example.

Source: (Rainbow is visible in the centre near the hole, near the vertical lines etc)

https://i.imgur.com/j268GsV.png]

Source + Scomb: Rainbows are gone

https://i.imgur.com/fBQWd61.png

Source + Scomb + ex_Vibrance: Rainbow is back and vertical lines are now surrounded by a Yellowish "aura", i.e., rainbow effect is accentuated

https://i.imgur.com/QUOwFCz.png

Script used:

DGSource("ep1.dgi")

vibrance=last
scomb()
ex_vibrance(1.0, mode="Recover", Rc=vibrance)

PS: Yes, the video is interlaced, that's where scomb really shines. Probably that's the issue... oh well
PS2: I made the same test but with progressive video and the issue remains exactly the same

Dogway
26th October 2023, 00:54
Sorry for the delay, I'm quite busy now with APP development.

@fabioseixal: I think in this case it's better to increase saturation or vibrance. If your filtering is local then the difference of saturation in "recovery" mode is also going to be local. "Recover" works better with mostly global desaturation like denoisers and such.

For DeRainbow I used to use:
edgy=FlatMask(2.0).ex_expand()
ex_merge(last,FFT3DFilter( sigma=2, sigma2=8, sigma3=12, sigma4=4, bt=3, plane=3, ncpu=4),edgy.ex_expand(),Y=2,UV=3,luma=true)

but FFT3DFilter is slow so you can try other denoisers.
I also had this expanded version which kills rainbowing further and preserves saturation a bit better.

o = last
derain = o.ex_median("median",Y=2,UV=3)
Hmed = ex_luts(o,o,mode="median",pixels="-2 0 -1 0 0 0 1 0 2 0",UV=2)
Hedge = ex_lutxy(Hmed,o,"x y - abs 8 *",UV=128)
ex_merge(o,derain,Hedge.ex_expand(2),luma=true,Y=2,UV=3)

edgy=FlatMask(2.0).ex_expand()
ex_merge(o,FFT3DFilter( sigma=2, sigma2=8, sigma3=12, sigma4=4, bt=3, plane=3, ncpu=4),edgy.ex_expand().ex_vibrance(1),Y=2,UV=3,luma=true)


Question about using the kernel in DetailSharpen and FineSharpPlus. I'm watching the preview in AvsPmod.

Using gaussian kernel in DetailSharpen(mode=0). Look at the furrows in the image that are most noticeable on the face.

There is no difference. Furrows are present in both last examples, as if the kernel is not switching. Am I right or wrong?

The question is more of a scientific one, since furrows are not visible after encoding, or almost invisible.

I'm not sure to understand "furrows" in this case, but the implementation in both sharpeners are different, to compare them equally you'd need DetailSharpen() with med=true. As for FineSharpPlus' I might revise the non-linear values as I get a gray clip out of shrpD var. Actually I fixed an issue on _cstr var as spline() was going out of bounds.

Lan4
27th October 2023, 01:56
In Finesharp, increasing the LSTR and PSTR parameters softens the sharpness. In FinesharpPlus, on the contrary, it increases sharpness. I'm right? Showing a preview from AvsPmod:

https://imgsli.com/MjE2NDkx

Lan4
27th October 2023, 02:20
This is how I understand how Finesharp works. LSTR softens flat areas and textures. PSTR softens edges without affecting flat areas or textures. Screenshots after encoding:

sstr=5, lstr=1, pstr=1 (all other values are at minimum, 0 or 0.1)
https://i.postimg.cc/RVBDhJqp/100-BSG-4-14-new1.png


sstr=5, lstr=5, pstr=1
https://i.postimg.cc/JzT6pTxS/100-BSG-4-14-new2.png


sstr=5, lstr=1, pstr=5
https://i.postimg.cc/N05NS1PF/100-BSG-4-14-new3.png


But I don't understand how FinesharpPlus works. I have to guess with the values to get the result I want.

Dogway
27th October 2023, 19:22
@Lan4: Sorry for the delay, FineSharp non-linear sharpening is an old implementation, whereas FineSharpPlus one is based on LSFplus in Smode=5, if any you might want to compare to that. This is not to say everything's right on FineSharpPlus, the contrary, I need to give it a review to see why I'm getting a flat grey shrpD clip, as well as confirm your suspicions. When I get some time I will let you know. Maybe I open an issue ticket on the repo so I don't forget.

poisondeathray
7th November 2023, 21:05
ex_vibrance does not seem to work for 10bit or 12bit 420/422/444 input. 8bit, 14bit, 16bit ok

Do you prefer issues reported here or github issues tracker ?

Lan4
8th November 2023, 02:38
I think maybe Finesharp is outdated and we need to leave it and modifications in the past? Difficulties arise here and there, and his behavior is often unpredictable.
The values do not increase by one, and sometimes increasing a parameter does not give anything at all, for example, I have ldmp 1=ldmp 2.
Artifacts, blockiness, grids, stripes, halos or ringing appear. Logically this is not related to decreasing and increasing sharpness. This happens randomly, on its own, and just as suddenly disappears.
Sometimes the opposite effect occurs, I increase the softening, but after encoding the sharpness is somehow higher. Sometimes "lstr" and "pstr" do the work for each other, and reducing the edges suddenly reduces the textures, or vice versa, working with textures changes the edges. Moreover, this happens inconsistently.
All this makes the use of Finesharp unpredictable.
In fact, I know three non-linear sharpeners - LSF, Finesharp and DetailSharpen. Moreover, I don’t know how to achieve a strong increase in texture sharpening in LSF, and it cannot be called a small and fast filter. Is it possible to create a modern filter replacement?

kedautinh12
8th November 2023, 05:04
You can try ex_unsharp
https://github.com/Dogway/Avisynth-Scripts/blob/24432b3980208582f7175f74107a1415b6175b68/MIX%20mods/SharpenersPack.avsi#L484

Lan4
8th November 2023, 11:25
You can try ex_unsharp
https://github.com/Dogway/Avisynth-Scripts/blob/24432b3980208582f7175f74107a1415b6175b68/MIX%20mods/SharpenersPack.avsi#L484
Of course I already tried ex_unsharp. This filter only sharpens edges and can soften textures. But if you expand the threshold down, I think it will increase the sharpness of the textures. What I once wrote to Dogway about. But this requires a new filter.

poisondeathray
8th November 2023, 15:36
Sometimes the opposite effect occurs, I increase the softening, but after encoding the sharpness is somehow higher.

And what does it look like before encoding, or using better settings than CQP 28? Your inconsistent results are at least partially result of your encoding settings, not only the filter . When examining the effect of filter, use lossless encoding so you examine the effects of the filter, so it's not distorted by other a dozen other factors

Emulgator
8th November 2023, 15:57
Is it possible to create a modern filter replacement?
I would try SSSharp, MedSharp2.
Any more improvement above these will call for AI sharpeners.

kedautinh12
8th November 2023, 16:33
I would try SSSharp, MedSharp2.
Any more improvement above these will call for AI sharpeners.

Do you have any suggestions paramete for these???

Lan4
8th November 2023, 18:33
I would try SSSharp, MedSharp2.
These are slow and heavy filters. We're talking about a fast and easy filter.

Emulgator
9th November 2023, 00:22
Do you have any suggestions paramete for these???
Fully source dependent. Any grain, texture, moirč, halos respond differently.
But these two hit simpler algos out of the water. No size fits all, you got to try and err or succeed.
Fast and easy: Definitely not these. Who wants to gain quality, invests now and yields later.
Many thanks to Dogway for making these huge beasts available in working order again.

Dogway
9th November 2023, 18:52
ex_vibrance does not seem to work for 10bit or 12bit 420/422/444 input. 8bit, 14bit, 16bit ok

Do you prefer issues reported here or github issues tracker ?

Hey PDR, by the way thanks for the set_output() trick the other day.

These days I'm quite busy in other projects so I don't visit the forum as often. In Github I get notified by mail so whoever has an account there, an issue ticket is preferred.

I'm checking the issue right now and report back.

EDIT: Yep, can confirm. Having a look now.

EDIT2: Ok the issue is here and I can remove the optimization and it fixes, but I don't understand why it's happening.

rhlf = bi32 ? "2 *" : bi > 12 ? "range_half /" : string(1. / ex_bs(128,8,bi,!tv)) + " *"

Basically when bits are above 12, simply "range_half /", either (bits are 10 or 12) multiply by the reciprocal, so 1. / 2048 in the 12-bit case.

Lan4
9th November 2023, 21:32
And what does it look like before encoding, or using better settings than CQP 28? Your inconsistent results are at least partially result of your encoding settings, not only the filter . When examining the effect of filter, use lossless encoding so you examine the effects of the filter, so it's not distorted by other a dozen other factors
lossless made the result even worse. I used:
FineSharp(mode=1, sstr=2.2, cstr=0.2, xstr=0, lstr=1.8, pstr=7, ldmp=0.1)

CQP=0
https://i.postimg.cc/65w4TtGd/1023-MMM-new-a.png

Comparison CQP=0 and CQP=26
https://imgsli.com/MjE5NTI3

DetailSharpen fixes this by changing the kernel.

tormento
28th November 2023, 21:29
Is possible to apply different amount of denoising to chroma and luma?

With SMDegrain, of course.

Dogway
29th November 2023, 02:42
@tormento: You can specify thSADC for chroma, but regarding temporal radius, nope, you'll need to filter chroma with a second SMDegrain call, then merge Y from one clip and Chroma from the other.

tormento
29th November 2023, 09:36
@tormento: You can specify thSADC for chroma, but regarding temporal radius, nope, you'll need to filter chroma with a second SMDegrain call, then merge Y from one clip and Chroma from the other.


How have I to set planes and chroma switches to filter chroma and luma with different thSAD in the same line?

I have read that chroma can be “abused” more than luma in noise reduction and I want to try if true.

kedautinh12
29th November 2023, 10:47
Try mergechroma and mergeluma
avisynth.nl/index.php/Merge

Example:
a=last
lum=a.TemporalDegrain2(degrainPlane=0)
chr=a.SMDegrain(thSADC=300, luma=false)
a.mergechroma(chr).mergeluma(lum)

Dogway
29th November 2023, 13:26
How have I to set planes and chroma switches to filter chroma and luma with different thSAD in the same line?

I have read that chroma can be “abused” more than luma in noise reduction and I want to try if true.

Where did you read that? Unless chroma is ***ed up it usually uses a lower thSAD since it has a decreased contrast.
If temporal radius is the same, it's quite easy:
SMDegrain(tr=3, thSAD=400, thSADC=200)

Aside from kedautinh12 example, you can also use CombinePlanes()

tormento
29th November 2023, 13:54
Where did you read that?


FFT thread. Is it bullshit?

kedautinh12
29th November 2023, 14:28
I think with prefilter 6 and 8 will be better for chroma

Blankmedia
1st December 2023, 16:31
Hi, I was wondering what would cause these differences between these two versions:

https://i.imgur.com/IPHJdTm.png https://i.imgur.com/ETybvE7.png

The code to deinterlace is the one below, I'm trying to update my scripts and try something new.

I noticed more stuff going on with the new version. It as more shimmering, and blending.



### Deinterlace-Match Fields-Decimate ###
Function FieldMatch(Clip Cee) {
Global PeePee = Cee.DuplicateFrame(0)
Global CeeCee = Cee
Global NeeNee = Cee.DeleteFrame(0)
Pee2 = PeePee.SeparateFields()
Cee2 = CeeCee.SeparateFields()
Nee2 = NeeNee.SeparateFields()
Global PeeCee = Interleave(Pee2.SelectEven(),Cee2.SelectOdd()).Weave()
Global CeePee = Interleave(Cee2.SelectEven(),Pee2.SelectOdd()).Weave()
Global CeeNee = Interleave(Cee2.SelectEven(),Nee2.SelectOdd()).Weave()
Global NeeCee = Interleave(Nee2.SelectEven(),Cee2.SelectOdd()).Weave()
Global Deintee = QTGMCp(CeeCee, Preset="very slow",sourcematch=3, Sharpness=0.0, lossless=2 ).selecteven()
Return ScriptClip(CeeCee, \
"!CeeCee.IsCombedTIVTC(CThresh=12,Chroma=True,BlockX=16,BlockY=32) ? CeeCee : " + \
"!NeeNee.IsCombedTIVTC(CThresh=12,Chroma=True,BlockX=16,BlockY=32) ? NeeNee : " + \
"!CeeNee.IsCombedTIVTC(CThresh=12,Chroma=True,BlockX=16,BlockY=32) ? CeeNee : " + \
"!NeeCee.IsCombedTIVTC(CThresh=12,Chroma=True,BlockX=16,BlockY=32) ? NeeCee : " + \
"!PeePee.IsCombedTIVTC(CThresh=12,Chroma=True,BlockX=16,BlockY=32) ? PeePee : " + \
"!CeePee.IsCombedTIVTC(CThresh=12,Chroma=True,BlockX=16,BlockY=32) ? CeePee : " + \
"!PeeCee.IsCombedTIVTC(CThresh=12,Chroma=True,BlockX=16,BlockY=32) ? PeeCee : Deintee")
}

### Deinterlace-Match Fields-Decimate ###
function SimpsonsDesentrelace( clip IN, string "chemin" )
{
TFM(IN, Order=-1,Mode=5,PP=2,Clip2=FieldMatch(IN),Slow=2,MChroma=False,Ubsco=False,CThresh=12,mthresh=2,Chroma=True, micmatching=0, d2v=chemin)
TDecimate(Mode=1)
}





https://imgur.com/a/S6uD0VP (https://imgur.com/a/S6uD0VP)

Thank you!

Dogway
1st December 2023, 22:43
Animation is typically telecined unless this is a TV capture or something, this is not ideal.
QTGMC+ is mainly designed after live recorded video with more temporal coherence.

Try to add back the old bobber with:
UseEdiExt=1 (or 2 for vinverse filtered), EdiExt=ex_bob(src, 0,0.5,props=1)

kedautinh12
3rd December 2023, 13:02
I got all green frame when use FilmGrainPlus with this video (https://drive.google.com/file/d/1gmnpk4vOf9Lt04RdlQYhqzkIycd2dgvw/view?usp=drivesdk)

script:
LoadPlugin("C:\Encode Tools\MeGUI-2944-64\tools\ffms\ffms2.dll")
FFVideoSource("C:\Users\ADMIN\Downloads\Aitai - SE7VN PV.avi", fpsnum=30000, fpsden=1001, threads=1, colorspace="YUV420P8")
FilmGrainPlus(preset="Vision2 5218 500T")

Dogway
3rd December 2023, 16:16
Strange, no prob here. Using ffms2_r1387 and AVS+ r4003

kedautinh12
3rd December 2023, 16:35
I test latest ver from Pinterf and got no error, i think it's from Asd-g's avs + compilie. Sr for disturb :D

madey83
4th December 2023, 19:08
hello,

can i ask for help with clearing out this clip:
https://mega.nz/file/sZZh2bpI#zK7jGmvE7xAM7gxR2YyN4oAfLTPVTpqB6eIUaHFhupk

thank you in advance for any help :)

kedautinh12
5th December 2023, 03:53
Result with RealESRGAN_x4plus_anime_6B
https://i.imgur.com/HBS8Hvi.png

Script:
z_ConvertFormat(pixel_type="rgbps", colorspace_op="709:709:709:l=>rgb:709:709:f")
mlrt_ncnn(network_path="C:/Program Files (x86)/AviSynth+/plugins64+/models/RealESRGAN/RealESRGAN_x4plus_anime_6B.onnx", builtin=false, fp16=true, tilesize_w=width/4, tilesize_h=height/4)
propSet("_FieldBased",0)
deep_resize(1280,720,edge="SSIM2")
z_ConvertFormat(pixel_type="yuv420p8", colorspace_op="rgb:709:709:f=>709:709:709:l")

kedautinh12
5th December 2023, 06:01
I tried with DPIR +UniScale CartoonRestore-lite + AnimeJanai and got this result:
https://i.imgur.com/3ynNODU.png

Script:
z_ConvertFormat(pixel_type="rgbps", colorspace_op="709:709:709:l=>rgb:709:709:f")
mlrt_DPIR(model=1, strength=6, tiles=2) # Denoise
mlrt_ncnn(network_path="C:/Program Files (x86)/AviSynth+/plugins64+/models/UniScale/2x_UniScale_CartoonRestore-lite.onnx", builtin=false, fp16=true, tilesize_w=width/4, tilesize_h=height/4) # Restoration
propSet("_FieldBased",0)
deep_resize(1280,720,edge="SSIM2")
mlrt_ncnn(network_path="C:/Program Files (x86)/AviSynth+/plugins64+/models/Compact/2x_AnimeJaNai_Standard_V1_Compact_net_g_120000.onnx", builtin=false, fp16=true) # Sharpen
deep_resize(1280,720,edge="SSIM2") #target 1280x720
z_ConvertFormat(pixel_type="yuv420p8", colorspace_op="rgb:709:709:f=>709:709:709:l")

madey83
5th December 2023, 08:30
hello kedautinh12,

thank you for your feedback...

Could you please tell me where i can find these "onnx" files because i was able to find only e.g. something like that
https://openmodeldb.info/models/4x-realesrgan-x4plus-anime-6b

is there any special opening method to those models in AVSPmod app?
i have got this:
https://imgur.com/txIHjv9

madey83
5th December 2023, 08:32
I tried with DPIR +UniScale CartoonRestore-lite + AnimeJanai and got this result:
https://i.imgur.com/3ynNODU.png

Script:
z_ConvertFormat(pixel_type="rgbps", colorspace_op="709:709:709:l=>rgb:709:709:f")
mlrt_DPIR(model=1, strength=6, tiles=2) # Denoise
mlrt_ncnn(network_path="C:/Program Files (x86)/AviSynth+/plugins64+/models/UniScale/2x_UniScale_CartoonRestore-lite.onnx", builtin=false, fp16=true, tilesize_w=width/4, tilesize_h=height/4) # Restore
propSet("_FieldBased",0)
deep_resize(1280,720,edge="SSIM2")
mlrt_ncnn(network_path="C:/Program Files (x86)/AviSynth+/plugins64+/models/Compact/2x_AnimeJaNai_Standard_V1_Compact_net_g_120000.onnx", builtin=false, fp16=true) # Upscales
deep_resize(1280,720,edge="SSIM2") #target 1280x720
z_ConvertFormat(pixel_type="yuv420p8", colorspace_op="rgb:709:709:f=>709:709:709:l")

this RealESRGAN_x4plus_anime_6B looks cleaner to my eyes...

kedautinh12
5th December 2023, 08:37
Choose what you like. For personal, i prefer DPIR +UniScale CartoonRestore-lite + AnimeJanai's result

madey83
5th December 2023, 08:49
hello kedautinh12,

thank you for your feedback...

Could you please tell me where i can find these "onnx" files because i was able to find only e.g. something like that
https://openmodeldb.info/models/4x-realesrgan-x4plus-anime-6b

is there any special opening method to those models in AVSPmod app?
i have got this:
https://imgur.com/txIHjv9


could you please advice...

kedautinh12
5th December 2023, 08:56
You need .dll filters and models from here:
https://github.com/Asd-g/avs-mlrt/releases
Additional scripts:
https://github.com/Asd-g/avs-mlrt/blob/main/mlrt.avsi

More models you can get from here:
https://github.com/styler00dollar/VSGAN-tensorrt-docker/releases/tag/models

madey83
5th December 2023, 09:08
You need .dll filters and models from here:
https://github.com/Asd-g/avs-mlrt/releases
Additional scripts:
https://github.com/Asd-g/avs-mlrt/blob/main/mlrt.avsi

More models you can get from here:
https://github.com/styler00dollar/VSGAN-tensorrt-docker/releases/tag/models

thank you :)

madey83
5th December 2023, 09:27
You need .dll filters and models from here:
https://github.com/Asd-g/avs-mlrt/releases
Additional scripts:
https://github.com/Asd-g/avs-mlrt/blob/main/mlrt.avsi

More models you can get from here:
https://github.com/styler00dollar/VSGAN-tensorrt-docker/releases/tag/models

Could you please give another help?

this is my avspmod app call and it crush:

tcFile = "E:\timestamps.txt" # timestamps file path
Exist(tcFile) ? FFVideoSource("E:\source.mkv", cachefile="E:\temp.ffindex", timecodes=tcFile) : FFVideoSource("E:\source.mkv", cachefile="e:\temp.ffindex")

Crop(160, 0, -160, -0)
import("E:\4k_Encode\Avisynth-Scripts-master\MIX mods\GradFun3plus.avsi")
import("E:\4k_Encode\Avisynth-Scripts-master\ExTools.avsi")
import("E:\4k_Encode\Avisynth-Scripts-master\SMDegrain\SMDegrain.avsi")
Import("E:\4k_Encode\Avisynth-Scripts-master\ResizersPack.avsi")
Import("E:\4k_Encode\Avisynth-Scripts-master\MIX mods\LSFplus.avsi")
Import("E:\4k_Encode\Avisynth-Scripts-master\MIX mods\SharpenersPack.avsi")
Import("E:\4k_Encode\Avisynth-Scripts-master\GradePack.avsi")
Import("E:\4k_Encode\Avisynth-Scripts-master\ScenesPack.avsi")
Import("E:\4k_Encode\Avisynth-Scripts-master\MasksPack.avsi")
Import("E:\4k_Encode\Avisynth-Scripts-master\MIX mods\Spresso.avsi")
import("E:\4k_Encode\Avisynth-Scripts-master\EX mods\DeblockPack.avsi")
import("E:\4k_Encode\Avisynth-Scripts-master\TransformsPack - Main.avsi")
import("E:\4k_Encode\Avisynth-Scripts-master\TransformsPack - Models.avsi")
import("E:\4k_Encode\Avisynth-Scripts-master\TransformsPack - Transfers.avsi")
loadplugin("E:\4k_Encode\BM3DCUDA_AVS-test10-cuda118\x64\BM3DCPU_AVS.dll")
loadplugin("E:\4k_Encode\BM3DCUDA_AVS-test10-cuda118\x64\BM3DCUDA_AVS.dll")
loadplugin("E:\4k_Encode\BM3DCUDA_AVS-test10-cuda118\x64\BM3D_VAggregate_AVS.dll")
loadplugin("E:\4k_encode\dgdecnv_248\DGDecodeNV.dll")
loadplugin("E:\4k_encode\vsTCanny-1.1.8\x64\Release\vsTCanny.dll")
loadplugin("E:\4k_Encode\neo_FFT3D_r11\x64\neo-fft3d.dll")
loadplugin("E:\4k_Encode\fmtconv-r30\win64\fmtconv.dll")
loadplugin("E:\4k_Encode\avs_libplacebo-1.2.0\x64\Release\avs_libplacebo.dll")
loadplugin("E:\4k_Encode\ClipClop_x86_x64_dll_v1-27_20210727\Avisynth+_x64\ClipClop_x64.dll")
loadplugin("E:\4k_Encode\DGHDRtoSDR_1.15\DGHDRtoSDR.dll")
loadplugin("E:\4k_Encode\NNEDI3CL-1.0.8\x64\Release\NNEDI3CL.dll")

loadplugin("E:\4k_Encode\____models\mlrt_ncnn-1.0.1\x64\Release\mlrt_ncnn.dll")
import("E:\4k_Encode\____models\mlrt_ncnn-1.0.1\mlrt.avsi")

z_ConvertFormat(pixel_type="rgbps", colorspace_op="709:709:709:l=>rgb:709:709:f")
mlrt_ncnn(network_path="E:\4k_Encode\____models\RealESRGAN_x4plus_anime_6B.onnx", builtin=false, fp16=true, tilesize_w=width/4, tilesize_h=height/4)
propSet("_FieldBased",0)
deep_resize(1280,720,edge="SSIM2")
z_ConvertFormat(pixel_type="yuv420p8", colorspace_op="rgb:709:709:f=>709:709:709:l")

madey83
5th December 2023, 10:19
Could you please give another help?

this is my avspmod app call and it crush:

tcFile = "E:\timestamps.txt" # timestamps file path
Exist(tcFile) ? FFVideoSource("E:\source.mkv", cachefile="E:\temp.ffindex", timecodes=tcFile) : FFVideoSource("E:\source.mkv", cachefile="e:\temp.ffindex")

Crop(160, 0, -160, -0)
import("E:\4k_Encode\Avisynth-Scripts-master\MIX mods\GradFun3plus.avsi")
import("E:\4k_Encode\Avisynth-Scripts-master\ExTools.avsi")
import("E:\4k_Encode\Avisynth-Scripts-master\SMDegrain\SMDegrain.avsi")
Import("E:\4k_Encode\Avisynth-Scripts-master\ResizersPack.avsi")
Import("E:\4k_Encode\Avisynth-Scripts-master\MIX mods\LSFplus.avsi")
Import("E:\4k_Encode\Avisynth-Scripts-master\MIX mods\SharpenersPack.avsi")
Import("E:\4k_Encode\Avisynth-Scripts-master\GradePack.avsi")
Import("E:\4k_Encode\Avisynth-Scripts-master\ScenesPack.avsi")
Import("E:\4k_Encode\Avisynth-Scripts-master\MasksPack.avsi")
Import("E:\4k_Encode\Avisynth-Scripts-master\MIX mods\Spresso.avsi")
import("E:\4k_Encode\Avisynth-Scripts-master\EX mods\DeblockPack.avsi")
import("E:\4k_Encode\Avisynth-Scripts-master\TransformsPack - Main.avsi")
import("E:\4k_Encode\Avisynth-Scripts-master\TransformsPack - Models.avsi")
import("E:\4k_Encode\Avisynth-Scripts-master\TransformsPack - Transfers.avsi")
loadplugin("E:\4k_Encode\BM3DCUDA_AVS-test10-cuda118\x64\BM3DCPU_AVS.dll")
loadplugin("E:\4k_Encode\BM3DCUDA_AVS-test10-cuda118\x64\BM3DCUDA_AVS.dll")
loadplugin("E:\4k_Encode\BM3DCUDA_AVS-test10-cuda118\x64\BM3D_VAggregate_AVS.dll")
loadplugin("E:\4k_encode\dgdecnv_248\DGDecodeNV.dll")
loadplugin("E:\4k_encode\vsTCanny-1.1.8\x64\Release\vsTCanny.dll")
loadplugin("E:\4k_Encode\neo_FFT3D_r11\x64\neo-fft3d.dll")
loadplugin("E:\4k_Encode\fmtconv-r30\win64\fmtconv.dll")
loadplugin("E:\4k_Encode\avs_libplacebo-1.2.0\x64\Release\avs_libplacebo.dll")
loadplugin("E:\4k_Encode\ClipClop_x86_x64_dll_v1-27_20210727\Avisynth+_x64\ClipClop_x64.dll")
loadplugin("E:\4k_Encode\DGHDRtoSDR_1.15\DGHDRtoSDR.dll")
loadplugin("E:\4k_Encode\NNEDI3CL-1.0.8\x64\Release\NNEDI3CL.dll")

loadplugin("E:\4k_Encode\____models\mlrt_ncnn-1.0.1\x64\Release\mlrt_ncnn.dll")
import("E:\4k_Encode\____models\mlrt_ncnn-1.0.1\mlrt.avsi")

z_ConvertFormat(pixel_type="rgbps", colorspace_op="709:709:709:l=>rgb:709:709:f")
mlrt_ncnn(network_path="E:\4k_Encode\____models\RealESRGAN_x4plus_anime_6B.onnx", builtin=false, fp16=true, tilesize_w=width/4, tilesize_h=height/4)
propSet("_FieldBased",0)
deep_resize(1280,720,edge="SSIM2")
z_ConvertFormat(pixel_type="yuv420p8", colorspace_op="rgb:709:709:f=>709:709:709:l")

i have fixed...

madey83
5th December 2023, 10:43
@kedautinh12

have you got any sugestion what is wrong with below that gives me error?

SetFilterMTMode("DEFAULT_MT_MODE", 2)
LoadPlugin("E:\4k_Encode\models\mlrt_ncnn-1.0.1\x64\Release\mlrt_ncnn.dll")
Import("E:\4k_Encode\models\mlrt.avsi")
import("E:\4k_Encode\models\mlrt_ncnn-1.0.1\mlrt.avsi")
Import("E:\4k_Encode\SSIM_downsample.avsi")

z_ConvertFormat(pixel_type="rgbps", colorspace_op="709:709:709:l=>rgb:709:709:f")
mlrt_ncnn(network_path="C:\Program Files (x86)\AviSynth+\plugins64+\models\RealESRGAN\RealESRGAN_x4plus_anime_6B.onnx", builtin=false, fp16=true, tilesize_w=width/4, tilesize_h=height/4)
propSet("_FieldBased",0)
deep_resize(1440,1080,edge="SSIM2")
z_ConvertFormat(pixel_type="yuv420p8", colorspace_op="rgb:709:709:f=>709:709:709:l")
Prefetch(8,12)

avs+ [INFO]: using external Avisynth library from: "E:\4k_Encode\apps\StaxRip-v2.29.0-x64\Apps\FrameServer\AviSynth\AviSynth.dll"
avs+ [INFO]: AviSynth+ 3.7.3 (r4029, 3.7, x86_64)
[0 NVIDIA GeForce RTX 2060] queueC=2[8] queueG=0[16] queueT=1[2]
[0 NVIDIA GeForce RTX 2060] bugsbn1=0 bugbilz=0 bugcopc=0 bugihfa=0
[0 NVIDIA GeForce RTX 2060] fp16-p/s/a=1/1/1 int8-p/s/a=1/1/1
[0 NVIDIA GeForce RTX 2060] subgroup=32 basic=1 vote=1 ballot=1 shuffle=1
[1 Intel(R) UHD Graphics] queueC=0[1] queueG=0[1] queueT=0[1]
[1 Intel(R) UHD Graphics] bugsbn1=0 bugbilz=0 bugcopc=0 bugihfa=0
[1 Intel(R) UHD Graphics] fp16-p/s/a=1/1/1 int8-p/s/a=1/1/1
[1 Intel(R) UHD Graphics] subgroup=32 basic=1 vote=1 ballot=1 shuffle=1
avs+ [INFO]: 1440x1080 fps 24000/1001 i420p8 frames 0 - 32560 of 32561
raw [INFO]: output file: "E:\_new_out.hevc"
x265 [INFO]: HEVC encoder version 3.5+147+17-e8947f740 [Mod by Patman]
x265 [INFO]: build info [Windows][MSVC 1937][64 bit] 10bit
x265 [INFO]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [INFO]: Main 10 profile, Level-4 (Main tier)
x265 [INFO]: Thread pool created using 12 threads
x265 [INFO]: Slices : 1
x265 [INFO]: frame threads / pool features : 3 / wpp(17 rows)
x265 [INFO]: Coding QT: max CU size, min CU size : 64 / 8
x265 [INFO]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [INFO]: ME / range / subpel / merge : star / 57 / 5 / 5
x265 [INFO]: Keyframe min / max / scenecut / bias : 23 / 250 / 40 / 5.00
x265 [INFO]: Lookahead / bframes / badapt : 80 / 16 / 2
x265 [INFO]: b-pyramid / weightp / weightb : 1 / 1 / 0
x265 [INFO]: References / ref-limit cu / depth : 3 / on / on
x265 [INFO]: AQ: mode / str / qg-size / cu-tree : 3 / 1.0 / 32 / 1
x265 [INFO]: Rate Control / qCompress : CRF-28.0 / 0.60
x265 [INFO]: tools: rd=3 psy-rd=2.00 early-skip rskip mode=2
x265 [INFO]: tools: rskip-edge-threshold=0.02 signhide tmvp b-intra lslices=6
x265 [INFO]: tools: deblock sao
vkAllocateMemory failed -2
vkWaitForFences failed -4
vkAllocateMemory failed -2
vkAllocateMemory failed -2
avs+ [FLAW]: mlrt_ncnn: inference failed occurred while reading frame 0
vkAllocateMemory failed -2
vkQueueSubmit failed -4vkAllocateMemory failed -2
vkQueueSubmit failed -4
vkAllocateMemory failed -2
vkAllocateMemory failed -2
vkQueueSubmit failed -4
vkQueueSubmit failed -4
vkAllocateMemory failed -2
vkAllocateMemory failed -2
vkAllocateMemory failed -2
vkAllocateMemory failed -2
vkQueueSubmit failed -4
encoded 0 frames

kedautinh12
5th December 2023, 11:01
Did you update GPU driver to latest ver??

madey83
5th December 2023, 11:05
Did you update GPU driver to latest ver??

my current driver for RTX is 545.84


edit:... updated to 546.29 - latest

madey83
5th December 2023, 11:14
i have done test with and without "Prefetch(8,12)"

with staxrip crush, without works but super slow.... CPU utilization is around 4% on each core....


results of the script looks fantastic, but encode with 0,0140 fps is....

kedautinh12
5th December 2023, 11:42
Prefetch only affect to CPU, for GPU you need waiting Asd-g port from Vapoursynth ver, it has Cuda and MDL support with better speed
https://github.com/AmusementClub/vs-mlrt/releases/tag/v13.2

kedautinh12
5th December 2023, 11:45
For Intel CPU or GPU you can try with mlrt_ov
https://github.com/Asd-g/avs-mlrt/blob/main/README_ov.md

Or try with larger num_streams parameters in mlrt_ncnn

madey83
5th December 2023, 11:49
Prefetch only affect to CPU, for GPU you need waiting Asd-g port from Vapoursynth ver, it have Cuda and MDL support with better speed
https://github.com/AmusementClub/vs-mlrt/releases/tag/v13.2

ok. thx for that.

is there any avisynth related solution to clean this video up that i could use....