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 23rd July 2017, 15:13   #3561  |  Link
edcrfv94
Registered User
 
Join Date: Apr 2015
Posts: 84
Maybe auto one processes for each C/C++ filter(auto switch 32bit if 64bit not available) and auto adjustment prefetch and keep frames cache, can temporarily solve the multi-threaded problem until a new method appears.

Code:
colorbars(width = 1920, height = 1080, pixel_type = "yv12")

src = last
mcdn = src.kf_MCDegrainN(clip c, int "tr")

rfs(src, mcdn, mappings="[1000 2000] [3000 4000]") #Remap Frames

function kf_MCDegrainN(clip c, int "tr")
{	
	
	tr       = default(tr,          6)
	
	super  = MSuper(levels=0)

	multi_vec = MAnalyse(super, multi=true, delta=tr)
	
	c.MDeGrainN(super, multi_vec, tr)
	
	return last
}
Code:
colorbars(width = 1920, height = 1080, pixel_type = "yv12")

src = last

#1 processes prefetch 16 keep 14
#export last, src
#pass

mcdn = src.kf_MCDegrainN(clip c, int "tr")
	function kf_MCDegrainN(clip c, int "tr")
	{	
		
		tr       = default(tr,          6)
		
		super  = MSuper(levels=0)
		#2 processes prefetch 14 keep 12
		#export super
		#pass last, c

		multi_vec = MAnalyse(super, multi=true, delta=tr)
		#3 processes prefetch 12 keep 10
		#export multi_vec
		#pass last, c, super
		
		c.MDeGrainN(super, multi_vec, tr)
		#4 processes prefetch 10 keep 8
		#export last
		#pass
		
		return last
	}

rfs(src, mcdn, mappings="[1000 2000] [3000 4000]") #Remap Frames
#5 processes prefetch 8 keep 6
#export last
MP_Pipeline cann't pass audio, just for example.
Code:
MP_Pipeline("""
	
	SetMemoryMax(500)
	
	colorbars(width = 1920, height = 1080, pixel_type = "yv12")
	src = last
	
### export clip:src
### prefetch: 14,12
### ###

	SetMemoryMax(500)
	
	c = src
	super  = MSuper(levels=0)
	
### export clip:c, super
### pass clip:src
### prefetch: 12,10
### ###

	SetMemoryMax(500)
	
	multi_vec = MAnalyse(super, multi=true, delta=tr)
	
### export clip:multi_vec
### pass clip:src, c, super
### prefetch: 10,8
### ###
	
	SetMemoryMax(500)
	
	mcdn = c.MDeGrainN(super, multi_vec, tr)
	
### export clip:mcdn
### pass clip:src
### prefetch: 8,6
### ###
	
	SetMemoryMax(500)
	
	rfs(src, mcdn, mappings="[1000 2000] [3000 4000]") #Remap Frames
	
""")

Last edited by edcrfv94; 23rd July 2017 at 15:16.
edcrfv94 is offline  
Old 23rd July 2017, 15:31   #3562  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by edcrfv94 View Post

MP_Pipeline cann't pass audio, just for example.
yes, Unfortunately

I wish someone did these changes https://github.com/SAPikachu/MP_Pipe...ment-269108878
__________________
See My Avisynth Stuff
real.finder is offline  
Old 13th August 2017, 05:18   #3563  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
hi pinterf

when you back can you check this, I didn't note it before since I use mpp(MP_Pipeline) most of the time and by using mpp it seems to work!

edit: this one too https://forum.doom9.org/showpost.php...postcount=2709 since you will touch the autoload things

edit2: this one too https://forum.doom9.org/showthread.p...12#post1814912
__________________
See My Avisynth Stuff

Last edited by real.finder; 13th August 2017 at 09:33.
real.finder is offline  
Old 25th August 2017, 09:36   #3564  |  Link
junh1024
Registered User
 
Join Date: Mar 2011
Posts: 59
Really, how hard is it 2 make SSRC accept int16 in? Most of the audio tools (DAWs, VSTs, outside of avs) I use happily do format/bitdepth conversions silently.
junh1024 is offline  
Old 1st September 2017, 12:02   #3565  |  Link
fenarinarsa
Registered User
 
Join Date: Jun 2015
Posts: 2
AddAutoLoadDir behavior changed

Hello everyone,

Since AVS+ 2502 the AddAutoLoadDir behavior changed.

Before this version, I could add 32bits and 64 bits DLLs (in two different folders) and AviSynth would load the correct ones depending on the environment it's working on. Because I currently must use an old x86 software and ffmpeg x64 at the same time from the same script.

