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 5th February 2014, 21:23   #541  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by easyfab View Post
Thanks Ultim and avs+ team for this release, here my first little test on an intel I2600K.

http://pastebin.com/Di0w2Y0y

Not bad for a first version ,
for info avs+ single thread -> FPS (min | max | average): 28.47 | 32.69 | 30.88

The difference I see is in frame count 145 vs 103, could it explain the difference in speed ?
Hi, thanks for the test. You can also try with a bit fewer threads (5-6), it will often result in better speeds. Otherwise, as noted above, you can expect further performance improvements from MT in the future, as I'm still working on it. This was just an early test build.

As for the thread count, I'm not sure to be honest. Probably because a mode 2 plugin has internal threading too. Both are way too high though, but I'm glad to see that Avs+ has the less threads.
__________________
AviSynth+

Last edited by ultim; 5th February 2014 at 21:30.
ultim is offline  
Old 5th February 2014, 21:37   #542  |  Link
easyfab
Registered User
 
Join Date: Jan 2002
Posts: 332
Ultim,

You're right about threads:

threads : Prefetch(8) vs Prefetch(5)
fps average : 76.77 vs 81.52
And less memory 520 vs 444
easyfab is offline  
Old 5th February 2014, 22:31   #543  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by ultim View Post
As for the thread count, I'm not sure to be honest. Probably because a mode 2 plugin has internal threading too. Both are way too high though, but I'm glad to see that Avs+ has the less threads.
The 145 threads from the first example are easily explained:

setmtmode(5,8) #8 threads for MT

QTGMC(preset="fast", EdiThreads=8).selecteven() #8 Edithreads * 8 MT threads = 64 threads

distributor() #Distributor is already called in AVSMeter so calling it twice makes 64 * 2 = 128 threads

Finally, add some threads for other filters and you have your 145 threads.
Groucho2004 is offline  
Old 5th February 2014, 22:42   #544  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
@ultim
Before I start digging through the AVS+ code - How do I determine the MT mode in Avisynth+?
In AVSMeter, I have been doing it like this so far (for SEt's MT DLL), pretty much the same as it's done in x264:
Code:
AVSValue AVS_temp;
int iMTMode = 0;
try
{
 AVS_temp = AVS_env->Invoke("GetMTMode", false);
 iMTMode = AVS_temp.IsInt() ? AVS_temp.AsInt() : 0;
 if ((iMTMode > 0) && (iMTMode < 5) && settings.bInvokeDistributor)
  AVS_main = AVS_env->Invoke("Distributor", AVS_main);
}
catch (IScriptEnvironment::NotFound)
{
}
Also, is Prefetch() similar to the Distributor() call?
Groucho2004 is offline  
Old 5th February 2014, 23:32   #545  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
I've run into an issue with resampling audio.

As sometimes happens, if you use AssumeFPS's sync_audio parameter, the resultant sample rate gets wonky, requiring a follow-up use of SSRC to correct it. Even worse, depending on the source and output samplerates, you have to use SSRC twice - once before the AssumeFPS, and again afterward. The canonical example would be something like 44.1kHz synced to 30000/1000 fps, resampled to 48kHz synced to 30000/1001 fps.

In 2.6a5 and r1576, this worked like it always does. But somewhere between r1576 and r1636 (r1689 also shows it), possibly in the MT or cache changes, the above operation can cause an error at the end of encoding and audio truncation when using FFAudioSource as the input source. Now, I'm not entirely sure if it's something that needs to be fixed on FFMS2's side or not, but the problem is as follows:

Code:
Script Input	->	Script Output	FFmpeg log message
44.1kHz		->	44.1kHz		no error
44.1kHz		->	48kHz		[avisynth @ 03922860] FFAudioSource: Out of bounds audio samples requested (single use of SSRC, no fps change)
44.1kHz@30fps	->	48kHz@29.97fps	same error, plus truncated* (SSRC->AssumeFPS w/sync_audio=true->SSRC)
48kHz		->	48kHz		no error

*IIRC, 44.1->48 without an fps change might have also had some truncation, but it wasn't nearly as bad as the resample+fps change test was.

r1689 = error, truncated
r1636 = error, truncated
r1576 = works, no truncation
2.6a5 = works, no truncation

Script:
FFmpegSource2("[AKROSS Con 2013] Okami - Quiet.mp4",atrack=-1,fpsnum=30000,fpsden=1000)
SSRC(48000,fast=false)
AssumeFPS(29.97,sync_audio=true)
SSRC(48000,fast=false)

FFmpeg:
ffmpeg -i test.avs -vn -acodec pcm_s16le test-48re.wav
This was all single-threaded. I wasn't using any MT-related functions at all (not to mention that I'm using a single-core CPU without hyperthreading).

