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 16th March 2015, 10:56   #981  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
MT is not working for me in the latest build o_O
The very same script
Code:
global threads=9
SetFilterMTMode("",2)
SetFilterMTMode("ffdShow_source",3)
ffdShow_source()
...
Prefetch(threads)
is working as expected with October build and working with a 1-thread speed with the latest one
__________________
SVPflow motion interpolation
chainik_svp is offline  
Old 16th March 2015, 11:15   #982  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by Boulder View Post
and now it seems that it is the time if you feel that the multithreading issues should be gone.
At least the ones that I know of. Whether there is anything else undiscovered, we will find out as more and more people test. So yes, now is the right time to test again.

Quote:
Originally Posted by Boulder View Post
Do you have anything specific you wish to have tested?
Nothing really in specific. Just use your regular scripts as you would normally do, and let me know if you see any problems. Plus-points for anybody who also tries out their script(s) using MT, but for that be sure that the correct filter modes have been specified. I cannot stress this enough: you can only expect MT-mode to behave sanely if you have the correct MT mode setting for all filters in your script.
Here is a start for MT mode settings: https://pad.riseup.net/p/avs_plus_mt_modes . Never-fading fame for all who make fixes or additions to that list.

Quote:
Originally Posted by Boulder View Post
Should the output of Avisynth 2.6 MT and Avisynth+ be identical?
The output should be visually indifferentiable, but not bit-exact identical.

Quote:
Originally Posted by Boulder View Post
And the most important question: is MT enabled automatically or does it need to be set to achieve maximum performance?
It needs to be set up in your script. Not just for maximum performance, but also for correct operation in general. The setup is composed of two parts: 1) Setting the MT modes in the beginning, then 2) enabling MT by adding the Prefetch-line to the end of your script. For detailed instructions (including example) about using MT, see this post.
__________________
AviSynth+

Last edited by ultim; 16th March 2015 at 11:18.
ultim is offline  
Old 16th March 2015, 11:25   #983  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by chainik_svp View Post
MT is not working for me in the latest build o_O
The very same script
Code:
global threads=9
SetFilterMTMode("",2)
SetFilterMTMode("ffdShow_source",3)
ffdShow_source()
...
Prefetch(threads)
is working as expected with October build and working with a 1-thread speed with the latest one
Hi,
Replace
Code:
SetFilterMTMode("",2)
by
Code:
SetFilterMTMode("DEFAULT_MT_MODE",2)
Sorry I forgot to mention earlier.
__________________
AviSynth+
ultim is offline  
Old 16th March 2015, 11:29   #984  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,924
@ultim: Thanks a lot, I'll try to find the time to experiment this week
__________________
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 16th March 2015, 11:29   #985  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,033
Quote:
Originally Posted by ultim View Post
Yeah this script runs out of memory. I'll try to adapt some things to shrink the caches more aggressively under extreme memory pressure.

As for XP-compatibility, all things are compiled with the xp-toolset, so at least from that aspect, it should be fine. I wonder if there was some other oversight on my part (e.g. using an unsupported API or dunno what), I admit I haven't tested on XP at all. Will look into it.
As I mentioned later, r1778 crashes with every script on my WinXP.
Groucho2004 is offline  
Old 16th March 2015, 11:38   #986  |  Link
burfadel
Registered User
 
Join Date: Aug 2006
Posts: 2,234
Quote:
Originally Posted by Groucho2004 View Post
As I mentioned later, r1778 crashes with every script on my WinXP.
Windows XP.

Compiling for Windows XP and making it universal is detrimental to users of Windows 8.1 etc.
burfadel is offline  
Old 16th March 2015, 11:48   #987  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
SetFilterMTMode("DEFAULT_MT_MODE",2)

Yeah, thanks.

I see some very strange behavior when playing video with SVP.
Everything looks great, except when I set number of threads to 6 or 11 video playback becomes choppy.
Every other number (tested values from 2 to 15) gives smooth playback.
I'm on 2 cores / 4 threads SandyBridge now. Will test it with my FX-8320 later...

