VideoHelp Forum
+ Reply to Thread
Results 1 to 3 of 3
Thread
  1. Member
    Join Date
    Jan 2017
    Location
    Mauritius
    Search Comp PM
    Hi guys,

    You know how we load subs where we specify the start and end frame where it should appear.

    I want to load images like that...

    You see I need to load an image A, then let it stay on the screen while I add image B, and then C all being added say 5 secs after the other...

    But when I have to generate this using the Overlay and trim -
    e.g:
    Overlay(\
    Overlay(Main.trim(541,,dash1,40, 350,mode="blend",mask=dash1.ShowAlpha(), opacity=1)\
    .trim(601,0),dash2,40, 400,mode="blend",mask=dash2.ShowAlpha(), opacity=1)

    it becomes tedious, with lots of repetition of code, cause you have to overlay one image, and use that code and overlay the second image - and it's quite processor intensive... and when you have several images to add (as overlay over a running video) it becomes very annoying....

    So is there a way to simply specify start and end frames for an image to appear? like we do for the subs?

    Thanks,

    Reuben
    Quote Quote  
  2. Originally Posted by ReubenMru View Post
    it becomes tedious, with lots of repetition of code,
    So just write it as a function that takes the background video, the overlay video, and the starting/ending frame numbers. Here's a standalone example:


    Code:
    function OverlayAt(clip bg, clip ov, int start, int end, int x, int y)
    {
      # bg = background clip
      # ov = overlay clip
      # start = starting frame for overlay
      # end = ending frame for overlay
    
      beg = bg.Trim(0,start-1)
      mid = bg.Trim(start,end-1).Overlay(ov, x=x, y=y)
      end = bg.Trim(end,0)
    
      beg + mid + end
    }
    
    Main = ColorBars().Trim(0,499).RGBAdjust(r=0.3,g=0.3,b=0.3)
    dash1 = ColorBars().Trim(0,499).BilinearResize(128,128)
    dash2 = dash1.Invert().BilinearResize(128,128).TurnRight()
    
    Main
    OverlayAt(last, dash1, 100, 200, 200, 100)
    OverlayAt(last, dash2, 150, 250, 250, 150)
    Add in whatever other parameters you need.

    <edit>
    I modified the script I originally posted, adding parameters to set the x and y positions of the overlay, and smaller overlay images. As you can see, the overlays can overlap both spacially and temporally.
    </edit>
    Last edited by jagabo; 28th Jan 2017 at 08:19.
    Quote Quote  
  3. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    Just a quick question if I may... are you wishing to overlay videos or images over original video? Will they need to be all on screen at once as in different places? Will they ever need to be overlapped like image1=frame 160-180, image2= frame 170-190?
    Quote Quote  



Similar Threads

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