Search code examples
overlayavisynth

Overlay several images on a video with Avisynth


I've read a lot of tutorials on how to overlay an image in AviSynth, but wonder if there is a way to place several images on a video at specific time positions. I've been able to render videos with a transparent png logo, but didn't find any tutorial how to place different images at different frame positions.


Solution

  • I believe you have to figure out time positions from the frame rate. For instance the below sample will show the overlay image between 101 - 200 frames (4th to 8th second):

    AviSource("sample.avi", false).AssumeFPS(25).ConvertToRGB
    img = ImageSource("sample.png")
    
    Trim(0, 100) + Trim(101, 200).Overlay(img, 20, 30, opacity = 0.5) + Trim(201, 0)