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 |
![]() |
#1 | Link |
Registered User
Join Date: Aug 2005
Posts: 127
|
Avisynth Script to determine filter results Vs Original Source
Hi,
I always wanted a way with avisynth, so as to determine what my video results would be without going through the long encoding process and vola!!!! after hours of reading heres how to go about it. I have used avisynth 2.5. - Copy a small part of your avi from your source using vdubmod as your sample clip. -Change your sample clip directory for Avisource() function - load the plugins used (see my script below) # # Script begins here... # ######################### # # Loading plugins and functions... # #################################### # LoadPlugin("d:\Program Files\avisynth plugins\AutoCrop.dll") LoadPlugin("d:\Program Files\avisynth plugins\avsmon25a.dll") LoadPlugin("d:\Program Files\avisynth plugins\blockbuster.dll") LoadPlugin("d:\Program Files\avisynth plugins\Convolution3DYV12.dll") LoadPlugin("d:\Program Files\avisynth plugins\DctFilter.dll") LoadPlugin("d:\Program Files\avisynth plugins\descratch.dll") LoadPlugin("d:\Program Files\avisynth plugins\ffavisynth.dll") LoadPlugin("d:\Program Files\avisynth plugins\FrameDbl.dll") LoadPlugin("d:\Program Files\avisynth plugins\MipSmooth.dll") LoadPlugin("d:\Program Files\avisynth plugins\MPEG2Dec3.dll") LoadPlugin("d:\Program Files\avisynth plugins\RemoveDirtSSE2.dll") LoadPlugin("d:\Program Files\avisynth plugins\RemoveGrainSSE2.dll") LoadPlugin("d:\Program Files\avisynth plugins\Sampler.dll") LoadPlugin("d:\Program Files\avisynth plugins\STMedianFilter.dll") LoadPlugin("d:\Program Files\avisynth plugins\UnDot.dll") LoadPlugin("d:\Program Files\avisynth plugins\UnFilter.dll") LoadPlugin("d:\Program Files\avisynth plugins\VSFilter.dll") #Filters Go below ######################### Avisource("D:\big\test.avi",false) blindPP(quant=2,cpu=4) Blockbuster(method="noise",detail_min=1,detail_max=3,variance=0.3,seed=1) removegrain(mode=1) #descratch(mindif=60) mipsmooth(preset="MovieHQ") filtered= last # If source video starts at different frame frameadjust=0 # Videos to compare: (v1 is original, v2 is the re-encoded(after applying filter)) v1 = Avisource("D:\big\test.avi",false).trim(frameadjust,0) v2 = filtered sub = v1.subtract(v2) substrong = sub.levels(122,1,132,0,255) return StackVertical(StackHorizontal(v1.subtitle("original"),v2.subtitle("encoded")),StackHorizontal(sub.subtitle("Difference"),substrong.subtitle("Difference amplified"))) ### End of Script Save the script as name.avs and run this using your media player (I used WMP). Now you can see the effects of the filters as scripted by you Vs Source and change dynamically till it meets your expectations. I also want to thank all avisynth forums and ppl who posted their scripts in them. Since I am very new to avisynth (5-10 days), those scripts have helped me to understand the functions better and helped me in creating this script to my needs. |
![]() |
![]() |
![]() |
#2 | Link | |
Registered User
Join Date: Mar 2004
Posts: 266
|
Here another by Dialhot from kvcd.net:
Quote:
__________________
Prodater64 |
|
![]() |
![]() |
![]() |
#3 | Link | |
Potentate
Join Date: Mar 2003
Posts: 219
|
Quote:
For my money, interleaving the original and filtered videos is the most accurate way to compare. You can single step through the frames and see the differences quite readily. Stacking (horizontal or vertical) will work too, but it is hard to see subtle changes that way.... T |
|
![]() |
![]() |
![]() |
#4 | Link |
Clouded
Join Date: Jul 2003
Location: Cambridge, UK
Posts: 1,148
|
I would add a proviso to all of this... there are different kind of noise and different kinds of distortion caused by filters, and the appropriate method to bring these out varies with the kind of phenomenon in question. I would say that whatever else you try you should use a least one method which involves playing the clip. (E.g. because strong spatial filters might yield frames which individually looked very good but which do not match the neighbouring frames closely enough to give a fluid result.)
I generally use two playback methods: one method which applies a filter to the right-hand side only (similar to the method in the second post), and one method which switches the filtering on and off every few seconds. I would personally avoid simple stacking methods because the requisite subsequent resizing will make it hard to notice a lot of phenomena. Subtract is useful in learning where distortion might occur so that you can look for it in the filtered clip, but once you have an idea of that I would switch it off, if no other reason than because you can't look at the subtract clip and the original/filtered clips at the same time.
__________________
a.k.a. Clouded. Come and help by making sure your favourite AVISynth filters and scripts are listed. |
![]() |
![]() |
![]() |
#5 | Link |
Registered User
Join Date: Jul 2005
Posts: 4
|
AMVApp has a few nice scripts in it called BeforeAfter and BeforeAfterLine.
An example of BeforeAfter can be seen here: http://www.amvwiki.org/index.php/Ima..._edgeenhan.png And hey, here are the scripts: http://www.amvwiki.org/index.php/BeforeAfter http://www.amvwiki.org/index.php/BeforeAfterLine |
![]() |
![]() |
![]() |
#9 | Link |
Registered User
Join Date: Apr 2006
Posts: 127
|
I tried all the above methods, basically all of them are splitting the original source into half, one half keep untouch and another half is applied filter(s) and then combine them back as one . However, the filtered half and unfilter half are two different portion of same scene and it is a little bit hard to compare the different how good or how bad of the filtered portion.
So is it possible to put unfilter and filtered portion as one e.g. all previous method Scene was divided into two parts, A and B A|B ---> A|B(filtered) new method should be A|B -----> A|A(filtered) or B|B(filtered) Hope yours unstand my question |
![]() |
![]() |
![]() |
#10 | Link |
Bored...
Join Date: Apr 2003
Location: Unknown
Posts: 2,812
|
Like this?
Code:
# _______________________________________________________ # # SBSC | Side By Side Compare # _______________________________________________________ # # Another lame function by Soulhunter... \m\ ^_^ /m/ # _______________________________________________________ # # # Usage examples: # # Original = AviSource("C:\Path\to\Source.avi") # Filtered = Original.FFT3DFilter(Sigma=1) # SBSC(Original,Filtered) # Function SBSC(Clip ClipA,Clip ClipB) { OX = ClipA.Width OY = ClipA.Height ClipB = ClipB.Lanczosresize(OX,OY) ClipA = ClipA.Crop(0,0,OX/2,OY).Subtitle("ClipA") ClipB = ClipB.Crop(0,0,OX/2,OY).Subtitle("ClipB") StackHorizontal(ClipA,ClipB) } |
![]() |
![]() |
![]() |
#11 | Link |
Squeeze it!
Join Date: Oct 2003
Location: Germany
Posts: 472
|
As you already add a Lanczosresize on the filtered so it matches the same pic size of the source .... think about this:
Code:
Function SBSC_Interleaved(Clip orig,Clip filtered) { OX = ClipA.Width OY = ClipA.Height ClipB = ClipB.Lanczosresize(OX,OY) ClipA = ClipA.Subtitle("Clip Orig") ClipB = ClipB.Subtitle("Clip Filtered") Interleave(ClipA,ClipB) } When switching between layers diffs will be more recognisable for human eyes compared to a horizontal stacked pic alignment. Last edited by Inc; 20th April 2006 at 10:51. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|