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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 30th January 2018, 22:00   #1321  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 432
Quote:
Originally Posted by Atak_Snajpera View Post
What does this mean?


Code:
video=ConvertToYUV444(video).KNLMeansCL(d=1, a=2, s=4, h=4, device_type="CPU", device_id=0).ConvertToYUV420
add channels="YUV"
__________________
github.com
Khanattila is offline   Reply With Quote
Old 30th January 2018, 22:15   #1322  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 6,673

Code:
video=ConvertToYUV444(video).KNLMeansCL(d=1, a=2, s=4, h=4, device_type="CPU", device_id=0,channels="YUV").ConvertToYUV420
Why CPU device does not support this mode?
Atak_Snajpera is online now   Reply With Quote
Old 30th January 2018, 23:04   #1323  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 432
Quote:
Originally Posted by Atak_Snajpera View Post

Code:
video=ConvertToYUV444(video).KNLMeansCL(d=1, a=2, s=4, h=4, device_type="CPU", device_id=0,channels="YUV").ConvertToYUV420
Why CPU device does not support this mode?
Implementation-defined, however, it is difficult for the CPUs to support that mode.

The program is GPU oriented, and GPU work well with INT8, INT16, INT32, HALF and FLOAT.
So it makes sense not to support intermediate precision like INT9, INT12 or INT14.
However, there is a special format INT_101010, where the channels of each element (10 bits per channel) are packed into a single INT32.
Unfortunately, it is not very supported.
__________________
github.com

Last edited by Khanattila; 31st January 2018 at 09:23.
Khanattila is offline   Reply With Quote
Old 31st January 2018, 12:35   #1324  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 6,673
Ok. No problem. I was just curious...
Atak_Snajpera is online now   Reply With Quote
Old 2nd February 2018, 10:51   #1325  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 432
Quote:
Originally Posted by Atak_Snajpera View Post
Ok. No problem. I was just curious...
You are welcome
__________________
github.com
Khanattila is offline   Reply With Quote
Old 12th February 2018, 15:41   #1326  |  Link
littlepox
Registered User
 
Join Date: Nov 2012
Posts: 216
Hi all, need some help with KNLMeansCL on AMD RX Vega64:

