VideoHelp Forum




+ Reply to Thread
Results 1 to 3 of 3
  1. Member
    Join Date
    May 2011
    Location
    Sweden
    Search PM
    I don't need fade to black or white but fade out to transparency (basically the overlay image to gradually disappear). Can anyone help me with a working script?
    Quote Quote  
  2. The Animate() filter lets you vary settings over a number of frames. You can use that along with Overlay().

    Code:
    function MyOverlay(clip v1, clip v2, float alpha) # overlay v2, onto v1, with the given transparency
    {
        Overlay(v1, v2, opacity=alpha) # overlay v2, onto v1 with specified opacity
    }
    
    # create a couple video streams
    background = ColorBars(pixel_type="YV12")
    foreground = BilinearResize(background, background.width/2, background.height/2)
    
    # fade out over frames 0 to 30
    Animate(0, 30, "MyOverlay",    background, foreground, 1.0,    background, foreground, 0.0)
    Quote Quote  
  3. Member
    Join Date
    May 2011
    Location
    Sweden
    Search PM
    Originally Posted by jagabo View Post
    The Animate() filter lets you vary settings over a number of frames. You can use that along with Overlay().

    Code:
    function MyOverlay(clip v1, clip v2, float alpha) # overlay v2, onto v1, with the given transparency
    {
        Overlay(v1, v2, opacity=alpha) # overlay v2, onto v1 with specified opacity
    }
    
    # create a couple video streams
    background = ColorBars(pixel_type="YV12")
    foreground = BilinearResize(background, background.width/2, background.height/2)
    
    # fade out over frames 0 to 30
    Animate(0, 30, "MyOverlay",    background, foreground, 1.0,    background, foreground, 0.0)
    Thanks, it worked! For future reference, I adapted this script to set the x and y coordinates of the overlay:

    Code:
    function OverlayImage(clip v1, clip v2, int x, int y, float alpha) # overlay v2, onto v1, with the given transparency
    {
        Overlay(v1, v2, x, y, opacity=alpha) # overlay v2, onto v1 at x, y coordinates with specified opacity
    }
    
    img=ImageSource("overlay.png")
    Animate(0, 10, "OverlayImage", last, img, 500, 420, 1.0, last, img, 500, 420, 0.0)
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!