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

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 14th February 2014, 12:56   #621  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by ryrynz View Post
That's it. Wow. Avs+ did in 3 seconds what 2.6MT took 30 seconds to do..
Can audiodub be made mtmode 2 compatible?
Wut? Tbh that looks too good to be true. All frames delivered with correct output?
__________________
AviSynth+
ultim is offline  
Old 14th February 2014, 13:01   #622  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,054
Quote:
Originally Posted by ultim View Post
Wut?
That's what I thought, too. I'd like to see the log.
Groucho2004 is offline  
Old 14th February 2014, 20:19   #623  |  Link
ryrynz
Registered User
 
ryrynz's Avatar
 
Join Date: Mar 2009
Posts: 3,417
Actually forgot to edit the script back to it's original state.. it finished in 10 seconds.

http://codepaste.net/krm7oy

Last edited by ryrynz; 14th February 2014 at 20:23.
ryrynz is offline  
Old 14th February 2014, 22:45   #624  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,054
Quote:
Originally Posted by ryrynz View Post
Actually forgot to edit the script back to it's original state.. it finished in 10 seconds.

http://codepaste.net/krm7oy
So, you get 160 fps with AVS+ compared to 50 fps with SEt's MT Avisynth? And a fraction of the memory usage? Very nice.
Groucho2004 is offline  
Old 15th February 2014, 01:35   #625  |  Link
Seedmanc
Registered User
 
Join Date: Sep 2010
Location: Russia
Posts: 85
Neither AvsPmod nor AVSmeter seem to work with AVS+ for me, both just hang up whenever I try to open a script, even a simple "version()" call. Have to use Virtualdub again.
Seedmanc is offline  
Old 15th February 2014, 02:29   #626  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,054
Quote:
Originally Posted by Seedmanc View Post
Neither AvsPmod nor AVSmeter seem to work with AVS+ for me, both just hang up whenever I try to open a script, even a simple "version()" call. Have to use Virtualdub again.
Elaborate on "hang up". No error message?
Groucho2004 is offline  
Old 15th February 2014, 03:44   #627  |  Link
TurboPascal7
Registered User
 
TurboPascal7's Avatar
 
Join Date: Jan 2010
Posts: 270
Dear google translate users, please, get out of the MT modes pad.
__________________
Me on GitHub | AviSynth+ - the (dead) future of AviSynth
TurboPascal7 is offline  
Old 15th February 2014, 06:49   #628  |  Link
ryrynz
Registered User
 
ryrynz's Avatar
 
Join Date: Mar 2009
Posts: 3,417
Quote:
Originally Posted by Groucho2004 View Post
So, you get 160 fps with AVS+ compared to 50 fps with SEt's MT Avisynth? And a fraction of the memory usage? Very nice.
Could drop memory usage down on 2.6MT, it's hard to tell what value you can use setmemorymax at for it to be stable.. but yes, a big difference here. Makes me wonder if 2.6MT is being benchmarked correctly, Avs+ is showing an extra 7 threads.
ryrynz is offline  
Old 15th February 2014, 06:54   #629  |  Link
TurboPascal7
Registered User
 
TurboPascal7's Avatar
 
Join Date: Jan 2010
Posts: 270
Avs+ creates two thread pools - one for prefetching threads (main pool) and one for user threads - avstp replacement allowing for more efficient internal threading implementation in plugins that cannot run with frame-level threading. So avs+ having more threads is hardly surprising.
That said, amount of threads right now is a bit silly. As I see it, with prefetch(4) it should be around 1 (main) + 3 (prefetch threads so 4 in total with main) + 4 (second thread pool) = 8, and not 20 or so created right now. Of course it hardly matters since most threads are idling, but should probably get fixed as mt becomes more stable.
__________________
Me on GitHub | AviSynth+ - the (dead) future of AviSynth
TurboPascal7 is offline  
Old 15th February 2014, 13:50   #630  |  Link
Seedmanc
Registered User
 
