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 Usage
Register FAQ Calendar Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 30th May 2015, 10:59   #1  |  Link
thescrapyard
Registered User
 
thescrapyard's Avatar
 
Join Date: Feb 2008
Posts: 59
Looking for BeforeDiff function

I'm trying different split screen side-by-side comparisons and settled on the functions I found beforeafter and beforeline suit my needs better than a simple stackhorizontal(clip1,clip2)

There was also another function called beforediff that displays what was changed to see exactly whats happening if doing line darkening or more extreme filtering but the AMVWiki.org has been down for years and all links I found point to that as the source for the functions, or the one below that is also unavailable


Does anybody have the original BeforeDiff functions so I can add it to the original

This was the original topic I started hunting from, but this website is coming back as unavailable or may not exist:

http://www.animemusicvideos.org/foru...p?f=11&t=45223


For those that are interested, here is what I eventually tracked down and put in one script. beforeafter was easy to find but beforeline I found in another topic while hunting for all 3 functions

Thanks


##################################################################
# 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
}


As mentioned in the script that it won't work with filters that uses strings, it DOES work with all filters that use strings as I found that suggested in another topic. Just add """ to calling the function call and it will work without any issues

Example :

beforeline(clip,1,"""deen("a3d",1)""")

Last edited by thescrapyard; 30th May 2015 at 11:06.
thescrapyard is offline   Reply With Quote
 


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 19:34.


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