Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
1st October 2017, 10:51 | #1202 | Link | ||
Registered User
Join Date: Oct 2016
Posts: 111
|
I tried to use KNLMeansCL to denoise all luma and chroma but I get this error and the screen preview is black
Quote:
Quote:
|
||
1st October 2017, 11:31 | #1203 | Link | |
Registered User
Join Date: Nov 2014
Posts: 440
|
Quote:
Code:
clip = core.knlm.KNLMeansCL(clip, h=0.4, channels="Y") clip = core.knlm.KNLMeansCL(clip, h=0.4, channels="UV") Code:
#convert to rgb clip = core.knlm.KNLMeansCL(clip, h=0.4, channels="RGB") #convert to YUV again
__________________
github.com |
|
1st October 2017, 14:05 | #1204 | Link | |
Registered User
Join Date: Oct 2016
Posts: 111
|
Quote:
|
|
6th October 2017, 19:05 | #1205 | Link |
Registered User
Join Date: Feb 2017
Posts: 135
|
Can someone give me a primer as to what various settings of D and A result in? Such as what effect is to be expected, say, when D=1 and A=3, D=2 and A=1, etc? Maybe something like "X type of noise responds best with Y settings". It could be too broad of a question, but since this is such a time-expensive filter I'm looking for the best bang for the buck.
Currently I've settled on using knlmeanscl(D=1, A=3, h=??, S=1) for almost everything. I can push the D up to 2, but that increases encoding time on my GTX750 Ti by 40%. Also, on my system pushing up the D parameter can cause encoding errrors when combined with too many other temporal filters (I feel like I mention that a lot). |
7th October 2017, 02:55 | #1206 | Link | |
Registered User
Join Date: Sep 2006
Posts: 1,657
|
Quote:
https://github.com/Khanattila/KNLMea...er-description In short, D and A are for temporal size and spatial size. For temporal, unless you have some crazy dancing grain, D=2 (5 frames) should be enough for your needs, I just use D=1. For A, S and H you'll have to tweak it according to your source. First bump H (strength) high enough to a point where it removes all noises or where it stopped removing more noise. Then work on A and S one at a time to remove noise that H haven't. At the same time gradually slide down H without introducing more noise. A is the speed killer of the filter, on my GTX 650 ti boost, setting A from 1 to 5 had my speed dropped from 36fps to 2.97fps on a 1440x1080 clip... Code:
clip = core.knlm.KNLMeansCL(clip, d=1, a=5, s=4, h=8) |
|
13th October 2017, 23:28 | #1207 | Link | |
Registered User
Join Date: Nov 2014
Posts: 440
|
Quote:
__________________
github.com |
|
14th October 2017, 06:29 | #1208 | Link | |
Registered User
Join Date: Apr 2015
Posts: 84
|
Quote:
Code:
SetMemoryMax(3000) colorbars(width=1440, height=1080, pixel_type="yv12").killaudio().assumefps(25, 1) KNLMeansCL(d=1, a=5, s=4, h=8, device_type="GPU") 15.37fps Code:
SetMemoryMax(3000) colorbars(width=1920, height=1080, pixel_type="yv12").killaudio().assumefps(25, 1) KNLMeansCL(d=2, a=4, s=4, device_type="GPU") 10.07fps Last edited by edcrfv94; 14th October 2017 at 06:33. |
|
14th October 2017, 21:56 | #1210 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Methinks you're confusing video memory with clock speed.
__________________
Groucho's Avisynth Stuff |
15th October 2017, 12:25 | #1212 | Link |
Registered User
Join Date: Nov 2014
Posts: 440
|
In theory you can use multiple graphics card. Actually it doesn't work because second GPU is waiting but it would be something like that:
Code:
function mGPU(clip source, int d, int a, int s) { clipWdt = Width(source) / 2 clipHgh = Height(source) halo = a + s clipA = Crop(source, 0, 0, clipWdt + halo, clipHgh) clipB = Crop(source, clipWdt - halo, 0, clipWdt + halo, clipHgh) clipA = KNLMeansCL(clipA, d, a, s, device_id = 0) clipB = KNLMeansCL(clipB, d, a, s, device_id = 1) clipA = Crop(clipA, 0, 0, clipWdt, clipHgh) clipB = Crop(clipB, halo, 0, clipWdt, clipHgh) return StackHorizontal(clipA, clipB) }
__________________
github.com |
5th November 2017, 00:19 | #1213 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
I am getting AviSynthGetFrame errors any time I try to set d>0 or a>1 using AVISynth+ on WinXP Pro 32-bit.
Here is what avsmeter reports: Code:
E:\Documents\My Videos\AVISynth\AVISynth Plugins\plugins>avsmeter "E:\Documents\ My Videos\AVISynth\Scripts\KNL_Means Interlaced Denoising.avs" AVSMeter 2.4.7 (x86) - Copyright (c) 2012-2017, Groucho2004 AviSynth+ 0.1 (r2508, MT, i386) (0.1.0.0) KNLMeansCL: AviSynthGetFrame error! AVISynth+ seems to be better in almost every way, so I'd like to stick with it, if I can. I am using the non-GPU version of KNLMeans, although before I did that, I went to the Intel site and downloaded and installed the latest version of OpenCL and then used the most recent version of KNLMeansCL. Since I have an older GPU (GeForce 9800 GT), I don't think I can use the GPU, even with updated drivers. The problem I am reporting here is with KNLMeansCL-v0.6.11 (9/23/2015). I can get the plugin to work fine if I set d=0, but unfortunately, the denoising isn't very good without using adjacent fields. Here is the script I'm using: Code:
loadPlugin("E:\Documents\My Videos\AVISynth\AVISynth Plugins\plugins\KNLMeansCL.dll") #setmemorymax(1024) d_input=0 #number of past/future frames default=1; 0=1 frame; 1=3 frames a_input=1 #radius of search window; default=2; 0=1 pixel; 1=9 pixels s_input=4 #radius of similarity; default=4 h_input=15.0 #filter strength wmode_input=2 #weighting function (choose which one); default=0 source=AVISource("E:\fs.avi").KillAudio().requestlinear() #source=AVISource("E:\fs.avi").KillAudio() separatefields(source) even=selecteven() odd=selectodd() den_even=KNLMeansCL(even,d=d_input,a=a_input,s=s_input,h=h_input,wmode=wmode_input) del_odd=KNLMeansCL(odd,d=d_input,a=a_input,s=s_input,h=h_input,wmode=wmode_input) interleave(den_even,del_odd) output=weave() #output = KNLMeansCL(source,d=d_input,a=a_input,s=s_input,h=h_input) #return output #return source #stackhorizontal(source,output) #/* return Interleave( \ source \ , output \ ) #*/ # Enable MT! Prefetch(5) I've killed a lot of time on this, and am just going to have to use a lesser denoiser (MDegrain2) so I can finish the project. However, when I use the settings I want with KNLMeansCL, I can get a few dozen frames done before it crashes, and those are absolutely spectacular. Really good stuff. It feels like a memory issue because it seems to fail at earlier or later frames, depending on what SetMemoryMax values I use. It is as though some data area is filling up. Just as I was getting ready to post this, I ran it again, and my computer completely locked up and froze, like the old DOS days of the 1980s. I've had this computer for seven years, and I don't think it ever locked up like that. There is definitely something squirrely (technical term) going on under the covers. Any hints or ideas would be greatly appreciated. Last edited by johnmeyer; 5th November 2017 at 00:24. Reason: added info about using bob instead of separatefields() |
5th November 2017, 09:48 | #1215 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
@John
First of all, your card does support OpenCL 1.1 which works with KNLMeansCL 0.6.11. As for drivers, all you need is the latest Nvidia driver that works for your card (340.52). No Intel driver required. It's most likely a memory issue. Your 9800 probably doesn't have enough memory for 2 KNLMeansCL calls and running this in 5 threads. Reduce the number of threads or run KNLMeansCL single-threaded (add "SetFilterMTMode("knlmeanscl", MT_SERIALIZED)" at the beginning of your script). You can monitor GPU memory usage by running AVSMeter with the "-gpu" switch. GPU-Z must be running in this case.
__________________
Groucho's Avisynth Stuff Last edited by Groucho2004; 5th November 2017 at 10:38. |
5th November 2017, 17:02 | #1216 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
Groucho,
Many thanks! I'll do everything you recommended and report back. I actually don't know what driver version I'm running. I'm running AVISynth+ at this point, so I don't know if SetFilterMTMode will do the same thing in that environment. With AVISynth "SetMTMode" isn't used. |
5th November 2017, 17:08 | #1217 | Link |
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,781
|
Groucho2004 already mentioned SetFilterMTMode because it is an AviSynth+ feature. You can control the parallelizability per AviSynth filter function automatically for every occurence. Legacy AviSynth MT does not support that globally, you would have to switch the MT mode before and after such restricted functions.
|
5th November 2017, 19:37 | #1218 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
Thanks for the help but it looks like I'll have to try another avenue. I tried to install the 340.52 driver and it wouldn't install (I got an error message from the nVidia installer that it could not install). I did a little research and found that this is a common problem, so I manually installed the driver. Unfortunately I ended up with a 4-bit 640x480 display using the generic Windows driver. So I backed out of that, and as I was waiting for System Restore to complete I remembered that I'd been through this loop before a few years ago and that's why I'm stuck with the 258.96 drivers.
Also, I did try adding the SetFilterMTMode("knlmeanscl", MT_SERIALIZED) line to the beginning of the script, but it did not change the crash behavior at all. So, since this a dual boot computer, I'll use this as an excuse to install AVISynth+ on my Windows 7 Pro 64-bit installation, and see if I get any better results there. Thanks again for the help. |
5th November 2017, 20:05 | #1220 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
I'm working on the Win7 64-bit boot drive, using the same computer. At the moment I'm using AVISynth 2.60 (2/20/2015) because that's what was already installed. I am using the script without any multi-threading (on this older version of AVISynth, all I have to do is omit the SetMTMode statements).
I've found a few interesting bugs, although since these are with the older legacy KNLMeansCL, it probably doesn't make sense to waste people's time describing them. The short version is that with wmode_input set to default ("0"), even if you set the denoiser strength to 0.01, and set "d" and "a" to zero, it still does all sorts of filtering. It still crashes in the exact same manner as under Win XP 32-bit, and I still am not able to load any of the modern KNLMeansCL versions. I'll keep working through this. |
Thread Tools | Search this Thread |
Display Modes | |
|
|