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 Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 9th May 2024, 18:51   #2941  |  Link
LouieChuckyMerry
Registered User
 
LouieChuckyMerry's Avatar
 
Join Date: Feb 2014
Posts: 373
Quote:
Originally Posted by Boulder View Post
That would most likely be enough. You can doublecheck the output video format by adding Info() after the SMDegrain line and opening the script in VDub for example.
Thanks for your reply. It does seem to be enough; unfortunately, adding Info() after the SMDegrain line doesn't show any info upon opening the script in MeGUI or VirtualDub2 .

EDIT: Adding Info() after the SMDegrain line works on my second computer and shows that it's processing in 16bits. Thanks for the new trick.

Quote:
Originally Posted by StvG View Post
F3KDB doesn't support native 16-bit (only stacked, interleaved). Repalce it with neo_f3kdb.
Good catch, StvG . That explains quite a bit...

Lucky38: Sorry for the confusion.

Last edited by LouieChuckyMerry; 12th May 2024 at 16:07. Reason: Information, Information
LouieChuckyMerry is offline   Reply With Quote
Old 9th May 2024, 22:47   #2942  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,170
Some idea about different prefilters usage (including no-prefiter): At testing QTGMC it was found single prefilter mode can not make all areas better in details. With prefilter-ON some areas get better and others not. With prefilter-OFF it is changed. So I make some function to gather most possible details from several filter runs. With deinterlace processing of QTGMC it also collect most of noise from different filter runs also. But it may be tested with SMDegrain too with different prefilters at single processing. The function GetSharpest() included into M_QTGMC listed at https://forum.doom9.org/showthread.p...88#post2001388 and it uses new plugin MostDiffVal.dll to run. Though I think maybe it can be implemented with all internals of AVS like Layer() instead of Average and Expr() instead of MostDiffVal().