Now it fires an error (cannot load DLL...) and stops there.

That a real issue for me since I generate an AVS+ script that should work in 32bits *and* 64bits and that I don't use the AVS+ default plugins dir (we have in-house developments).

In other word, this change in behavior breaks everything that was working quite well until now

I looked for a way of having conditionnal loading, but I couldn't find a variable that returns the current environment. Another way would be to add an optional argument to AddAutoLoadDir like "errors=false".

Am I missing something there ?


BTW I'm the technical director of a cable/DSL French TV channel and we've been using AviSynth and AVS+ for 9 years to generate our on-air & VOD/catch-up video graphics
I must say you're doing an awesome work. Last year I was thinking about ditching AVS because we had a lot of issues relating to memory management, HD, ffmpeg and QuickTime, but AVS+ saved it
demo => http://www.youtube.com/watch?v=ZbHMMxTcgec
fenarinarsa is offline  
Old 1st September 2017, 12:21   #3566  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by fenarinarsa View Post
Since AVS+ 2502 the AddAutoLoadDir behavior changed.

Before this version, I could add 32bits and 64 bits DLLs (in two different folders) and AviSynth would load the correct ones depending on the environment it's working on. Because I currently must use an old x86 software and ffmpeg x64 at the same time from the same script.
I guess you can blame me for this since I suggested to pinterf to add a check for the correct bitness of plugins in the auto-load directories.
A possible solution for this could be to modify the AddAutoLoadDir() functionality so the bitness check is omitted on the script level. This way, only the "hard coded" auto-load directories to which the registry entries point will be checked.

Last edited by Groucho2004; 1st September 2017 at 12:38.
Groucho2004 is offline  
Old 1st September 2017, 13:30   #3567  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by fenarinarsa View Post

I looked for a way of having conditionnal loading, but I couldn't find a variable that returns the current environment. Another way would be to add an optional argument to AddAutoLoadDir like "errors=false".

Am I missing something there ?
Sorry for the inconvenience.

From version r2487 there is a new script function:

int GetProcessInfo([int type = 0])
Without parameter or type==0 the current bitness of Avisynth DLL is returned (32 or 64)
With type=1 the function can return a bit more detailed info:
-1: error, can't establish
0: 32 bit DLL on 32 bit OS
1: 32 bit DLL on 64 bit OS (WoW64 process)
2: 64 bit DLL

Usage:
LoadPlugin(GetProcessInfo == 32 ? "This32.dll" : "This64.dll")
pinterf is offline  
Old 1st September 2017, 13:54   #3568  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by pinterf View Post
Usage:
LoadPlugin(GetProcessInfo == 32 ? "This32.dll" : "This64.dll")
I don't think this is exactly what he's looking for, he want's to use auto-load. However, something like this maybe:
Code:
(GetProcessInfo == 32) ? AddAutoLoadDir("32BitplugsDir") : AddAutoLoadDir("64BitplugsDir")
Groucho2004 is offline  
Old 1st September 2017, 15:05   #3569  |  Link
fenarinarsa
Registered User
 
Join Date: Jun 2015
Posts: 2
Quote:
Originally Posted by Groucho2004 View Post
I don't think this is exactly what he's looking for, he want's to use auto-load. However, something like this maybe:
Code:
(GetProcessInfo == 32) ? AddAutoLoadDir("32BitplugsDir") : AddAutoLoadDir("64BitplugsDir")
Thanks a lot! That's what I was looking for.
I read a few months ago that a function to return the bitness was added, but I couldn't find it in the documentation.

So it works now, time to deploy r2508

BTW I still didn't activate MT because I found some bugs. I suppose I can do bug reports here ? (it usually takes time because I do full reports with sample files)
fenarinarsa is offline  
Old 1st September 2017, 15:11   #3570  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Yes, we all like well documented bug reports Thanks.
pinterf is offline  
Old 2nd September 2017, 14:43   #3571  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Last OT posts moved to https://forum.doom9.org/showthread.php?t=174847
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline  
Old 3rd September 2017, 17:25   #3572  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,806
I must be doing something wrong because I don't see any change with or without Prefetch(8). Speed,number of threads and memory consumption is identical.

script
Code:
#MT
Import("C:\Users\Dave\Documents\Delphi_Projects\RipBot264\_Compiled\Tools\AviSynth plugins\Scripts\MTmodes.avs")

#VideoSource
 
video=DirectShowSource("E:\_Video_Samples\mkv\drive_video_10min.mkv",audio=false).ConvertToYV12(matrix="rec709")