===
it looks like source filter (which is ffdshow_source()) became inaccurate with those values
i.e. the next filter in the chain (SVSuper()) sometimes receives the same frame when it asks for N and N-1
so motions vectors are zero and playback is choppy

most likely this's some issue with the cache
__________________
SVPflow motion interpolation

Last edited by chainik_svp; 16th March 2015 at 12:02.
chainik_svp is offline  
Old 16th March 2015, 12:09   #988  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,033
Quote:
Originally Posted by burfadel View Post
Windows XP.

Compiling for Windows XP and making it universal is detrimental to users of Windows 8.1 etc.
- Can you share any examples from your development experience that would support such a generalized statement?
- Do you work for Microsoft?
- Just trolling?
Groucho2004 is offline  
Old 16th March 2015, 12:16   #989  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by chainik_svp View Post
it looks like source filter (which is ffdshow_source()) became inaccurate with those values
i.e. the next filter in the chain (SVSuper()) sometimes receives the same frame when it asks for N and N-1
so motions vectors are zero and playback is choppy

most likely this's some issue with the cache
Hmmm, I'm not sure about that. Might as well be just DirectShow messing up, as it is known to be not frame-accurate during seeks in general. This is often not a problem during sequential processing, but with MT-mode enabled, directshow will recieve out-of-order frame requests even during sequential playback.

Edit: Consideirng that in your case avisynth is not running as a standalone directshow filter but as part of ffdshow, it might actually be frame-accurate depending on which source filters ffdshow chooses to use. I don't know enough about ffdshow internals to judge that tbh.
__________________
AviSynth+

Last edited by ultim; 16th March 2015 at 13:35.
ultim is offline  
Old 16th March 2015, 12:21   #990  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
I never saw this before with Avisynth
And again, in AVS+ the issue is only with 6 or 11 threads. Some kind of magic numbers o_O
__________________
SVPflow motion interpolation
chainik_svp is offline  
Old 16th March 2015, 12:24   #991  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by burfadel View Post
Windows XP.

Compiling for Windows XP and making it universal is detrimental to users of Windows 8.1 etc.
Don't worry burfadel, support for XP in AviSynth(+) does not have any negative effects that I can think of on post-XP Windows users.
__________________
AviSynth+
ultim is offline  
Old 16th March 2015, 13:04   #992  |  Link
mark0077
Registered User
 
Join Date: Apr 2008
Posts: 1,073
Quote:
Originally Posted by chainik_svp View Post
SetFilterMTMode("DEFAULT_MT_MODE",2)

Yeah, thanks.

I see some very strange behavior when playing video with SVP.
Everything looks great, except when I set number of threads to 6 or 11 video playback becomes choppy.
Every other number (tested values from 2 to 15) gives smooth playback.
I'm on 2 cores / 4 threads SandyBridge now. Will test it with my FX-8320 later...

===
it looks like source filter (which is ffdshow_source()) became inaccurate with those values
i.e. the next filter in the chain (SVSuper()) sometimes receives the same frame when it asks for N and N-1
so motions vectors are zero and playback is choppy

