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 > VapourSynth

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 5th April 2020, 11:00   #521  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,564
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:
PHP Code:
function Comptest(clip cfloat percent)
{
  
frange floor(14./(percent/100.))
  return 
SelectRangeEvery(cfrange14)

__________________
@turment on Telegram
tormento is offline  
Old 5th April 2020, 11:11   #522  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,554
Quote:
Originally Posted by tormento View Post
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:
PHP Code:
function Comptest(clip cfloat percent)
{
  
frange floor(14./(percent/100.))
  return 
SelectRangeEvery(cfrange14)

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:
Code:
import math

def comptest(clip, percent)
  frange = math.floor(1400/percent)
  return clip.std.SelectEvery(cycle=frange, offsets=list(range(0, 14)))
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 5th April 2020 at 11:14.
Myrsloik is online now  
Old 5th April 2020, 11:14   #523  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,564
Quote:
Originally Posted by Myrsloik View Post
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?
__________________
@turment on Telegram
tormento is offline  
Old 5th April 2020, 11:20   #524  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,554
Quote:
Originally Posted by tormento View Post
Thanks for your reply.

But what version do I need to run HAVSFunc?
Normal
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now  
Old 5th April 2020, 11:25   #525  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,564
Quote:
Originally Posted by Myrsloik View Post
Normal
As you are so kind, how would you translate this AVS script into VS script?
PHP Code:
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=4thSAD=500refinemotion=falsen16=truemode=0contrasharp=falsePreFilter=4truemotion=falseplane=4chroma=true)
Prefetch(6
__________________
@turment on Telegram
tormento is offline  
Old 5th April 2020, 12:55   #526  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Code:
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.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database

Last edited by ChaosKing; 5th April 2020 at 13:02.
ChaosKing is offline  
Old 5th April 2020, 14:23   #527  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,564
Quote:
Originally Posted by ChaosKing View Post
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.

Code:
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.
Quote:
Originally Posted by feisty2 View Post
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?
Quote:
Originally Posted by ChaosKing View Post
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.
__________________
@turment on Telegram

Last edited by tormento; 5th April 2020 at 14:29.
tormento is offline  
Old 5th April 2020, 14:37   #528  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
You can use a different smdegrain version instead, it supports tr > 3: https://github.com/Selur/Vapoursynth...ster/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:
Code:
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/pytho...re.num_threads
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database

Last edited by ChaosKing; 5th April 2020 at 14:40.
ChaosKing is offline  
Old 5th April 2020, 14:46   #529  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,564
Quote:
Originally Posted by ChaosKing View Post
that means you must filter it in 32 float precision.
Thanks, man!

And how will I dither back to 8 bit?
__________________
@turment on Telegram
tormento is offline  
Old 5th April 2020, 14:55   #530  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Quote:
Originally Posted by tormento View Post
Thanks, man!

And how will I dither back to 8 bit?
clip = mvf.Depth(clip, 8)
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline  
Old 5th April 2020, 16:03   #531  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,564
Quote:
Originally Posted by ChaosKing View Post
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.S: I tried to use the other function with tr=4 and VS crashed miserably. Is there anything wrong?

PHP Code:
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(clip32# this before smdegrain

clip G41.SMDegrain(cliptr=4thSAD=500prefilter=4)

clip mvf.Depth(clip8)

clip.set_output() 
__________________
@turment on Telegram

Last edited by tormento; 5th April 2020 at 16:15.
tormento is offline  
Old 5th April 2020, 17:22   #532  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
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
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline  
Old 5th April 2020, 19:21   #533  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,564
Quote:
Originally Posted by ChaosKing View Post
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?
__________________
@turment on Telegram
tormento is offline  
Old 5th April 2020, 20:10   #534  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
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.p...82#post1823382
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline  
Old 6th April 2020, 09:25   #535  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,564
Quote:
Originally Posted by ChaosKing View Post
The Mvtools dll by feisty2 expects avx2 instruction set. Does you cpu support avx2?
Nope.

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.
__________________
@turment on Telegram

Last edited by tormento; 6th April 2020 at 09:37.
tormento is offline  
Old 6th April 2020, 10:48   #536  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Quote:
Originally Posted by tormento View Post
Nope.

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
Code:
def comptest(clip, percent):
	frange = math.floor(1400/percent)
	return clip.std.SelectEvery(cycle=frange, offsets=list(range(0, 14))).std.AssumeFPS(clip)
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline  
Old 6th April 2020, 10:55   #537  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,564
Quote:
Originally Posted by ChaosKing View Post
The comptest output is the same except for the fps
This should use the original video fps
Code:
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...
__________________
@turment on Telegram
tormento is offline  
Old 7th April 2020, 15:55   #538  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,729
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.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline  
Old 8th April 2020, 10:55   #539  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,564
Quote:
Originally Posted by Boulder View Post
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.
__________________
@turment on Telegram
tormento is offline  
Old 8th April 2020, 11:16   #540  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
Quote:
Originally Posted by tormento View Post
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.....
Sharc is offline  
Closed Thread

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 19:26.


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