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.

 Doom9's Forum SimpleTransition
 User Name Remember Me? Password
 Register FAQ Calendar Search Today's Posts Mark Forums Read

 Thread Tools Search this Thread Display Modes
 13th July 2013, 16:52 #1  |  Link djcj Registered User   Join Date: Jun 2013 Location: Germany Posts: 44 SimpleTransition Usage: simpletransition(clip clip1, clip clip2, int overlap, int "mode", string "direction") Requires shubin's transition filter: http://avisynth.org/warpenterprises/...5_20040130.zip Example: Code: ```loadplugin("transition.dll") import("simpletransition.avs") clip1 = colorbars().trim(0,99) clip2 = clip1.greyscale().normalize(0.0) simpletransition(clip1,clip2,50) #simpletransition(clip1,clip2,50,2,"br2tl") #simpletransition(clip1,clip2,25,mode=4,direction="1")``` overlap: Amount of the last frames of clip1 and the first frames of clip2 overlapping. Just like dissolve() the final clip will be shorter than clip1+clip2. mode: 0 - Clip2 pushes Clip1 away 1 - Clip2 overlaps Clip1 2 - Clip1 will be "erased" and clip2 remains 3 - cirlce transition effect 4 - zoom transition effect direction: mode=0: "l2r", "r2l", "t2b" & "b2t". mode=1 and mode=2: "l2r", "r2l", "t2b", "b2t", "tl2br", "br2tl", "tr2bl" & "bl2tr". Explanation: "l2r" - left to right, "b2t" - bottom to top, "tr2bl" - top right to bottom left, etc. mode=3 and mode=4: "0" - inside out, "1" - outside in I hope you understand my explanations. PHP Code: ``` # Written by djcj # Last modified: June 25th 2013 # # Requires: Transition filter for Avisynth 2.5 - beta - by Shubin # function res(clip clp, clip rclp, int width, int height) { rclp = bilinearresize(rclp, width, height) overlay(clp, rclp, clp.width/2-rclp.width/2, clp.height/2-rclp.height/2) } function simpletransition(clip clip1, clip clip2, int overlap, int "mode", string "direction") { mode      = default(mode, 0) direction = default(direction, "l2r") dis   = dissolve(clip1,clip2,overlap).trim(clip1.framecount-overlap, clip1.framecount) clp1  = clip1.trim(0, clip1.framecount-overlap-1) clp2  = clip2.trim(overlap, 0) clip1 = clip1.trim(clip1.framecount-overlap, 0) clip2 = clip2.trim(0, overlap-1) overlayclip = direction=="l2r"   ? stackhorizontal(clip2,clip1) : \             direction=="r2l"   ? stackhorizontal(clip1,clip2) : \             direction=="t2b"   ?   stackvertical(clip2,clip1) : \             direction=="b2t"   ?   stackvertical(clip1,clip2) : nop() transition0 = direction=="l2r"   ? animate(0,overlap-1, "overlay", clip1,overlayclip, -clip1.width,0, clip1,overlayclip,0,0) : \             direction=="r2l"   ? animate(0,overlap-1, "overlay", clip1,overlayclip,            0,0, clip1,overlayclip,-clip1.width,0) : \             direction=="t2b"   ? animate(0,overlap-1, "overlay", clip1,overlayclip,0,-clip1.height, clip1,overlayclip,0,0) : \             direction=="b2t"   ? animate(0,overlap-1, "overlay", clip1,overlayclip,            0,0, clip1,overlayclip,0,-clip1.height) : nop() transition1 = direction=="l2r"   ? animate(clip2,0,overlap-1, "transition", clip1,"l",64,             0,            clip1,"l",64,clip1.width) : \             direction=="r2l"   ? animate(clip1,0,overlap-1, "transition", clip2,"l",64,   clip1.width,            clip2,"l",64,0) : \             direction=="t2b"   ? animate(clip2,0,overlap-1, "transition", clip1,"l", 0,0,clip1.height,            clip1,"l", 0,0,0) : \             direction=="b2t"   ? animate(clip1,0,overlap-1, "transition", clip2,"l", 0,0,           0,            clip2,"l", 0,0,clip1.height) : \             direction=="tl2br" ? animate(clip2,0,overlap-1, "transition", clip1,"l",32,0,clip1.height,            clip1,"l",32,clip1.width,0) : \             direction=="br2tl" ? animate(clip1,0,overlap-1, "transition", clip2,"l",32, clip2.width,0,            clip2,"l",32,0,clip2.height) : \             direction=="tr2bl" ? animate(clip1,0,overlap-1, "transition", clip2,"l",96, clip2.width,clip2.height, clip2,"l",96,0,0) : \             direction=="bl2tr" ? animate(clip2,0,overlap-1, "transition", clip1,"l",96,0,           0,            clip1,"l",96,clip1.width,clip1.height) : nop() transition2 = direction=="l2r"   ? animate(0,overlap-1, "overlay", clip1,clip2,-clip1.width,            0, clip1,clip2,0,0) : \             direction=="r2l"   ? animate(0,overlap-1, "overlay", clip1,clip2, clip1.width,            0, clip1,clip2,0,0) : \             direction=="t2b"   ? animate(0,overlap-1, "overlay", clip1,clip2,           0,-clip1.height, clip1,clip2,0,0) : \             direction=="b2t"   ? animate(0,overlap-1, "overlay", clip1,clip2,           0, clip1.height, clip1,clip2,0,0) : \             direction=="tl2br" ? animate(0,overlap-1, "overlay", clip1,clip2,-clip1.width,-clip1.height, clip1,clip2,0,0) : \             direction=="br2tl" ? animate(0,overlap-1, "overlay", clip1,clip2, clip1.width, clip1.height, clip1,clip2,0,0) : \             direction=="tr2bl" ? animate(0,overlap-1, "overlay", clip1,clip2, clip1.width,-clip1.height, clip1,clip2,0,0) : \             direction=="bl2tr" ? animate(0,overlap-1, "overlay", clip1,clip2,-clip1.width, clip1.height, clip1,clip2,0,0) : nop() radius      = int(sqrt( pow(clip1.width/2,2) + pow(clip1.height/2,2) )) transition3 = direction=="0" ? animate(clip1,0,overlap-1, "transition", clip2,"c",0, clip2,"c",radius) : \             direction=="1" ? animate(reverse(clip2),0,overlap-1, "transition", reverse(clip1),"c",0, reverse(clip1),"c",radius).reverse() : \             animate(clip1,0,overlap-1, "transition", clip2,"c",0, clip2,"c",radius) transition4 = direction=="0" ? animate(0,overlap-1, "res", clip1,clip2,4,4, clip1,clip2,clip2.width,clip2.height) : \             direction=="1" ? animate(0,overlap-1, "res", clip2,clip1,clip1.width,clip1.height, clip2,clip1,4,4) : \             animate(0,overlap-1, "res", clip1,clip2,4,4, clip1,clip2,clip2.width,clip2.height) return clp1++audiodubex(select(mode,transition0,transition1,transition2,transition3,transition4),dis)++clp2 }  ```