most likely this's some issue with the cache
With normal Avisynth MT I always have strange issues with audio going out of sync depending on what number of buffer aheads I use. See my previous posts at the thread below. The issue is still there for me, I again have to pick some "magic" good numbers of buffer ahead like 14 or 15 to stop audio going out of sync. (I'll try today with avisynth+ to see can I get audio to go out of sync).

http://www.svp-team.com/forum/viewtopic.php?id=1011&p=3

I definitely feel there's some work needed in the buffer ahead areas to stop choppyness and also audio going out of sync. I'm not sure whats the best way to illustrate this so that a solution could be found.

Last edited by mark0077; 16th March 2015 at 13:37.
mark0077 is offline  
Old 16th March 2015, 13:09   #993  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by ultim View Post
Hmmm, I'm not sure about that. Might as well be just DirectShow messing up, as it is known to be not frame-accurate during seeks in general. This is often not a problem during sequential processing, but with MT-mode enabled, directshow will recieve out-of-order frame requests even during sequential playback.
Another possible cause of choppy real-time playback is when threads gang up (e.g. their results arrive in "waves"). In that case they still deliver the same performance on average, but not evenly distributed in every short time window. To see if this is the case, you'd have to encode a piece of video to file with all the processing, then play back the pre-processed file without avisynth. If the playback is only choppy during real-time processing but not in the encoded file itself, this is exactly what is happening.
__________________
AviSynth+
ultim is offline  
Old 16th March 2015, 13:45   #994  |  Link
mark0077
Registered User
 
Join Date: Apr 2008
Posts: 1,073
I am having problems with audio desync when switching to avisynth+ (r1778) with SVP. I assume its down to the issue with ffdshow buffer ahead weirdness? Can anyone suggest a good number of avisynth+ threads, SVP cores, and ffdshow buffer aheads to try? I'm using core i7 920.

I was previously using SETs lates Avisynth MT with its threads, SVP cores and ffdshow buffer ahead set to a value of 15 where all worked fine. So far I have tried lowering the Avisynth+ threads down to 8 / 6 / 4 but audio seems really badly out of sync AND/OR video being choppy in all combinations I have tried.
mark0077 is offline  
Old 16th March 2015, 14:06   #995  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
utim

This is not about timing, frames are rendering uniformly.
I can visualize motion vectors, and it's clear that they're all zeroes at some frames.
Zero-sized MVs mean source frames used for motion estimation was identical.

But I still can't reproduce this effect via avs2avi or figure out any simple test scenario for ffdshow o_O

May be you want to install SVP?
__________________
SVPflow motion interpolation
chainik_svp is offline  
Old 16th March 2015, 14:17   #996  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by chainik_svp View Post
But I still can't reproduce this effect via avs2avi or figure out any simple test scenario for ffdshow o_O
Does that mean it only happens with ffdshow?
__________________
AviSynth+
ultim is offline  
Old 16th March 2015, 15:25   #997  |  Link
burfadel
Registered User
 
Join Date: Aug 2006
Posts: 2,234
Quote:
Originally Posted by ultim View Post
Don't worry burfadel, support for XP in AviSynth(+) does not have any negative effects that I can think of on post-XP Windows users.
Ah ok. Still, I don't believe support should be in place for XP any more, it only encourages people to stick with it longer.
burfadel is offline  
Old 16th March 2015, 15:28   #998  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
I've checked frames returned by ffdshow_source() by inserting some debug code into Cache::GetFrame that computes 'checksum' of the Y plane.

Normal behavior (num of threads !=6): lookup always returns LRU_LOOKUP_NOT_FOUND, and for each 'n' returned frame is a new one (with contents different from frame 'n-1').
Code:
81: .... 8B35E6F
82: .... 8A80C08
83: .... 899A3CA
84: .... 89D3DED
85: .... 8B1A39A
Invalid behavior (num of threads ==6): every other frame is equal to the previous one.
Code:
81: .... 8B35E6F
82: .... 8B35E6F
83: .... 899A3CA
84: .... 899A3CA
85: .... 8B1A39A
86: .... 8B1A39A
__________________
SVPflow motion interpolation
chainik_svp is offline  
Old 16th March 2015, 16:13   #999  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by chainik_svp View Post
I've checked frames returned by ffdshow_source() by inserting some debug code into Cache::GetFrame that computes 'checksum' of the Y plane.

Normal behavior (num of threads !=6): lookup always returns LRU_LOOKUP_NOT_FOUND, and for each 'n' returned frame is a new one (with contents different from frame 'n-1').
Code:
81: .... 8B35E6F
82: .... 8A80C08
83: .... 899A3CA
84: .... 89D3DED
85: .... 8B1A39A
Invalid behavior (num of threads ==6): every other frame is equal to the previous one.
Code:
81: .... 8B35E6F
82: .... 8B35E6F
83: .... 899A3CA
84: .... 899A3CA
85: .... 8B1A39A
86: .... 8B1A39A
I'll see if I can reproduce this.
__________________
AviSynth+
ultim is offline  
Old 16th March 2015, 17:43   #1000  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
The very same magic numbers (6 and 11) on 4 cores / 8 threads AMD FX-8320
__________________
SVPflow motion interpolation
chainik_svp 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 04:27.


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