#Crop
video=Crop(video,0,140,-0,-140)


#Denoise
Loadplugin("C:\Users\Dave\Documents\Delphi_Projects\RipBot264\_Compiled\Tools\AviSynth plugins\mvtools\mvtools2.dll")
super=MSuper(video,pel=2)
fv1=MAnalyse(super,isb=false,delta=1,overlap=4)
bv1=MAnalyse(super,isb=true,delta=1,overlap=4)
fv2=MAnalyse(super,isb=false,delta=2,overlap=4)
bv2=MAnalyse(super,isb=true,delta=2,overlap=4)
video=MDegrain2(video,super,bv1,fv1,bv2,fv2,thSAD=400)

return video

prefetch(8)
Code:
AVSMeter 2.2.6 (x86)
AviSynth+ 0.1 (r2508, MT, i386) (0.1.0.0)
Loading script...

Number of frames:                14751
Length (hh:mm:ss.ms):     00:10:15.117
Frame width:                      1920
Frame height:                      800
Framerate:                      23.981 (10000/417)
Colorspace:                       YV12

Frame (current | last):         144 | 14750
FPS (cur | min | max | avg):    1.985 | 1.946 | 4.142 | 2.407
Memory usage (phys | virt):     287 | 336 MiB
Thread count:                   37
CPU usage (current | average):  8% | 6%

Time (elapsed | estimated):     00:01:00.231 | 01:42:07.361
without prefetch

Code:
AVSMeter 2.2.6 (x86)
AviSynth+ 0.1 (r2508, MT, i386) (0.1.0.0)
Loading script...

Number of frames:                14751
Length (hh:mm:ss.ms):     00:10:15.117
Frame width:                      1920
Frame height:                      800
Framerate:                      23.981 (10000/417)
Colorspace:                       YV12

Frame (current | last):         144 | 14750
FPS (cur | min | max | avg):    1.981 | 1.945 | 4.097 | 2.401
Memory usage (phys | virt):     287 | 336 MiB
Thread count:                   37
CPU usage (current | average):  7% | 6%

Time (elapsed | estimated):     00:01:00.384 | 01:42:22.926
Atak_Snajpera is offline  
Old 3rd September 2017, 17:36   #3573  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
You have "return video" above prefetch in the filter chain. I think prefetch actually kinda is a pseudo-filter of its own, so it might matter - not sure though.
TheFluff is offline  
Old 3rd September 2017, 17:41   #3574  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,806
Quote:
I think prefetch actually kinda is a pseudo-filter of its own, so it might matter - not sure though.
Yes! You are right! Prefetch acts like filter so this works now

Code:
#MT
Import("C:\Users\Dave\Documents\Delphi_Projects\RipBot264\_Compiled\Tools\AviSynth plugins\Scripts\MTmodes.avs")

#VideoSource
 
video=DirectShowSource("E:\_Video_Samples\mkv\drive_video_10min.mkv",audio=false).ConvertToYV12(matrix="rec709")

#Crop
video=Crop(video,0,140,-0,-140)


#Denoise
Loadplugin("C:\Users\Dave\Documents\Delphi_Projects\RipBot264\_Compiled\Tools\AviSynth plugins\mvtools\mvtools2.dll")
super=MSuper(video,pel=2)
fv1=MAnalyse(super,isb=false,delta=1,overlap=4)
bv1=MAnalyse(super,isb=true,delta=1,overlap=4)
fv2=MAnalyse(super,isb=false,delta=2,overlap=4)
bv2=MAnalyse(super,isb=true,delta=2,overlap=4)
video=MDegrain2(video,super,bv1,fv1,bv2,fv2,thSAD=400)

video=prefetch(video,8)
return video
Atak_Snajpera is offline  
Old 4th September 2017, 10:07   #3575  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
@Mod
Posts #3576 and onwards should be moved to the fft3dfilter thread.
Groucho2004 is offline  
Old 4th September 2017, 20:42   #3576  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Posts moved.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline  
Old 5th September 2017, 05:54   #3577  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
With the latest version of Avisynth+, I'm still unable to open script files names containing international character in MPC-HC; but the same files open fine in VirtualDub.

I thought this had been solved? Here's an example of file name: おどるポンポコリン.mp4
MysteryX is offline  
Old 5th September 2017, 07:20   #3578  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by MysteryX View Post
With the latest version of Avisynth+, I'm still unable to open script files names containing international character in MPC-HC; but the same files open fine in VirtualDub.