Saving a resampled (but not fps-resynced) PCM file and then importing that in with WAVSource before doing the AssumeFPS and SSRC adjustment results in no error and possibly no truncation (or the much more minor one I mentioned above).
qyot27 is offline  
Old 5th February 2014, 23:43   #546  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by Groucho2004 View Post
How do I determine the MT mode in Avisynth+?
You cannot get the MT mode in Avs+. IMHO it wouldn't make too much sense because an MT-mode is always associated with a filter. So at best you could ask which MT mode is a particular filter configured to use. You can ask for the number of threads though, but that is part of IScriptEnv2, which is not officially stable yet.

Quote:
Originally Posted by Groucho2004 View Post
Also, is Prefetch() similar to the Distributor() call?
Yes, I think it is (given that I undertsand Distributor() halfway correctly). But Prefetch() shouldn't be inserted automatically, it should always be added by the user when they want a multithreaded chain. All in all, I don't think Avs+MT should need special handling in tools like Avs-MT did with the Distributor().
__________________
AviSynth+
ultim is offline  
Old 5th February 2014, 23:55   #547  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by ultim View Post
You cannot get the MT mode in Avs+. IMHO it wouldn't make too much sense because an MT-mode is always associated with a filter. So at best you could ask which MT mode is a particular filter configured to use. You can ask for the number of threads though, but that is part of IScriptEnv2, which is not officially stable yet.
Thanks. I basically just want to know if a script is running multi-threaded or not.
Groucho2004 is offline  
Old 6th February 2014, 00:01   #548  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by qyot27 View Post
I've run into an issue with resampling audio.

...
Hi qyot27,

Could you please check these special builds for you if you experience the same problem with either of them? And if so, which one?
EDIT: lol, sry i forgot to post the link: https://mega.co.nz/#F!sZkDjKRD!ZZz7oQvYP6FQ0F0rAeYOoQ
__________________
AviSynth+

Last edited by ultim; 6th February 2014 at 00:14.
ultim is offline  
Old 6th February 2014, 00:02   #549  |  Link
ryrynz
Registered User
 
ryrynz's Avatar
 
Join Date: Mar 2009
Posts: 3,646
Just wondering why this is crashing my media player am using ffdshow raw.

SetFilterMTMode("", 2)
SetFilterMTMode("ffdshow_source", 3)
ffdshow_source()
Psharpen()
Prefetch(4)

I've tried stating Psharpen in a SetFilterMTMode as well but same deal. I just copied the Avisynth DLL into my SYSWOW64 folder. What am I missing?
Also is SetMemoryMax still something that should be set?
ryrynz is offline  
Old 6th February 2014, 00:07   #550  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by Groucho2004 View Post
Thanks. I basically just want to know if a script is running multi-threaded or not.
Yes, you can tell that using IScriptEnvironment2::GetProperty(AEP_FILTERCHAIN_THREADS), but please don't use it before the whole IScriptEnvironment2 is finalized. This is not a licensing restriction, it has to do with the fact that if you start using it and the class changes after that, your application will break.
__________________
AviSynth+
ultim is offline  
Old 6th February 2014, 00:11   #551  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by ryrynz View Post
Just wondering why this is crashing my media player am using ffdshow raw.

SetFilterMTMode("", 2)
SetFilterMTMode("ffdshow_source", 3)
ffdshow_source()
Psharpen()
Prefetch(4)

I've tried stating Psharpen in a SetFilterMTMode as well but same deal. I just copied the Avisynth DLL into my SYSWOW64 folder. What am I missing?
Also is SetMemoryMax still something that should be set?
Hi,

I cannot try it right now because I don't have the necessary stuff installed. Does it work if you use SetFilterMTMode("", 3) instead?
__________________
AviSynth+
ultim is offline  
Old 6th February 2014, 00:18   #552  |  Link
ryrynz
Registered User
 
ryrynz's Avatar
 
Join Date: Mar 2009
Posts: 3,646
It crashes even if the chain is left completely blank, which of course is no problem with 2.6 MT. Something's broken.
ryrynz is offline  
Old 6th February 2014, 00:29   #553  |  Link
TurboPascal7
Registered User
 
TurboPascal7's Avatar
 
