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 |
28th September 2003, 02:48 | #1 | Link |
Registered User
Join Date: Mar 2003
Location: Tucson, AZ
Posts: 62
|
transitioning between 2 diff. clips using a greyscale picture.
Is there a filter for avisynth that could blend two defined clips together in dissolve like pattern, but use a greyscale jpg, png or bmp picture that would tell the filter which parts of the 1st clip should become the 2nd clip faster.
so, for example the picture is 0 black on the right and 255 black on the left, in the middle there are gradual steps in blackness. that should result in a wipe-like transition, where black would convert to the new clip's frames before the white. but the point is not the wiping but using different black an white pictures that would make very nice transitions in the video. This is one of the possibilities in pinnacle studio 8 called "alpha magic", that keeps me from a complete conversion to avs scripting... |
28th September 2003, 22:00 | #2 | Link |
AviSynth Enthusiast
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
|
You can do it, but it's kind of ugly. AviSynth's masking tools currently are a bit limited. Here's a generalized version of Datacable's FuzzyWipe function:
Code:
function MaskTransition(clip c1, clip c2, clip transitionMaskClip) { assert(c1.IsRGB32() && c2.IsRGB32() && transitionMaskClip.IsRGB32(), \ "MaskTransition: clips must be RGB32") assert( c1.FrameRate() == c2.FrameRate() \ && c1.FrameRate() == transitionMaskClip.FrameRate(), \ "MaskTransition: frame rates don't match") assert( c1.Width() == c2.Width() && c1.Width() == transitionMaskClip.Width() \ && c1.Height() == c2.Height() && c1.Height() == transitionMaskClip.Height(), \ "MaskTransition: frame sizes don't match") overlap = transitionMaskClip.FrameCount() assert(c1.FrameCount() > overlap && c2.FrameCount() > overlap, \ "MaskTransition: clips must be longer than the transition") assert(overlap > 0, "MaskTransition: invalid transition length") seg1 = c1.Trim(0, -(c1.FrameCount() - overlap)) seg2 = c2.Trim(overlap, 0) trans1 = c1.Trim(c1.FrameCount() - overlap, 0) trans2 = c2.Trim(0, -overlap).Mask(transitionMaskClip) trans = Layer(trans1, trans2) return AudioDub(seg1 + trans + seg2, Dissolve(c1, c2, overlap)) } Here's sample usage: Code:
clip1 = ColorBars(640, 480).AssumeFPS(29.97).Trim(0, -500).ShowFrameNumber() clip2 = clip1.Levels(0, 1.0, 255, 255, 0) # invert # D:\ramp.png is a 640x480 grayscale image that defines the mask ramp = ImageReader("D:\ramp.png", 0, 0, 1, false).ConvertToRGB32() ramp = ramp.AssumeFPS(clip1.FrameRate()).Loop(50) # animate from black to white... this isn't very smooth and could be # improved greatly ramp = Animate(ramp, 0, 50, "Levels", \ 235, 1.0, 255, 0, 255, \ 0, 1.0, 20, 0, 255) MaskTransition(clip1, clip2, ramp) Rewrote what I originally posted. I had forgotten that Datacable had done something similar (and better) than this post's old content. Edit 2: An updated version is available from: http://www.avisynth.org/stickboy/ Last edited by stickboy; 7th July 2004 at 09:36. |
23rd January 2004, 14:52 | #3 | Link |
Registered User
Join Date: Jun 2003
Location: Berlin, Germany
Posts: 26
|
by using this script along with a greyscale transition movie clip, e.g. a small black rectangle growing to a black screen, you can reproduce many of the oh-so-shiny studio 8 "alpha magic" effects.
using flash to create a greyscale transition movie and SWF2Video for AVI conversion, i created some most exciting effects. only problem i have: both clips, hidden behind the other or not, are always fullsize, so i haven't found a way to grow the clip itself, actually just the visible area of the clip grows. anybody got a good idea for that? this would make studio 8 obsolete. Zap |
23rd January 2004, 18:24 | #4 | Link | |
Registered User
Join Date: Jan 2003
Location: Barcelona
Posts: 68
|
Re: transitioning between 2 diff. clips using a greyscale picture.
Quote:
http://forum.doom9.org/showthread.php?s=&threadid=69155 I'd appreciate any suggestions/comments. Albert |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|