I thought this had been solved? Here's an example of file name: おどるポンポコリン.mp4
Not sure why your example has a .mp4 extension but opening a script "おどるポンポコリン.avs" works fine in mpc-hc even without switching the locale to Japanese. This is on XP.
Groucho2004 is offline  
Old 5th September 2017, 15:20   #3579  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,806
Source: 3840x2160 AVC
CPU: E5-2690 (8C/16T)
RAM: 64 GiB
OS: Win7 x64
Avisynth+: r2508 x86
Code:
#MT
Import("C:\Users\Dave\Documents\Delphi_Projects\RipBot264\_Compiled\Tools\AviSynth plugins\Scripts\MTmodes.avs")

#VideoSource
video=DirectShowSource("E:\_Video_Samples\mp4\UHD_0035.MP4",audio=false).ConvertToYV12(matrix="rec709")

#Resize
video=Spline36Resize(video,1920,1080).Sharpen(0.2)

#Denoise
Loadplugin("C:\Users\Dave\Documents\Delphi_Projects\RipBot264\_Compiled\Tools\AviSynth plugins\mvtools\mvtools2.dll")
super=MSuper(video,pel=2)
fv1=MAnalyse(super,isb=false,delta=1,overlap=4)
bv1=MAnalyse(super,isb=true,delta=1,overlap=4)
fv2=MAnalyse(super,isb=false,delta=2,overlap=4)
bv2=MAnalyse(super,isb=true,delta=2,overlap=4)
video=MDegrain2(video,super,bv1,fv1,bv2,fv2,thSAD=400)

#Prefetch
video=Prefetch(video,X)

#Return
return video
I wonder why performance drops so heavily when process uses more than 2000 MiB of memory?

Code:
8 Threads
AVSMeter 2.2.6 (x86)
AviSynth+ 0.1 (r2508, MT, i386) (0.1.0.0)
Loading script...

Number of frames:                  420
Length (hh:mm:ss.ms):     00:00:14.014
Frame width:                      1920
Frame height:                     1080
Framerate:                      29.970 (5000000/166833)
Colorspace:                       YV12

Frames processed:               420 (0 - 419)
FPS (min | max | average):      0.581 | 472300 | 10.53
Memory usage (phys | virt):     1609 | 1800 MiB
Thread count:                   45
CPU usage (average):            52%

Time (elapsed):                 00:00:39.880
-------------------------------------------------------
14 Threads
AVSMeter 2.2.6 (x86)
AviSynth+ 0.1 (r2508, MT, i386) (0.1.0.0)
Loading script...

Number of frames:                  420
Length (hh:mm:ss.ms):     00:00:14.014
Frame width:                      1920
Frame height:                     1080
Framerate:                      29.970 (5000000/166833)
Colorspace:                       YV12

Frames processed:               420 (0 - 419)
FPS (min | max | average):      0.181 | 566759 | 12.38
Memory usage (phys | virt):     1784 | 1984 MiB
Thread count:                   51
CPU usage (average):            89%

Time (elapsed):                 00:00:33.925
-------------------------------------------------------
15 Threads
AVSMeter 2.2.6 (x86)
AviSynth+ 0.1 (r2508, MT, i386) (0.1.0.0)
Loading script...

Number of frames:                  420
Length (hh:mm:ss.ms):     00:00:14.014
Frame width:                      1920
Frame height:                     1080
Framerate:                      29.970 (5000000/166833)
Colorspace:                       YV12

Frames processed:               420 (0 - 419)
FPS (min | max | average):      0.196 | 472300 | 7.495
Memory usage (phys | virt):     1826 | 2016 MiB
Thread count:                   52
CPU usage (average):            57%

Time (elapsed):                 00:00:56.034
-------------------------------------------------------
16 Threads
AVSMeter 2.2.6 (x86)
AviSynth+ 0.1 (r2508, MT, i386) (0.1.0.0)
Loading script...

Number of frames:                  420
Length (hh:mm:ss.ms):     00:00:14.014
Frame width:                      1920
Frame height:                     1080
Framerate:                      29.970 (5000000/166833)
Colorspace:                       YV12

Frames processed:               420 (0 - 419)
FPS (min | max | average):      0.170 | 566760 | 6.253
Memory usage (phys | virt):     1850 | 2045 MiB
Thread count:                   53
CPU usage (average):            39%

Time (elapsed):                 00:01:07.169
Atak_Snajpera is offline  
Old 5th September 2017, 16:17   #3580  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Atak_Snajpera,

What happens if you get virtual memory use over 2048MiB ?
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS 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 18:54.


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