So to run SMDegrain with a set of prefilters (any set may be combined in a chain of GetSharpest(clip1, clip2):

Code:
pref1=SMDegrain(prefilter=0)
pref2=SMDegrain(prefilter=1)

GetSharpest(pref1, pref2)
where GetSharpest() is
Code:
Function GetSharpest(clip c1, clip c2)
{
  avg=Average(c1.GaussResize(c1.width, c1.height, src_left=0.001, src_top=0.001, p=2), 0.5, c2.GaussResize(c2.width, c2.height, src_left=0.001, src_top=0.001, p=2), 0.5)

  return MostDiffVal(avg, c1, c2)
}
DTL is offline   Reply With Quote
Old 9th May 2024, 23:51   #2943  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 1,008
Quote:
Originally Posted by DTL View Post
Some idea about different prefilters usage (including no-prefiter): At testing QTGMC it was found single prefilter mode can not make all areas better in details. With prefilter-ON some areas get better and others not. With prefilter-OFF it is changed. So I make some function to gather most possible details from several filter runs. With deinterlace processing of QTGMC it also collect most of noise from different filter runs also. But it may be tested with SMDegrain too with different prefilters at single processing. The function GetSharpest() included into M_QTGMC listed at https://forum.doom9.org/showthread.p...88#post2001388 and it uses new plugin MostDiffVal.dll to run. Though I think maybe it can be implemented with all internals of AVS like Layer() instead of Average and Expr() instead of MostDiffVal().

So to run SMDegrain with a set of prefilters (any set may be combined in a chain of GetSharpest(clip1, clip2):

Code:
pref1=SMDegrain(prefilter=0)
pref2=SMDegrain(prefilter=1)

GetSharpest(pref1, pref2)
where GetSharpest() is
Code:
Function GetSharpest(clip c1, clip c2)
{
  avg=Average(c1.GaussResize(c1.width, c1.height, src_left=0.001, src_top=0.001, p=2), 0.5, c2.GaussResize(c2.width, c2.height, src_left=0.001, src_top=0.001, p=2), 0.5)

  return MostDiffVal(avg, c1, c2)
}
Why isn't it working as expected? It always shows 'c2'
Code:
c1=Sharpen(0.80).subtitle("c1")
c2=Sharpen(0.10).subtitle("c2")
GetSharpest(c1, c2)
Edit: The sharper one is returned, but not the subtitle. This confuses me, please clarify.

Edit2: Oh, a combination of both clips will probably be returned. When I use 'a' and 'f' as a subtitle I see that 'a' and 'f' are overlaid.
__________________
Live and let live

Last edited by gispos; 10th May 2024 at 00:38.
gispos is offline   Reply With Quote
Old 10th May 2024, 11:33   #2944  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,170
It works on sample-level granularity from both input clips. So Subtitle text will be mixed (and typically not very well processed as extreme 0 and max values). Better results on natural narrow/limited range.

For test you need to mask-sharpen c1 clip at one area and mask-sharpen c2 clip at different area and process to see if returned both sharpened areas from c1 and c2.

More sad thing about MAnalyse/MDegrain/MCompensate is with different areas grouped MVs errors it also cause different areas global shift (not only fine sharpness lost) so the GetSharpest() will also somehow mix these areas. And with different pre-filters these grouped MVs areas errors also different.

I typically check it as

Code:
c1=Process(params1).Subtitle("params1")
c2=Process(params2).Subtitle("params2", align=..some2, not default and not 4)

sh=GetSharpest(c1, c2).Subtitle("gs", align=4)

Interleave(c1, sh, c2)
And check different areas looking in c1 vs sh and c2 vs sh with frame step in VirtualDub.

Last edited by DTL; 10th May 2024 at 11:57.
DTL is offline   Reply With Quote
Old 11th May 2024, 10:26   #2945  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,170
Finally made replacement of all functions with AVS internal Expr() and ex_Tools for GetSharpest():

Code:
Function GetSharpest(clip c1, clip c2)
{
  avg=Layer(c1.ex_GaussianBlur(1.8, UV=3), c2.ex_GaussianBlur(1.8, UV=3), "fast")

  return Expr(avg, c1, c2, "x y - abs x z - abs >= y z ?")

#or some faster 
#return MostDiffVal(avg, c1, c2)
}
The sigma param for GaussianBlur is subject to check for best results (or best for current user/footage/filters/ etc). Currently 1.8 is about equal to GaussResize(p=2) blur. Also compiled plugin MostDiffVal updated to v0.2 with AVX2 functions and opt SIMD manual control (optional or auto). With 8bit it runs about 2 times faster in comparison with Expr() - looks like because Expr() perform internal calculations with float32 and have penalty of convert from integer to float and back.

ex_GaussianBlur() runs about 1.5 times faster in comparison with GaussResize() for blurring. Also Layer("fast") is somehow faster in comparison with Average(0.5,0.5).

About twice faster with not yet tested quality change is single blur of averaged input clips:
Code:
Function GetSharpest(clip c1, clip c2)
{
  avg=ex_GaussianBlur(Layer(c1, c2, "fast"),1.8, UV=3)

  return Expr(avg, c1, c2, "x y - abs x z - abs >= y z ?")

#or some faster 
#return MostDiffVal(avg, c1, c2)
}
Edit: With full chroma planes processing (UV=3 for ex_GaussianBlur) the GaussResize still some faster (looks like integer 2 pass V+H AVS resize kernel is faster, at least for not very large radius blur):

Code:
Function GetSharpest(clip c1, clip c2)
{
  avg=GaussResize(Layer(c1, c2, "fast"), c1.width, c1.height, src_left=0.001, src_top=0.001, p=2)

  return Expr(avg, c1, c2, "x y - abs x z - abs >= y z ?")

#or some faster 
#return MostDiffVal(avg, c1, c2)
}

Last edited by DTL; 11th May 2024 at 11:08.
DTL is offline   Reply With Quote
Old 18th May 2024, 20:32   #2946  |  Link
LouieChuckyMerry
Registered User
 
LouieChuckyMerry's Avatar
 
Join Date: Feb 2014
Posts: 373
I very recently transitioned from real.finder's last version of NotSMDegrain (3.1.2.116s) to Dogway's most recent version of SMDegrain (4.6.0d), running on Windows 7 with 64-bit AviSynth+ 3.73. It seems to work fine, but I'm trying to understand why the speed is basically the same (within ~5%) but the resulting video bitrate is radically different (roughly a full CRF). To wit, the scripts

Code:
SetFilterMTMode("Default_MT_Mode",2)
SMDegrain(TR=4,ThSAD=700,RefineMotion=True,Plane=0,Chroma=False,n16=True,n16_Out=True)
FastLineDarkenMod4()
F3KDB(Y=100,Cb=100,Cr=100,GrainY=0,GrainC=0)
SelectRangeEvery(1000,66)
PreFetch(5)
and

Code:
SetFilterMTMode("Default_MT_Mode",2)
SMDegrain(Prefilter=SpotLess(),TR=3,ThSAD=500,RefineMotion=True,Plane=0,Chroma=False,n16=True,n16_Out=True)
FastLineDarkenMod4()
F3KDB(Y=100,Cb=100,Cr=100,GrainY=0,GrainC=0)
SelectRangeEvery(1000,66)
PreFetch(5)
with the filters-plugins

Quote:
F3KDB__64bit
FastLineDarkenMTMod1_48
LinearTransformation
MaskTools2_2_26_0MTDualSignatureMod_pinterf__64bit
MedianBlur2__1_1__64bit
MVTools2_7_41_0MTMod_pinterf__64bit
SharedFunctions1_153
SMDegrainMod_rf_3_1_2_116s
SpotLess1_07
results in bitrates of 3471 kb/s and 4209 kb/s, respectively, while the scripts

Code:
SetFilterMTMode("Default_MT_Mode",2)
ConvertBits(Bits=16)
SMDegrain(TR=4,ThSAD=700,RefineMotion=True,Plane=0,Chroma=False)
FastLineDarkenPlus()
Neo_F3KDB(Y=100,Cb=100,Cr=100,GrainY=0,GrainC=0)
SelectRangeEvery(1000,66)
PreFetch(5)
and

Code:
SetFilterMTMode("Default_MT_Mode",2)
ConvertBits(Bits=16)
SMDegrain(Prefilter=SpotLess(),TR=3,ThSAD=500,RefineMotion=True,Plane=0,Chroma=False)
FastLineDarkenPlus()
Neo_F3KDB(Y=100,Cb=100,Cr=100,GrainY=0,GrainC=0)
SelectRangeEvery(1000,66)
PreFetch(5)
with the filters-plugins

Quote:
ExTools10_1
FastLineDarkenPlus
LinearTransformation
MaskTools2_2_30_0MTDualSignatureMod_pinterf__64bit
MedianBlur2__1_1__64bit
MVTools2_7_46_0MTMod_pinterf__64bit
Neo_F3KDB9_0__64bit
SMDegrain4_6_0d
SpotLess1_07
results in bitrates of 4165 kb/s and 5173 kb/s, respectively. The sources are the same. Any help understanding why the bitrates are so different would be greatly appreciated.
LouieChuckyMerry is offline   Reply With Quote
Old 18th May 2024, 21:21   #2947  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,599
Less entropy, less changing high frequency details, and encoder can save bits.
It may not be visible at first, only pixel-peeping and framestepping will tell what those plugins were able to smoothe.
To go through all plugin's parameter's dependencies would make up a matrix which one should like to solve on his side.
From my side of experience I can tell that Dogway's algos give nice details which got to be honoured by bits...
and of course... many thanks, at least from my side.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 19th May 2024, 05:03   #2948  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,160
You can try with High bit depths to see more clearly about speed
kedautinh12 is offline   Reply With Quote
Old 21st May 2024, 15:43   #2949  |  Link
LouieChuckyMerry
Registered User
 
LouieChuckyMerry's Avatar
 
Join Date: Feb 2014
Posts: 373
Quote:
Originally Posted by Emulgator View Post
Less entropy, less changing high frequency details, and encoder can save bits.
It may not be visible at first, only pixel-peeping and framestepping will tell what those plugins were able to smoothe.
To go through all plugin's parameter's dependencies would make up a matrix which one should like to solve on his side.
From my side of experience I can tell that Dogway's algos give nice details which got to be honoured by bits...
and of course... many thanks, at least from my side.

Thank you for a very philosophical answer . And I also appreciate Dogway's work very much.


Quote:
Originally Posted by kedautinh12 View Post
You can try with High bit depths to see more clearly about speed
Please, I don't understand what you mean.
LouieChuckyMerry is offline   Reply With Quote
Old 22nd May 2024, 05:49   #2950  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,160
Lol, please search google about High bit depths video and try add converttobit(16) or converttobit(32) and compare both of them again. SMDegrain build by Dogway for speed with High bit depths video not for 8 bit video only
kedautinh12 is offline   Reply With Quote
Old 24th May 2024, 05:18   #2951  |  Link
FTLOY
Friend of a friend..
 
FTLOY's Avatar
 
Join Date: Feb 2023
Posts: 290
Quote:
Originally Posted by kedautinh12 View Post
Lol, please search google about High bit depths video and try add converttobit(16) or converttobit(32) and compare both of them again. SMDegrain build by Dogway for speed with High bit depths video not for 8 bit video only
I thought it was ConvertBits(16)....

http://avisynth.nl/index.php/ConvertBits
__________________
RipBot264 v1.27.3 (08-06-2024)
FTLOY is offline   Reply With Quote
Old 24th May 2024, 11:11   #2952  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,599
BTW, LouieChuckyMerry,
Quote:
SMDegrain(Prefilter=SpotLess(),TR=3,ThSAD=500,RefineMotion=True,Plane=0,Chroma=False)
does not work, throws an error.
Prefilter=SpotLess() is not implemented this way within SMDegrain 4.6.0d
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 24th May 2024, 16:07   #2953  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,170
You may need to add SpotLess() function body to the script before call it or Import() .avsi file with this script function body.

Function SpotLess() is from https://forum.doom9.org/showthread.php?t=181777 .
DTL is offline   Reply With Quote
Old 25th May 2024, 18:21   #2954  |  Link
LouieChuckyMerry
Registered User
 
LouieChuckyMerry's Avatar
 
Join Date: Feb 2014
Posts: 373
Quote:
Originally Posted by kedautinh12 View Post
Lol, please search google about High bit depths video and try add converttobit(16) or converttobit(32) and compare both of them again. SMDegrain build by Dogway for speed with High bit depths video not for 8 bit video only

I'm working in 16-bit (see Post #2946), but will give 32-bit a try. Thanks.


Quote:
Originally Posted by FTLOY View Post
I thought it was ConvertBits(16)....

http://avisynth.nl/index.php/ConvertBits

Code:
ConvertBits(Bits=16)
The above works for me.


Quote:
Originally Posted by Emulgator View Post
BTW, LouieChuckyMerry,

does not work, throws an error.
Prefilter=SpotLess() is not implemented this way within SMDegrain 4.6.0d
It seems to work fine for me...
LouieChuckyMerry is offline   Reply With Quote
Old 29th May 2024, 08:16   #2955  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,599
I see now. This argument takes a clip too, (this is possible, I found it in an old script being (last), and I was expecting an integer argument).
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."

Last edited by Emulgator; 4th June 2024 at 10:45.
Emulgator is offline   Reply With Quote
Old 2nd June 2024, 17:44   #2956  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,616
I have always used PureVideo deinterlacer for IVTC from 29.97 to 23.974 by using

DGTelecide(mode=1, pthresh=3.5)
DGDecimate()


but I'd like to try something better.

What do you suggest me from your scripts without incurring in miserable performances?

I have a very old i7-2600k and a nVidia 1660 SUPER gpu and remember that I have to encode it too.

(I was looking at RIFE but I fear it's too heavy, mostly because of double RGB32 and back conversion and, above all, I have no idea if it's suitable for IVTC too)
__________________
@turment on Telegram

Last edited by tormento; 2nd June 2024 at 17:46.
tormento is offline   Reply With Quote
Old 4th June 2024, 17:08   #2957  |  Link
rgr
Registered User
 
Join Date: Jun 2022
Posts: 62
Quote:
Originally Posted by DTL View Post
it uses new plugin MostDiffVal.dll to run
Where can I download this plugin?
rgr is offline   Reply With Quote
Old 4th June 2024, 20:06   #2958  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,170
Latest version is https://github.com/DTL2020/MostDiffVal/releases/tag/0.2 .

But it can be replaced with Expr() call
Code:
 Expr(avg, c1, c2, "x y - abs x z - abs >= y z ?")
It is slower with 8bit and may be 16bit because Expr() process always with float internally. But Expr() always available as AVS core function.
DTL is offline   Reply With Quote
Old 5th June 2024, 02:46   #2959  |  Link
FTLOY
Friend of a friend..
 
FTLOY's Avatar
 
Join Date: Feb 2023
Posts: 290
I'm looking for a simple script for adding a small transparent "watermark" image to a video clip. (eg:- like Netflix)
__________________
RipBot264 v1.27.3 (08-06-2024)
FTLOY is offline   Reply With Quote
Old 5th June 2024, 09:42   #2960  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,170
Try to load your image with alpha channel and use Overlay() - http://avisynth.nl/index.php/Overlay . If fixed opacity is enough - you can load RGB image without alpha channel and control with
float opacity = 1.0
Set overlay transparency. The value is from 0.0 to 1.0, where 0.0 is transparent and 1.0 is fully opaque. This value is multiplied by mask luminance to form the final opacity.

Or you can load grey mask as separate image too.
DTL is offline   Reply With Quote
Reply

Tags
avisynth, dogway, filters, hbd, packs

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 04:04.


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