Join Date: Sep 2010
Location: Russia
Posts: 85
Groucho2004, well, I left both overnight trying to open a script and now I see both the same way I left them. I think I enabled logging in AVSmeter, but I don't see any logs in the folder. Meter remained at "AVSMeter 1.7.6 (AVS 2.6, x86) by Groucho2004" line in the console window.
Seedmanc is offline  
Old 15th February 2014, 14:54   #631  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,054
Quote:
Originally Posted by Seedmanc View Post
Groucho2004, well, I left both overnight trying to open a script and now I see both the same way I left them. I think I enabled logging in AVSmeter, but I don't see any logs in the folder. Meter remained at "AVSMeter 1.7.6 (AVS 2.6, x86) by Groucho2004" line in the console window.
You don't even see the "Analysing script, please wait..." line? Post your script.
Groucho2004 is offline  
Old 15th February 2014, 17:17   #632  |  Link
Seedmanc
Registered User
 
Join Date: Sep 2010
Location: Russia
Posts: 85
It looks like the problem was in "avsfilternet.dll" being in my plugins folder, now that I removed it it seems to work fine. It wasn't a problem with 2.6 though.
Seedmanc is offline  
Old 15th February 2014, 21:37   #633  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 1,704
Some testing done this afternoon with 1080P material.

The following script works ok:

PHP Code:
LoadPlugin("D:\eseguibili\media\DGDecNV\DGDecodeNV.dll")
SetFilterMTMode(""2)
SetFilterMTMode("DGSource"3)
DGSource("E:\in\something.dgi")
#CompTest(1)
ChangeFPS(last,last,true)
SMDegrain (tr=6,PreFilter=2,thSAD=600,contrasharp=false,refinemotion=true,plane=0,chroma=false,lsb=true,mode=6)
Prefetch(3
The following hangs in MeGui preview:

PHP Code:
LoadPlugin("D:\eseguibili\media\DGDecNV\DGDecodeNV.dll")
SetFilterMTMode(""2)
SetFilterMTMode("DGSource"3)
DGSource("E:\in\something.dgi")
#CompTest(1)
ChangeFPS(last,last,true)
SMDegrain (tr=6,PreFilter=2,thSAD=600,contrasharp=false,refinemotion=true,lsb_out=true,plane=0,chroma=false,Globals=2)
SMDegrain (tr=6,            thSAD=600,contrasharp=false,refinemotion=true,lsb_in =true,plane=0,chroma=false,Globals=1,mode=6)
Prefetch(3
Both works ok under AviSynth_MT from Set, which is even a bit faster.
__________________
@turment on Telegram
tormento is offline  
Old 19th February 2014, 20:55   #634  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,435
mpeg2source doesn't seem to work with avs+ mt on. I have a 1080p mpeg2 video which I indexed with dgindex, and trying to test with mt on, it gave me a green screen onload with avspmod, and when I try seek, the program just hangs. All three mt mode will hang.

Code:
SetFilterMTMode("MPEG2Source", 2)
MPEG2Source("sample.d2v", cpu=0)
Prefetch(4)
lansing is offline  
Old 20th February 2014, 09:23   #635  |  Link
udobroemme
Registered User
 
Join Date: Oct 2012
Posts: 12
I think it was mentioned before...
For source filters you have to use
Code:
SetFilterMTMode("MPEG2Source", 3)
udobroemme is offline  
Old 20th February 2014, 09:43   #636  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,435
After a few more tests, I figure setting prefetch to 1 core will work, anything more than 1 will cause avsmeter to hang. And it doesn't matter which mode I use, all three will work if I call prefetch(1).
lansing is offline  
Old 20th February 2014, 15:55   #637  |  Link
Zep
Registered User
 
Join Date: Jul 2002
Posts: 587
Quote:
Originally Posted by lansing View Post
After a few more tests, I figure setting prefetch to 1 core will work, anything more than 1 will cause avsmeter to hang. And it doesn't matter which mode I use, all three will work if I call prefetch(1).
the question then, are

no prefetch in the script
prefetch(0)
prefetch(1)

truly equivalent? If so that should be why all modes worked.

yes I'm curious lol
Zep is offline  
Old 20th February 2014, 16:00   #638  |  Link
innocenat
Registered User
 
innocenat's Avatar
 
Join Date: Dec 2011
Posts: 77
Quote:
Originally Posted by Zep View Post
the question then, are

no prefetch in the script
prefetch(0)
prefetch(1)

truly equivalent? If so that should be why all modes worked.

yes I'm curious lol
No prefetch is technically Prefetch(0). Prefetch(1) is currently equivalent, but it is not guaranteed.

Prefetch itself predicts what frame will be requested next and fetch that frame in advance (in available thread). Prefetch(0) means to not use prefetching. Prefetch(1) will create a thread pool of one thread and do prefetching solely on that thread. Thus there is no guarantee that Prefetch(1) will request frame from its upstream filter in same order as it is requested (but it is currently this way)
__________________
AviSynth+
innocenat is offline  
Old 20th February 2014, 21:06   #639  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,852
Tested AviSynth+ 0.1 (r1689, x86) mt for my 8mm film restoring project, while experimenting with Dither package, 10 bit x264 output, etc.

This film restoring script included Depan, RemoveDirtMC, MDegrain2, Crop16, Resize16 and converting between 8 bit and 16 bit stacked format and other functions from Dither Package.

SET's 2013.09.28 MT version was OK with SetMTMode(2). 95% CPU usage by AvsMeter.

So I generally enabled MT_MULTI_INSTANCE (except AviSource) but did not work. Tried to test MT modes but got no consistent results.
Finally turned out that either Dither_Out()/DitherPost() or Dither_Resize16() should be MT_SERIALIZED when MDeGrain2 used. When MDegrain2 was not used, even MT_NICE_FILTER worked for them. MDegrain2 comes from the modified mvtools2 package came with Dither tools.

Narrowed down the problem for this script.

For working version change comment/uncomment these lines: SetFilterMTMode("Dither_Resize16"...

Code:
# some globals for the clip
play_speed=16
trim_begin=0 #120
seconds=120
trim_end=trim_begin + play_speed*seconds
_grey=true
film="c:\Tape13\Videos\1975_KeskenyFilm.avi"

# AVS+ version
SetFilterMTMode("",          MT_MULTI_INSTANCE)
SetFilterMtMode("AVISource", MT_SERIALIZED)
 
#########################################
# External filters (guessed, might not be very stable)
##################################
#SetFilterMTMode("DitherPost",             MT_SERIALIZED)
SetFilterMTMode("DitherPost",             MT_NICE_FILTER)
SetFilterMTMode("Dither_Convert_8_to_16", MT_MULTI_INSTANCE)

# resize16 + crop16 are working even MT_NICE_FILTER in this sample 
# when commenting out MDegrain2

#SetFilterMTMode("Dither_Resize16",       MT_SERIALIZED)   # when MDegrain2 used
SetFilterMTMode("Dither_Resize16",        MT_MULTI_INSTANCE) # Freeze when MDegrain2 in clip

SetFilterMTMode("Dither_Crop16",          MT_MULTI_INSTANCE) 
SetFilterMTMode("Dither_quantize",        MT_NICE_FILTER) 
SetFilterMTMode("Dither_Out",             MT_NICE_FILTER) 
SetFilterMTMode("MDegrain2",              MT_MULTI_INSTANCE) 

SetFilterMTMode("MAnalyse",               MT_MULTI_INSTANCE) 
SetFilterMTMode("MRecalculate",           MT_MULTI_INSTANCE) 
SetFilterMTMode("MSuper",                 MT_MULTI_INSTANCE) 

# Either Dither_Out or Dither_Resize16 should be MT_SERIALIZED when MDeGrain2 used
# otherwise avisynth+ hangs silently 

#Load plugins explicitly
#-----------------------
DLLPath="..\8mmDLLs\"
#Loadplugin(DLLPath+"mt_masktools-26.dll")  #Version 2.0.48.0   2012.04.02 needed for Dither_ package Access Viola on AVS+
Loadplugin(DLLPath+"mt_masktools-25.dll")  #Version 2.0.48.0   2012.04.02 needed for Dither_ package
Loadplugin(DLLPath+"dither.dll")           #Version ?????      2013.10.26
Import(DLLPath+"dither.avsi")        
LoadPlugin(DLLPath + "mvtools2.dll")       # Version 2.6.0.5  MSuper, MDegrain2, etc.. (2012.07.17 Dither 1.24 package modified version)
LoadPlugin(DLLPath+ "Rgtools.dll")         # tp7 alternative new package for Clense, RemoveGrain

#keep it the last line please
if (FunctionExists("avstp_set_threads")) {
    avstp_set_threads(0, 1)   #disable threading in dither
}

#################################
# load video 
#################################
Avisource(film).killaudio().assumefps(play_speed).trim(trim_begin,trim_end).converttoYV12()
clp=last

#--------------------
#-- Start of MDegrain part. 
# variables for denoising (MDegrain)
denoising_strength= 600  #denoising level of first denoiser: MDegrain() 
block_size=    8         #block size of MVDegrain
block_over=    4         #block overlapping 

prefiltered = Removegrain(clp,mode=2)
superfilt =   MSuper(prefiltered, hpad=32, vpad=32,pel=2)
super=        MSuper(clp, hpad=32, vpad=32,pel=2)

halfblksize= (block_size>4)   ? block_size/2 : 4
halfoverlap= (block_over>2)   ? block_over/2 : 2

bvec1 =  MAnalyse(superfilt, isb = true,  delta = 1, blksize=block_size, overlap=block_over,dct=0,chroma= _grey ? false : true)
bvec1 =  MRecalculate(super, bvec1, blksize=halfblksize, overlap=halfoverlap,thSAD=100) 

fvec1 =  MAnalyse(super, isb = false, delta = 1, blksize=block_size, overlap=block_over,dct=0,chroma= _grey ? false : true)
fvec1 =  MRecalculate(super, fvec1, blksize=halfblksize, overlap=halfoverlap,thSAD=100)

bvec2 =  MAnalyse(super, isb = true,  delta = 2, blksize=block_size, overlap=block_over,dct=0,chroma= _grey ? false : true)
bvec2 =  MRecalculate(super, bvec2, blksize=halfblksize, overlap=halfoverlap,thSAD=100)

fvec2 =  MAnalyse(super, isb = false, delta = 2, blksize=block_size, overlap=block_over,dct=0,chroma= _grey ? false : true)
fvec2 =  MRecalculate(super, fvec2, blksize=halfblksize, overlap=halfoverlap,thSAD=100)

#MDegrain2 from the modified Dither package version mvtools2
clp.MDegrain2(super, bvec1,fvec1,bvec2,fvec2,thSAD=denoising_strength)
GreyScale()
#-- End of MDegrain part 
#---------------------------

Dither_Convert_8_to_16()
Dither_Crop16(16,16,-16,-16) # just to have a crop and resize
Dither_Resize16(720,576) # back to original for the sake of demo
DitherPost()

#for AVS+ enable MT
Prefetch(8)
pinterf is offline  
Old 21st February 2014, 01:55   #640  |  Link
Zep
Registered User
 
Join Date: Jul 2002
Posts: 587
Quote:
Originally Posted by innocenat View Post
No prefetch is technically Prefetch(0). Prefetch(1) is currently equivalent, but it is not guaranteed.

Prefetch itself predicts what frame will be requested next and fetch that frame in advance (in available thread). Prefetch(0) means to not use prefetching. Prefetch(1) will create a thread pool of one thread and do prefetching solely on that thread. Thus there is no guarantee that Prefetch(1) will request frame from its upstream filter in same order as it is requested (but it is currently this way)
mode 1 working then seems a bit odd in Prefetch(1) with lansings filter choice. Was mode 1 really being utilized?
Zep 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 01:14.


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