denoised Y clip comes with broken data (mostly zero, very few times random output). This is a known issue (https://github.com/Khanattila/KNLMeansCL/issues/26) and we will await the patch.

Meanwhile, we would like to know whether using RGB is a safe workaround or not(assume we don't want to touch UV planes) :

Code:
a = "your file with YUV-8bit format.m2ts"
src8 = core.lsmas.LWLibavSource(a,threads=1)
src16 = core.fmtc.bitdepth(src8, bits=16)

Y = core.std.ShufflePlanes(src16, 0, vs.GRAY)
nr16y = core.resize.Bicubic(Y, format=vs.RGB48,matrix_in_s="709")
nr16y = core.knlm.KNLMeansCL(nr16y, d=1, a=2, s=3, h=1.3, channels="RGB", device_type="GPU")
nr16y = core.resize.Bicubic(nr16y, format=vs.GRAY16,matrix_s="709")

nr16y.set_output()
It looks OK for a few samples but we would like to know whether it is indeed unaffected by the same issue. Thanks for help!
littlepox is offline   Reply With Quote
Old 12th February 2018, 16:38   #1327  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 432
Quote:
Originally Posted by littlepox View Post
Hi all, need some help with KNLMeansCL on AMD RX Vega64:

denoised Y clip comes with broken data (mostly zero, very few times random output). This is a known issue (https://github.com/Khanattila/KNLMeansCL/issues/26) and we will await the patch.

Meanwhile, we would like to know whether using RGB is a safe workaround or not(assume we don't want to touch UV planes) :

Code:
a = "your file with YUV-8bit format.m2ts"
src8 = core.lsmas.LWLibavSource(a,threads=1)
src16 = core.fmtc.bitdepth(src8, bits=16)

Y = core.std.ShufflePlanes(src16, 0, vs.GRAY)
nr16y = core.resize.Bicubic(Y, format=vs.RGB48,matrix_in_s="709")
nr16y = core.knlm.KNLMeansCL(nr16y, d=1, a=2, s=3, h=1.3, channels="RGB", device_type="GPU")
nr16y = core.resize.Bicubic(nr16y, format=vs.GRAY16,matrix_s="709")

nr16y.set_output()
It looks OK for a few samples but we would like to know whether it is indeed unaffected by the same issue. Thanks for help!
Hi littlepox, thanks for your report.
The main problem is I do not have a Vega GPU. In the country where I live the cost is very high, over 800€!
I also tried AMD's CodeXL, but for now, I do not see something strange. Future investigations are required.

I do not know if the workaround you suggest works or not, there is a problem with the new AMD OpenCL compiler for Vega.
There are probably some optimizations in place that are not clear.
__________________
github.com

Last edited by Khanattila; 12th February 2018 at 16:42.
Khanattila is offline   Reply With Quote
Old 25th February 2018, 12:14   #1328  |  Link
fadedmaple
Registered User
 
fadedmaple's Avatar
 
Join Date: Dec 2017
Posts: 7
GPU use ratio is Low

Hi,i`m use KNLMeansCL in vapoursynth with GTX1060 .
The system is Win10 and driver 390.77.
I found the GPU performance can not be fully realized.

the vpy script like this

src = core.lsmas.LWLibavSource(r'E:\OB\MEET_THE_FOCKERS_HDCLUB\BDMV\STREAM\00372.m2ts')
src = core.knlm.KNLMeansCL(src,d = 3,a = 6, h = 1.2,channels="Y",device_type = "gpu" )
src = core.knlm.KNLMeansCL(src,d = 3,a = 6, h = 1.2,channels="UV",device_type = "gpu" )

Only 0.3 fps ,And take up 10%-30% GPU usage。
Is it unable to run out of GPU or is it my own problem?
fadedmaple is offline   Reply With Quote
Old 25th February 2018, 15:56   #1329  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 432
Quote:
Originally Posted by fadedmaple View Post
Hi,i`m use KNLMeansCL in vapoursynth with GTX1060 .
The system is Win10 and driver 390.77.
I found the GPU performance can not be fully realized.

the vpy script like this

src = core.lsmas.LWLibavSource(r'E:\OB\MEET_THE_FOCKERS_HDCLUB\BDMV\STREAM\00372.m2ts')
src = core.knlm.KNLMeansCL(src,d = 3,a = 6, h = 1.2,channels="Y",device_type = "gpu" )
src = core.knlm.KNLMeansCL(src,d = 3,a = 6, h = 1.2,channels="UV",device_type = "gpu" )

Only 0.3 fps ,And take up 10%-30% GPU usage。
Is it unable to run out of GPU or is it my own problem?
Hi fadedmaple, can you post the whole script?
The situation you describe is typical of a CPU-bottleneck.
__________________
github.com
Khanattila is offline   Reply With Quote
Old 25th February 2018, 16:57   #1330  |  Link
fadedmaple
Registered User
 
fadedmaple's Avatar
 
Join Date: Dec 2017
Posts: 7
Quote:
Originally Posted by Khanattila View Post
Hi fadedmaple, can you post the whole script?
The situation you describe is typical of a CPU-bottleneck.
here the whole script ,nothing special

Code:
from vapoursynth import core
import vapoursynth as vs

src = core.lsmas.LWLibavSource(r'E:\OB\MEET_THE_FOCKERS_HDCLUB\BDMV\STREAM\00372.m2ts')

src = core.knlm.KNLMeansCL(src,d = 3,a = 6, h = 1.2,channels="Y",device_type = "gpu" )
src = core.knlm.KNLMeansCL(src,d = 3,a = 6, h = 1.2,channels="UV",device_type = "gpu" )

src.set_output()
If i set the parametes as default (d = 1,a = 2),the x265 get a faster speed,even faster than no denoise.
So I think it really is using my GPU.

I use vseditor to benchmark ,when set d=3 a=6 ,CPU usage is very low,why CPU-bottleneck?

Last edited by fadedmaple; 25th February 2018 at 17:24.
fadedmaple is offline   Reply With Quote
Old 25th February 2018, 17:52   #1331  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 432
I never used vseditor, but I suspect it could slow things down.

RX 480 8GB (1330MHz / 2000MHz) ~1,29 FPS with 90-100% GPU Load.

script.vpy
Code:
import vapoursynth as vs
core = vs.get_core()

clip = core.lsmas.LWLibavSource("Sample.mkv", format="YUV420P8")
# 1920x1080 clip from a Blu-ray.

clip = core.knlm.KNLMeansCL(clip, d=3, a=6, channels="Y",  device_type = "GPU")
clip = core.knlm.KNLMeansCL(clip, d=3, a=6, channels="UV", device_type = "GPU")

clip.set_output()
launcher.bat
Code:
vspipe script.vpy NUL -p
PS. Furthermore, there is the possibility LWLibavSource has decoding problems in that particular situation.
You should use a blank clip rather:
Code:
core.std.BlankClip(width=1920, height=1080, format=vs.YUV420P8, length=1000)
__________________
github.com

Last edited by Khanattila; 25th February 2018 at 22:34.
Khanattila is offline   Reply With Quote
Old 26th February 2018, 07:47   #1332  |  Link
fadedmaple
Registered User
 
fadedmaple's Avatar
 
Join Date: Dec 2017
Posts: 7
Quote:
Originally Posted by Khanattila View Post
I never used vseditor, but I suspect it could slow things down.

RX 480 8GB (1330MHz / 2000MHz) ~1,29 FPS with 90-100% GPU Load.

script.vpy
Code:
import vapoursynth as vs
core = vs.get_core()

clip = core.lsmas.LWLibavSource("Sample.mkv", format="YUV420P8")
# 1920x1080 clip from a Blu-ray.

clip = core.knlm.KNLMeansCL(clip, d=3, a=6, channels="Y",  device_type = "GPU")
clip = core.knlm.KNLMeansCL(clip, d=3, a=6, channels="UV", device_type = "GPU")

clip.set_output()
launcher.bat
Code:
vspipe script.vpy NUL -p
PS. Furthermore, there is the possibility LWLibavSource has decoding problems in that particular situation.
You should use a blank clip rather:
Code:
core.std.BlankClip(width=1920, height=1080, format=vs.YUV420P8, length=1000)
Thanks for you explain and advise,i find a very strange thing.
I record a short video here https://youtu.be/yvW8pOkl2_I

I have use a BlankClip in the video,you can see the GPU load change after I close and reopen the chrome .

Last edited by fadedmaple; 26th February 2018 at 07:50.
fadedmaple is offline   Reply With Quote
Old 26th February 2018, 12:35   #1333  |  Link
HolyWu
Registered User
 
HolyWu's Avatar
 
Join Date: Aug 2006
Location: Taiwan
Posts: 500
Quote:
Originally Posted by fadedmaple View Post
Thanks for you explain and advise,i find a very strange thing.
I record a short video here https://youtu.be/yvW8pOkl2_I

I have use a BlankClip in the video,you can see the GPU load change after I close and reopen the chrome .
You should really use something like GPU-Z instead of Win10's task manager for measuring GPU Load.
HolyWu is offline   Reply With Quote
Old 26th February 2018, 13:48   #1334  |  Link
fadedmaple
Registered User
 
fadedmaple's Avatar
 
Join Date: Dec 2017
Posts: 7
Quote:
Originally Posted by HolyWu View Post
You should really use something like GPU-Z instead of Win10's task manager for measuring GPU Load.
A rookie mistake ...
It works well with 90-100% GPU Load.
fadedmaple is offline   Reply With Quote
Old 26th April 2018, 12:45   #1335  |  Link
tuanden0
Registered User
 
Join Date: Oct 2016
Posts: 86
Could you give me a link to download onpencl for AMD? I can't find it anywhere
tuanden0 is offline   Reply With Quote
Old 26th April 2018, 13:07   #1336  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 5,675
In general, a hardware accelerated OpenCL driver should be part of a current graphic card driver (not knowing AMD, but nVidia drivers do install OpenCL.dll and additional hardware specific DLL files in the system director{y/ies}).
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 26th April 2018, 13:49   #1337  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 6,673
Quote:
Originally Posted by tuanden0 View Post
Could you give me a link to download onpencl for AMD? I can't find it anywhere
OpenCL is a part of AMD GPU driver.
Atak_Snajpera is online now   Reply With Quote
Old 26th April 2018, 15:25   #1338  |  Link
tuanden0
Registered User
 
Join Date: Oct 2016
Posts: 86
Quote:
Originally Posted by Atak_Snajpera View Post
OpenCL is a part of AMD GPU driver.
thank you, I installed
tuanden0 is offline   Reply With Quote
Old 17th November 2018, 11:15   #1339  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 989
@Khanattila what about trying to create a FFT3DCL filter?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 21st November 2018, 09:54   #1340  |  Link
Arhu
Registered User
 
Join Date: Nov 2003
Posts: 9
I'm seeing some weird frame order issues that appear to be happening with KNLMeansCL for me. I'm not sure for how long it has been happening because I only noticed recently with some UHD encodes. It may go back a few months.

1. Without KNLMeansCL frames seem to be fine in the output.
2. With d=0 and some values vor s, a and h sometimes a frame is skipped and later on another frame is repeated.
3. With d>0 and particularly with some UHD sources I occasionally but repeatedly get jumbled frames. E.g. for frames 1, 2, 3, 4, 5, 6 I'd get 1, 2, 3, 2, 5, 6 or something like that.

I didn't have time for more tests yet, but wanted to ask if this is a known problem or if anyone knows why this could be happening? Maybe something with the GPU or some buffer? I'm using a Geforce 1060, currently updating drivers.

Here's a sample script from staxrip:

Code:
import os
import sys
ScriptPath = 'D:/stax/staxrip/Apps/Plugins/VS/Scripts'
sys.path.append(os.path.abspath(ScriptPath))
import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin(r"D:\stax\staxrip\Apps\Plugins\both\ffms2\ffms2.dll")
core.std.LoadPlugin(r"D:\stax\staxrip\Apps\Plugins\vs\fmtconv\fmtconv.dll")
core.std.LoadPlugin(r"D:\stax\staxrip\Apps\Plugins\both\KNLMeansCL\KNLMeansCL.dll")
clip = core.ffms2.Source(r"D:\clip.mkv", cachefile = r"D:\clip_temp\clip.ffindex")
clip = core.fmtc.bitdepth(clip, bits=16)
clip = core.knlm.KNLMeansCL(clip, d = 2, s = 4, a = 4, h = 0.5)
clip.set_output()

Last edited by Arhu; 21st November 2018 at 10:30.
Arhu is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:43.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.