Floatingshed
7th May 2009, 20:48
I want to make a comparison demo of an original clip and a modified clip.
I can accomplish this by cropping and using stackhorizontal thereby arranging the two clips side by side and reforming a complete image. However.. Avisynth joins the two images so perfectly that the difference is not obvious enough.
I'd like to put a vertical black line at the point where the two clips meet so that there is a definate before and after.
I don't know how to do this, making an image of a line and overlaying it seems a bit crude...
Any suggestions most welcome.
Thanks.
Keiyakusha
7th May 2009, 21:09
a=Source1.Crop()
b=Source2.Crop()
stackhorizontal(a.AddBorders(0,0,4,0),b)
Maybe something like that?
Floatingshed
7th May 2009, 21:23
Of course.
Sometimes the brain needs someone else to kick start it!
Thanks.
MadRat
9th May 2009, 04:05
There's a couple of options for you. Your best bet is to use the program called AvsP that can let you open two or more different scripts in different tabs, preview each tab and switch back and forth between the previews. You can see the differences between each script and it'll change the way you encode. But for what you're asking you can make a split screen using this script:
##################################################################
# BeforeAfter by Absolute Destiny and Corran #
# e.g. #
# beforeafter(clip, placement, filters) or #
# #
# beforeafterline(clip, placement,filters) for a lined split #
# #
# 1 for vertical splitscreen, 0 for horizontal splitscreen #
# #
# Does not work on filters that use strings like deen("a3d",1) #
##################################################################
function beforeafter(clip a, int "placement", string "filters"){
placement = default(placement, 1)
Assert((float(width(a))/16)==round(width(a)/16), "Source image width must be a multiple of 16")
b=Eval("a."+filters)
c = (placement==1) ? stackhorizontal(a.crop(0,0,-((ceil(float(width(a))/32))*16),0).subtitle("before"),b.crop(((floor(float(width(a))/32))*16),0,0,0).subtitle("after")) :Stackvertical(a.crop(0,0,0,-height(a)/2).subtitle("Before"),b.crop(0,height(a)/2,0,0).subtitle("After"))
return c
}
function beforeafterline(clip a, int "placement", string "filters"){
placement = default(placement, 1)
Assert((float(width(a))/16)==round(width(a)/16), "Source image width must be a multiple of 16")
b=Eval("a."+filters)
c = (placement==1) ? stackhorizontal(a.crop(0,0,-((ceil(float(width(a))/32))*16),0).subtitle("before"),b.crop(((floor(float(width(a))/32))*16),0,0,0).subtitle("after")) :Stackvertical(a.crop(0,0,0,-height(a)/2).subtitle("Before"),b.crop(0,height(a)/2,0,0).subtitle("After"))
line = (placement!=1) ? blankclip(a,color=$FFFFFF).crop(0,0,(width(a)),4) : blankclip(a,color=$FFFFFF).crop(0,0,4,(height(a)))
d = (placement==1) ? overlay(c,line,x=width(a)-((ceil(float(width(a))/32))*16)-2) : overlay(c,line,y=height(a)-((floor(float(height(a))/32))*16)-2)
return d
}
Here's an example (I perfer having a line between my screens if you don't just leave out the word line):
beforeafterline(1,"tweak(3,4,2)")
This puts the left side of the original video and the right side of the filtered video side by side and alters the color on the right side of the preview. There's a thread you can read including other scripts (http://forum.doom9.org/showthread.php?t=98876) But really you should be using AvsP.
Gavino
9th May 2009, 09:04
# Does not work on filters that use strings like deen("a3d",1) #
But it does. You just need to use the triple-quote notation to construct a nested string literal.
eg BeforeAfter(1, """deen("a3d",1)""")
MadRat
10th May 2009, 04:09
Thanks, Gavino! I'm not being sarcastic when I say I would have never thought of that. :goodpost:
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.