Join Date: Jan 2010
Posts: 270
Quote:
Originally Posted by ryrynz View Post
It crashes even if the chain is left completely blank, which of course is no problem with 2.6 MT. Something's broken.
Works fine here. Please ensure that you have correct x86 avisynth.dll in your SysWOW64 folder and x64 dll in System32 folder.
Also, are you using x64 ffdshow/mpc by any chance?
__________________
Me on GitHub | AviSynth+ - the (dead) future of AviSynth
TurboPascal7 is offline  
Old 6th February 2014, 00:53   #554  |  Link
ryrynz
Registered User
 
ryrynz's Avatar
 
Join Date: Mar 2009
Posts: 3,646
Yeah correct x86 version downloaded in SysWOW64, copied the x64 version to System32 as you said above (not required is it?) Am using MPC-HC/BE/ffdshow x86.
2.6 MT is working fine, just copied the 2.6MT version over the AVS+ version and BE/HC doesn't crash at all, I have no idea what's going on.
ryrynz is offline  
Old 6th February 2014, 01:01   #555  |  Link
turbojet
Registered User
 
Join Date: May 2008
Posts: 1,840
Latest version resizer's are a bit faster but still about 2% slower than avisynth 2.60, it used to be 4% slower on amd fx8320.
__________________
PC: FX-8320 GTS250 HTPC: G1610 GTX650
PotPlayer/MPC-BE LAVFilters MadVR-Bicubic75AR/Lanczos4AR/Lanczos4AR LumaSharpen -Strength0.9-Pattern3-Clamp0.1-OffsetBias2.0
turbojet is offline  
Old 6th February 2014, 01:28   #556  |  Link
Nevilne
Registered User
 
Join Date: Aug 2010
Posts: 134
divide=1 or divide=2 doesn't work in MAnalyse with avisynth+

Code:
super = MSuper()
backward_vectors = MAnalyse(super, isb = true)
forward_vectors = MAnalyse(super, isb = false)
MFlowBlur(super, backward_vectors, forward_vectors, blur=15)
working

Code:
super = MSuper()
backward_vectors = MAnalyse(super, divide=1, isb = true)
forward_vectors = MAnalyse(super, divide=1, isb = false)
MFlowBlur(super, backward_vectors, forward_vectors, blur=15)
black screen
Nevilne is offline  
Old 6th February 2014, 01:50   #557  |  Link
innocenat
Registered User
 
innocenat's Avatar
 
Join Date: Dec 2011
Posts: 77
Quote:
Originally Posted by turbojet View Post
Latest version resizer's are a bit faster but still about 2% slower than avisynth 2.60, it used to be 4% slower on amd fx8320.
Can you also provide raw fps number? Also, what kernel did you use? As stated before, none of dev have AMD machine, so it isn't tested.
__________________
AviSynth+
innocenat is offline  
Old 6th February 2014, 05:33   #558  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Quote:
Originally Posted by ultim View Post
Hi qyot27,

Could you please check these special builds for you if you experience the same problem with either of them? And if so, which one?
EDIT: lol, sry i forgot to post the link: https://mega.co.nz/#F!sZkDjKRD!ZZz7oQvYP6FQ0F0rAeYOoQ
Both builds crash immediately due to a SIGILL.

On a different computer (that has SSE2), though:
AviSynth_check.dll = error, truncation
AviSynth_nocheck.dll = error, truncation
qyot27 is offline  
Old 6th February 2014, 05:40   #559  |  Link
naoan
Registered User
 
Join Date: Oct 2009
Posts: 151
Thanks for the build ultim, haven't tried much but fft3dgpu need mode 3 to operate without glitch.
naoan is offline  
Old 6th February 2014, 07:57   #560  |  Link
turbojet
Registered User
 
Join Date: May 2008
Posts: 1,840
blankclip(1630,1920,1080,"YV12",23.976)
resize(1280,720)
measured with avsmeter 1.7.6
Code:
            AVS+   2.60   
Lanczos3    116    132
Spline64    108    116
Bicubic     192    159
Bilinear    205    225
Bicubic being faster while the others are slower might be interesting.
__________________
PC: FX-8320 GTS250 HTPC: G1610 GTX650
PotPlayer/MPC-BE LAVFilters MadVR-Bicubic75AR/Lanczos4AR/Lanczos4AR LumaSharpen -Strength0.9-Pattern3-Clamp0.1-OffsetBias2.0
turbojet 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 06:13.


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