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. |
|
|
Thread Tools | Search this Thread | Display Modes |
24th May 2008, 03:31 | #881 | Link | |
Registered User
Join Date: Jul 2002
Posts: 587
|
Quote:
|
|
24th May 2008, 18:28 | #882 | Link |
Registered User
Join Date: Nov 2005
Location: Wałbrzych, Poland
Posts: 105
|
Code:
SetMTMode(2,0) LoadPlugin("J:\Program Files\AviSynth 2.5\plugins\exinpaint.dll") Logo1=ImageSource("K:\afd\WRHH1logoTR.bmp"). ConvertToYV12(matrix="pc.601") Logo2=ImageSource("K:\afd\WRHH1logoTL.bmp"). ConvertToYV12(matrix="pc.601") Video=AviSource("example.avi", audio=false) A=Trim(Video,0,115) Exinpaint(A,Logo1,color=$FF8080, Radius=100) LanczosResize(720,540) A=last B=Trim(Video,116,0) Exinpaint(B,Logo2,color=$FF8080, Radius=100) LanczosResize(720,540) B=last AlignedSplice(A,B) SetMTMode(5,0) FFT3DGPU() SetMTMode(2,0) AddBorders(0,18,0,18) Distributor() Code:
SetMTMode(5,0) FFT3DGPU() SetMTMode(2,0) Code:
FFT3DFilter() My question is about FFT3DGPU. FFT3DGPU does not work in pararrel threads for obvious reasons. Which mode would be adequate for this filter? Is SetMTMode(5,0) good or maybe it should be replaced by SetMTMode(5,1)? Any suggestions? |
2nd June 2008, 07:35 | #883 | Link |
Registered User
Join Date: Aug 2006
Posts: 77
|
Ok, now I have tried every possible variation I could come up.
The input clip is a full screen PAL capture in YUY2, which works flawlessly in singletreaded and up to #cores processes. Using this simple Script: Code:
setMTmode(5,0) LoadPlugin("d:\avs game\filter\mvtools192.dll") AVISource("testclipYUY2.avi") #FFmpegSource("testclipYUY2.avi") #DirectShowSource("testclipYUY2.avi", pixel_type="YUY2").converttoyuy2() #MTsource("""AVISource("testclipYUY2.avi")""",delta=1,threads=1) setMTmode(2) idxref=30 ol=4 ts=320 backward_vec2 = source.MVAnalyse(isb = true, delta = 2, overlap=ol,idx=idxref) backward_vec1 = source.MVAnalyse(isb = true, delta = 1, overlap=ol,idx=idxref) forward_vec1 = source.MVAnalyse(isb = false, delta = 1, overlap=ol,idx=idxref) forward_vec2 = source.MVAnalyse(isb = false, delta = 2, overlap=ol,idx=idxref) source.MVDegrain2(backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=ts,idx=idxref) AssumeFPS and requestlinear(TIVTC) can reduce the number of bad frames. Directshowsource didn't produce obvious errors, but it always converted to RGB. FFmpegSource worked without any errors (output binary identical to single thread). Generated data (blankclip or loops) based on the avisource worked without noticeable errors. MT 0.6/0.7 and the included avisynth.dlls produced virtually identical results. the .4 crashed a bit less than the other two. The hardware should not be the cause, I tried on my Q9300 and on my Athlon X2 3800+, fresh WinXP/SP2(3) 32-bit. Both worked without any errors single threaded (and multi process - 2 or 4 clips parallel). Even MT() in an otherwise single threaded script didn't produce the corrupted frames/crashes (I didn't check on minor errors yet). With SetMTMode !=0,5 or 6 on the whole script crashes and corrupted frames occurred. The number of processors and the cpu load seemed to increase failures. A strange fact puzzled me for some time - longer more complex scripts, where the errors first occurred were more stable in every aspect. So making the script simpler usually increased the errors. Simple scripts like Avisource("clip1.avi").reduceby2() produce errors too, MVdegrain2 only produces nearly 100% cpu load and works at least with some datasources without errors, MVDegrain2 from mvtoolsMTcomp2.zip or Fizicks builds have similar errors. Getting additional load to the cpu with prime95 torture tests provide nearly identical results on less cpu-intensive scripts. So am I the only one with unusable AVISource in scripts with SetMTMode 1-4 somewhere in the script? I guess a critical section in the getFrame method of AVISource would prevent this, as the corrupted frames, if they don't crash the whole script, seem to be shifted(with garbage on top or bottom)/garbage luma with "missing" chroma and the luma seems to belong to some frame several frames away. so either they refer to frames(memory) already freed, or not yet filled with the decompressed input.
__________________
GA-P35-DS3R, Core2Quad Q9300@3GHz, 4.0GB/800 MHz DDR2, 2x250GB SATA HD, Geforce 6800 Last edited by TSchniede; 2nd June 2008 at 08:31. Reason: copied in the wrong version of the script. |
3rd June 2008, 12:49 | #884 | Link |
Registered User
Join Date: Nov 2007
Posts: 48
|
Can i ask whether the MT filter could be used to speed up a noise filter like fluxsmooth in a
tools GUI such as AVS2DVD or FAVC while encoding with HCEnc and how i would go about setting that up in a script. Sorry but i'm a noobie when it comes to avisynth and haven't hade much luck with it All help gratefully received |
4th June 2008, 16:12 | #885 | Link |
Registered User
Join Date: Aug 2006
Posts: 77
|
(Spatio-)temporal filter usually profit more from MT() than from SetMTMode. Which one is better or which one works (if any at all) has to be tested. First make sure your system can profit from multi threading (at least HT or dualcore). Then that you can use MT() or SetMTMode() (mode 2 or 3 for most filters) for example masktools-v2.0 work with MT() and SetMTMode(2).
IF both your system and the filter works then a script like the following would be what you seek: Code:
#loadplugin("mt.dll") # or use the autoload feature (see installation on on first page) Avisource("clip.avi") MT("FluxSmoothT(7)") #or MT("FluxSmoothST(7,7)",overlap=2) or use MTi on interlaced sources Code:
SetMTMode(5) #load your input here - for example FFMpegsource("clip.wmv") SetMTMode(4) # 2 or 3 faster FluxSmoothT(7)
__________________
GA-P35-DS3R, Core2Quad Q9300@3GHz, 4.0GB/800 MHz DDR2, 2x250GB SATA HD, Geforce 6800 |
4th June 2008, 16:43 | #886 | Link |
Registered User
Join Date: Nov 2007
Posts: 48
|
Thanks for the scripts TShniede yes my computer is a dualcore so i'll have to give your script a try
and see which is the best at working with fluxsmooth if any would this script still work if other avisynth scripts were run without MT first such as resize,crop |
5th June 2008, 12:06 | #887 | Link |
Registered User
Join Date: Aug 2006
Posts: 77
|
Of course if the simple script works (that does includes outright crashes, but most of the time only corrupted frames or "minor" pixel errors), other things can be added between the sourcefilter and fluxsmooth. In the best case the output is identical to single treaded operation.
crop or resize could be used freely multithreaded with SetMTMode(2), but not MT(). You could even use SetMTMode for everything except FluxSmooth. if you use SetMTMode anywhere, then the first line has to be SetMTMode(5) or SetMTMode(5,2). Be careful with Avisource and SetMTMode! This script should work: Code:
SetMTMode(5) FFMpegSource("input.clip") SetMTMode(2) crop(8,8,-8,-8).BilinearResize(1024,1024) MT("FluxSmoothST()") #implicit change to mode 5 and back to 2 crop(16,16,-16,-16)
__________________
GA-P35-DS3R, Core2Quad Q9300@3GHz, 4.0GB/800 MHz DDR2, 2x250GB SATA HD, Geforce 6800 |
5th June 2008, 12:22 | #888 | Link |
Registered User
Join Date: Nov 2007
Posts: 48
|
think i follow you TSchniede
the script i had was this # 4:3 encoding AviSource("C:\Test Movies\test\test.avi", false) ConvertToYUY2() FadeIn(50) Crop(0,16,720,544) Lanczos4Resize(720,576,0.0,0.6) loadplugin("mt.dll") MT("FluxSmoothST(7,7)",overlap=2) would this actually work or would SetMTMode for everything be a better option. really gratefull for your help as i'm totally lost on the whole when it comes to avisynth scripts. |
5th June 2008, 13:44 | #889 | Link |
Registered User
Join Date: Aug 2006
Posts: 77
|
If the script without MT() does what you intend to, that should be correct.
It should even be faster, if you use this: Code:
SetMTMode(5) # 4:3 encoding loadplugin("mt.dll") # should be done outside of parallel region AviSource("C:\Test Movies\test\test.avi", false) SetMTMode(2) ConvertToYUY2() FadeIn(50) Crop(0,16,720,544) Lanczos4Resize(720,576,0.0,0.6) #SetMTMode(5) #implicit done anyway on current version MT("FluxSmoothST(7,7)",overlap=2) the script without SetMTMode should work though. Is the input clip RGB? otherwise ConvertToYUY2() makes no sense, keeping it YV12 would be faster.
__________________
GA-P35-DS3R, Core2Quad Q9300@3GHz, 4.0GB/800 MHz DDR2, 2x250GB SATA HD, Geforce 6800 |
6th June 2008, 11:41 | #890 | Link | |
Registered User
Join Date: Nov 2007
Posts: 48
|
Thanks for the help TSchniede,much appreciated
when i checked the gui avisynth script the source was actually from DirectShowSource so i ran this script and it worked Quote:
|
|
18th June 2008, 17:49 | #892 | Link | |
Kid for Today
Join Date: Aug 2004
Posts: 3,477
|
Quote:
this RC1 is mod2 for YV12 resizing instead of mod4. very useful for SD content with LSF. any chance seeing a MT patch please ? it's too slow for real time use in ffdshow otherwise |
|
10th July 2008, 18:34 | #893 | Link |
Registered User
Join Date: Oct 2005
Posts: 131
|
first: thank you for your great work tsp
filters that were supposed to be deadslow are now fast as hell however i encountered one strange behavior: if i drag & drop a script (even version() will do) into Megui it works 2-3 times and then stop working... if i do the same with unmodified avisynth it works always. Maybe you have a clue whats going on... |
11th July 2008, 16:48 | #894 | Link | |
Registered User
Join Date: Sep 2006
Posts: 84
|
Quote:
without MT, many of the filters with 2.5.8 are pretty slow. anxiously looking forward to release support latest avisynth release. thnxs |
|
11th July 2008, 23:26 | #895 | Link |
Registered User
Join Date: May 2002
Posts: 384
|
Does Setmtmode work properly with allot of freezeframes, duplicate and deleteframes as wel as trims?
I ask this because I'm encoding with setmtmode, but i get memory access errors a few seconds into encode, with d2v as source. |
12th July 2008, 11:35 | #896 | Link | |
Registered User
Join Date: Jul 2002
Posts: 587
|
Quote:
Using mt eats up memory fast and can cause errors. Trims work fine but make sure you trim right after the source call in mode 5. |
|
14th July 2008, 08:45 | #897 | Link |
likes to tinker
Join Date: Jan 2004
Location: girt by sea
Posts: 635
|
Just purchased an Intel Q9450 Duo Quad4 and am looking forward to thrashing the living daylights out of it
New to MT and SetMTmode ... I gather
However I am not sure if "resizing to a final size" all in one step works, like Code:
MT("LimitedSharpenFaster(smode=4, dest_x=704, dest_y=576)",overlap=8,threads=4) Code:
MT("spline36resize(704, last.height())",splitvertical=false,overlap=8,threads=4) MT("spline36resize(last.width(), 576)",splitvertical=true,overlap=8,threads=4) Last edited by halsboss; 15th July 2008 at 08:15. Reason: fix syntax |
15th July 2008, 04:22 | #898 | Link |
likes to tinker
Join Date: Jan 2004
Location: girt by sea
Posts: 635
|
Did a quick search but couldn't spot how MT's "threads=N" divides up the source for input into each thread and deals with Width/Height issues such as Width and Height both not evenly divided by N.
Does anyone know, eg does MT "smartly" add borders before and remove afterward to avoid the issue, or do I have to do those calcs and Addborders myself ? Also, if N>2 what are the interpretations of MT's "splitvertical" parameter in those cases ? I guess it means something like "striped slices" into N vertical or horizontal segements. For MT's N>2, and thinking about optimal motion detection - given generally horizontal panning for my sources - does "splitvertical=false" ensure nice wide horizontal striped slices going into each thread (I know it's the default) ? On a quad core, is threads=3 optimal ? ie 3 for MT and one for HC; a 3800 frame test with Conv3D/LimitedSharpenFaster/spline36resize indicates a small elapsed time saving in N=4 over N=3 (only a few secs) whereas N=1 and N=2 and N=3 seem to have larger savings of 13 or 14 secs gaps. Last edited by halsboss; 15th July 2008 at 04:55. |
15th July 2008, 07:03 | #899 | Link |
likes to tinker
Join Date: Jan 2004
Location: girt by sea
Posts: 635
|
difference in encode times ?
I'm not sure why the following dramatic changes occur with HC023 encode times when using a function to encapsulate most of the filters - any suggestions ?
MT_Nthreads=2 38.2 fps MT_Nthreads=3 46.2 fps MT_Nthreads=4 49.8 fps from Code:
SetMemoryMax(256) WIDTH=704 HEIGHT=576 MT_Nthreads=2 MT_overlap=4 AviSource("G:\test\test-24Mb.avi", audio=false) AssumeFPS(25) global resizeWidth = 0 global resizeHeight = 0 global resizeBorderHalfHeight = 0 bh = wCalcResize(LAST, WIDTH, HEIGHT) ConvertToYUY2(interlaced=FALSE) MT("Convolution3D(0, 32, 128, 32, 128, 10, 0)",threads=MT_Nthreads,overlap=MT_overlap,splitvertical=false) MT("LimitedSharpenFaster(smode=4)",threads=MT_Nthreads,overlap=MT_overlap,splitvertical=false) MT("spline36resize(resizeWidth,last.height())",threads=MT_Nthreads,overlap=MT_overlap,splitvertical=false) MT("spline36resize(last.width(),resizeHeight)",threads=MT_Nthreads,overlap=MT_overlap,splitvertical=true) Addborders(0, resizeBorderHalfHeight, 0, resizeBorderHalfHeight) Converttoyv12() SetPlanarLegacyAlignment(True) MT_Nthreads=3 56.8 fps MT_Nthreads=4 59.7 fps from Code:
SetMemoryMax(256) WIDTH=704 HEIGHT=576 MT_Nthreads=2 MT_overlap=4 AviSource("G:\test\test-24Mb.avi", audio=false) AssumeFPS(25) global resizeWidth = 0 global resizeHeight = 0 global resizeBorderHalfHeight = 0 bh = wCalcResize(LAST, WIDTH, HEIGHT) ConvertToYUY2(interlaced=FALSE) Function wMulti(clip "inpclp") { zclp=inpclp.Convolution3D(0, 32, 128, 32, 128, 10, 0) zclp=zclp.LimitedSharpenFaster(smode=4) zclp=zclp.spline36resize(resizeWidth,zclp.height()) return zclp } MT("wMulti(LAST)",threads=MT_Nthreads,overlap=MT_overlap,splitvertical=false) MT("spline36resize(last.width(),resizeHeight)",threads=MT_Nthreads,overlap=MT_overlap,splitvertical=true) # unfortunately the height resize must be done separately since "splitvertical=true" is not the same as the rest Addborders(0, resizeBorderHalfHeight, 0, resizeBorderHalfHeight) Converttoyv12() SetPlanarLegacyAlignment(True) Last edited by halsboss; 15th July 2008 at 13:19. Reason: Edit1 typo. Edit2 it might be HC needing Distributor() ? |
16th July 2008, 22:35 | #900 | Link | |||
ангел смерти
Join Date: Nov 2004
Location: Lost
Posts: 9,558
|
MT("wMulti(LAST)",threads=MT_Nthreads,overlap=MT_overlap,splitvertical=false)
is equivalent to MT("Convolution3D(0, 32, 128, 32, 128, 10, 0) LimitedSharpenFaster(smode=4) spline36resize(resizeWidth,last.height())",threads=MT_Nthreads,overlap=MT_overlap,splitvertical=false) not three separate MTs. The perf drop is from all the back and forth copies being made when you split up the filters. Quote:
Quote:
Quote:
|
|||
Thread Tools | Search this Thread |
Display Modes | |
|
|