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 6th May 2012, 15:33   #381  |  Link
SEt
Registered User
 
Join Date: Aug 2007
Posts: 374
Unlikely – DLLs can be loaded in runtime.
But you can try list of all process DLLs (with paths of course) in Process Explorer and see if you can spot the difference of previous version and new at the crash point.
SEt is offline   Reply With Quote
Old 6th May 2012, 19:52   #382  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by SEt View Post
Unlikely – DLLs can be loaded in runtime.
Dependency Walker has a "profiling" feature that can be used to track all the DLL's loaded at runtime too.

Other than that, one can also use VMMap to show all modules (DLL's) that a given processes has currently loaded...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 12th May 2012, 19:45   #383  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 673
I will discuss my experience. If I use:

Code:
SetMemoryMax(512)
SetMTMode(3,4)
source_filter()
SetMTMode(2)
processing_filters()
Any program freezes, increasing the size of the ram but without result

If I use:

Code:
SetMemoryMax(512)
SetMTMode(4,4)
source_filter()
SetMTMode(2)
processing_filters()
I get this error: http://s7.postimage.org/q5llnwpbv/Set_MTMode_4_4.png

Using follow script, run fine.

Code:
SetMemoryMax(512)
SetMTMode(5,4)
source_filter()
SetMTMode(2)
processing_filters()
My system is win 7 sp1 x64 on GA-x58-ud5+intel i7 920+ 6gb ram
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Radeon RX580 8GB DDR5 + ADATA SX8200 Pro 1 TB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite
Overdrive80 is offline   Reply With Quote
Old 12th May 2012, 22:16   #384  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
I think you are supposed to use SetMTMode(5,x) before a source filter, so the last example is correct (and thus runs without errors).
__________________
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   Reply With Quote
Old 12th May 2012, 23:07   #385  |  Link
TheRyuu
warpsharpened
 
Join Date: Feb 2007
Posts: 787
Quote:
Originally Posted by Boulder View Post
I think you are supposed to use SetMTMode(5,x) before a source filter, so the last example is correct (and thus runs without errors).
And even then last I checked using mode 5 is highly discouraged.

Mode 3 should be used instead for situations like that IIRC.
TheRyuu is offline   Reply With Quote
Old 12th May 2012, 23:10   #386  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
Well, for example DGSource doesn't like SetMTMode(3) on my computer while it works fine with SetMTMode(5). Of course, decoding the source is the smallest thing in my case so it can well run singlethreaded.
__________________
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   Reply With Quote
Old 14th May 2012, 15:17   #387  |  Link
Anacletus
Registered User
 
Anacletus's Avatar
 
Join Date: Mar 2005
Posts: 50
Quote:
Originally Posted by SEt View Post
To debug this I need a way to reproduce the error. Or at least location of unhandled exception thrown and stack trace, so someone with debugging skills is needed for second approach.
To pinpoint what is causing your problems start with clean system (you can use VM – it lakes few minutes to set up but very useful for many experiments) and gradually add what you have. I suspect stray DLL in unexpected location that is now loaded instead of expected DLL.
Hi SEt,

i installed a clean Windows XP Service Pack3 into an Oracle VirtualBox VM, installed official avisynth 2.58 and it was ok. Downloaded your last build of 2.6MT and i got the avsp crash again.

System config:
Oracle VirtualBox 4.1.14 r77440
Windows XP SP3 (with all the security patches at the time of writing)
AvsP.exe 2.0.2.0
Avisynth 2.5.8 + Avisynth 2.6MT (latest version)

I used Dependancy Walker's profiling tool, you can find the profiling log attached, the exception is at line 476
Attached Files
File Type: txt AVSP_StackTrace.txt (97.0 KB, 56 views)

Last edited by Anacletus; 14th May 2012 at 17:43. Reason: Added Application versions
Anacletus is offline   Reply With Quote
Old 16th May 2012, 00:52   #388  |  Link
SEt
Registered User
 
Join Date: Aug 2007
Posts: 374
Found it! Grab the new version.
XP runtime was terminating us for no good reason – I've hacked the compiler a bit to be more XP-friendly. NT6 users are unaffected. No source changes since version 2012.04.03.
SEt is offline   Reply With Quote
Old 16th May 2012, 02:22   #389  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Thanks SEt, your latest version (2012.05.16) works fine. BTW I'm Using Windows XP SP3 (32 bit).
Reel.Deel is offline   Reply With Quote
Old 16th May 2012, 04:34   #390  |  Link
Anacletus
Registered User
 
Anacletus's Avatar
 
Join Date: Mar 2005
Posts: 50
Quote:
Originally Posted by SEt View Post
Found it! Grab the new version.
Anacletus is offline   Reply With Quote
Old 16th May 2012, 19:10   #391  |  Link
RedDwarf1
RedDwarf Fan
 
Join Date: Jun 2005
Location: United Kingdom
Posts: 198
Quote:
Originally Posted by SEt View Post
Found it! Grab the new version.
XP runtime was terminating us for no good reason – I've hacked the compiler a bit to be more XP-friendly. NT6 users are unaffected. No source changes since version 2012.04.03.
The new one works fine for me as well.
RedDwarf1 is offline   Reply With Quote
Old 19th May 2012, 11:54   #392  |  Link
BugiBugBug
Registered User
 
Join Date: Dec 2006
Posts: 10
SEt, I've searched through this threat on information about the MT() function.
I noticed a post you made where you state that the MT.dll is not supported.
Remarkably however, in the beginning of this thread, notably BigDid stated he was able to use the latest MT0.7 dll with your AS2.6
Still, MT.dll does not work for me (AV complains "wrong avisynth version. Use avisynth 2.6 or greater or modified avisynth 2.5.6").

Am I correct in assuming that for instance MT("FluxSmoothST(7,7)",threads=2) cannot be used with any of your AviSynth MT builds?

And that the only possibility to use the MT() mode would mean having to use the older 2.5.7 build supplied with the MT.dll?

I'm a great fan of temporal denoisers, and I have perceived the SetMTmodes to limit their effectiveness. If I understand the Wiki correctly the MT() mode is the only true option for effective temporal filters. But this may of course be incorrect; I do not really understand all the differences between SetMTmode - maybe I missed something and the MT() mode is deprecated?
BugiBugBug is offline   Reply With Quote
Old 19th May 2012, 12:03   #393  |  Link
SEt
Registered User
 
Join Date: Aug 2007
Posts: 374
MT() is unsupported by me, though it's not impossible to update it to the current Avisynth 2.6 MT state.
And sure MT() is not your only option besides MTMode: look in the forum – there are other threading attempts like pipelining.
SEt is offline   Reply With Quote
Old 19th May 2012, 12:46   #394  |  Link
ryrynz
Registered User
 
ryrynz's Avatar
 
Join Date: Mar 2009
Posts: 3,646
Quote:
Originally Posted by BugiBugBug View Post
Am I correct in assuming that for instance MT("FluxSmoothST(7,7)",threads=2) cannot be used with any of your AviSynth MT builds?
SetMemoryMax(1024)
SetMTMode(3,2)
ffdshow_source()
SetMTMode(2)
FluxsmoothST(7,7)
SetMTMode(1)
GetMTMode(false) > 0 ? distributor() : last

Basically taken from the front page. I use this within ffdshow, I use Fluxsmooth often and had zero issues with SEt's builds.

Last edited by ryrynz; 19th May 2012 at 13:04. Reason: Source filters are optimal in modes 3 or 5.
ryrynz is offline   Reply With Quote
Old 19th May 2012, 12:53   #395  |  Link
SEt
Registered User
 
Join Date: Aug 2007
Posts: 374
Never put source filters in mode 2 – you are creating multiple instances of it. Use either mode 3 or 5 for them.
SEt is offline   Reply With Quote
Old 19th May 2012, 13:02   #396  |  Link
ryrynz
Registered User
 
ryrynz's Avatar
 
Join Date: Mar 2009
Posts: 3,646
Thanks for the tip, I'll edit the previous post.
ryrynz is offline   Reply With Quote
Old 19th May 2012, 13:10   #397  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
Quote:
Originally Posted by BugiBugBug View Post
I'm a great fan of temporal denoisers, and I have perceived the SetMTmodes to limit their effectiveness.
Actually using SetMTMode makes them work exactly like they work in single-threaded mode. A temporal denoiser works over a certain area in a single frame and processes multiple sequential frames for each single frame. Depending on the spatial radius and the overlap value, using MT() could lead to sub-optimal results.
__________________
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   Reply With Quote
Old 19th May 2012, 13:42   #398  |  Link
BugiBugBug
Registered User
 
Join Date: Dec 2006
Posts: 10
Quote:
Originally Posted by Boulder View Post
Actually using SetMTMode makes them work exactly like they work in single-threaded mode. A temporal denoiser works over a certain area in a single frame and processes multiple sequential frames for each single frame. Depending on the spatial radius and the overlap value, using MT() could lead to sub-optimal results.
Thank you for this clarification; I was already wondering how that would work, since I've never had crashes or anything with FluxSmooth or DeGrainMedian using SetMTmode. That is not the reason of my concern.

As you are saying, the filter needs a sequence of sequential/subsequent frames to calculate whether it smooths something. This is also the reason why I understood the threading method of SetMTmode to be sub-optimal for this purpose, because in my endless naivity I assumed using this would mean the following:
thread 1 gets e.g. frame 1,3,5,7 and calculates the temporal pattern of an area on their sequence.
thread 2 gets e.g. frame 2,4,6,9 and calculates the temporal pattern of an area on their sequence.

But if I understand your explanation correctly, two threads are created in which the same frame is thus present (i.e. read) in thread 1 on t=1, and present in thread 2 as well, at t=2.
But the 'noise correction' is applied in thread 1 to frame n, and in thread 2 to frame n+1.

[disclaimer]
I apologise if I'm bringing things up again that have been explained already (given the fact that MT has been around for some years now), but I have been unable to fully apprehend its use and configuration despite of countless hours of searching and reading. It's these specific questions vs. explanations that keep fogging my understanding.
[/disclaimer]

So this is what I've got now, just for clarification:
Code:
SetMTmode(3,0)
LoadPlugin("")
DGDecode_mpeg2source("C:\CT.d2v", info=3)
SetMTmode(2,0)
ColorMatrix(hints=true, threads=0)
trim(125500,126500)
FluxSmoothST(7,7)
crop(10, 10, -8, -14)
Undot()
Spline36Resize(720,576)
Undot()
SetMTMode(1)
GetMTMode(false) > 0 ? distributor() : last

Last edited by BugiBugBug; 19th May 2012 at 13:44.
BugiBugBug is offline   Reply With Quote
Old 19th May 2012, 14:00   #399  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
Quote:
Originally Posted by BugiBugBug View Post
But if I understand your explanation correctly, two threads are created in which the same frame is thus present (i.e. read) in thread 1 on t=1, and present in thread 2 as well, at t=2.
But the 'noise correction' is applied in thread 1 to frame n, and in thread 2 to frame n+1.
Yes. If I have understood the process correctly (=the threads are totally independent of each other) . The processing gets a nice boost from the Avisynth cache because the same frame could be needed by many threads and it could already be in the cache when it is requested by a thread. Then again, the cache used to be the nest of many problems in multithreading, but I think that SEt has worked out quite a few of them.

You should make sure that you really need Distributor() in your script. Many applications do not need it since they call it themselves.
__________________
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   Reply With Quote
Old 19th May 2012, 14:26   #400  |  Link
SEt
Registered User
 
Join Date: Aug 2007
Posts: 374
That's not how it works. Simplified a bit, it works this way: let's look at certain filter in the script in MTMode – there are indeed 2 threads, but both of them have all source frames, next from one thread frames 0,2,4... are requested and from the other thread frames 1,3,5... If the filter handles non-sequential requests correctly – it'll work exactly as in non-MT mode, but if it doesn't – things will break (note that they will also break in non-MT mode when some filter reorders frames like SelectEven or Trim).

The end
Code:
SetMTMode(1)
GetMTMode(false) > 0 ? distributor() : last
must be used only for certain cases like ffdshow processing, for plain Avisynth usage it must not be used. How to guess? If MTMode doesn't change your CPU utilization no matter how many threads you request, but adding Distributer helps – you need it, otherwise you don't.
SEt 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 23:54.


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