VideoHelp Forum

+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. Member
    Join Date
    Dec 2008
    Location
    Spain
    Search Comp PM
    I have a set of 100 images and I would like to convert them into a video with crossfade between images.

    I need each image to be shown for 5 seconds then to crossfade to the next.

    Is it possible to do that in AviSynth?

    I am using Windows 8.1

    The images are in JPG format but I can convert them to PNG or other format if required
    Quote Quote  
  2. Not sure whether there isn't an easier solution, but something along the lines of:
    Code:
    LoadPlugin("PATH TO ImageSeq.dll") # http://avisynth.nl/index.php/ImageSequence
    LoadPlugin("PATH TO GScript_26_32.dll") # http://avisynth.nl/index.php/GScript
    
    # "I need each image to be shown for 5 seconds then to crossfade to the next."
    #  ->A assuming a target fo 25 fps each frame needs to be repeated 25*5 = 125 times
    # Assuming the frame are named 001.jpg to 400.jpg
    clip = ImageReader(file="E:\sequence\Wallpaper\%03d.jpg", start=1, end=400, fps=25.0/125.0, use_DeviL=true, pixel_type="RGB24")
    clip = clip.ChangeFPS(25) 
    # now each frame is repeated 125 times | 5fps and thus is shown five seconds
    
    # now we add between crossfades with a length of fade_length of frame between the 5 second segments
    fade_length = 50
    result=BlankClip(length=0, width=clip.Width(), height=clip.Height, pixel_type=clip.PixelType(), fps=clip.FrameRate(),audio_rate=0)
    GScript("""
    for ( pos = 0, (clip.FrameCount()/125)-1, 1) {
       tmp = Dissolve( clip.Trim( pos*125, pos*125+fade_length/2 ), clip.Trim((pos+1)*125,(pos+1)*125+fade_length/2 ) , fade_length)
       result = result ++ clip.Trim( pos*125, (pos+1)*125 -1) ++ tmp ++ clip.Trim( pos*125, (pos+1)*125 -1)
    }
    """)
    
    return result
    should do the trick.
    (iirc. there was a slide show maker based on Avisynth, but I forgot it's name)

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  3. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    There is an Avisynth called TransAll for multiple types of transitions if you have the videos already made upmade up:

    Image
    [Attachment 59942 - Click to enlarge]


    The Avisynth script goes something like the following. There are many setting to change the output as you can see0

    Image
    [Attachment 59941 - Click to enlarge]


    The script:
    Code:
    a=DirectShowSource("C:\Users\Bud\Desktop\test.mp4",pixel_type="yuy2").ResampleAudio(48000).Spline36Resize(852,480).ConvertFPS(29.97).trim(1,149)
    b=DirectShowSource("C:\Users\Bud\Desktop\test.mp4",pixel_type="yuy2").ResampleAudio(48000).Spline36Resize(852,480).ConvertFPS(29.97).trim(1,149)
    c=DirectShowSource("C:\Users\Bud\Desktop\test.mp4",pixel_type="yuy2").ResampleAudio(48000).Spline36Resize(852,480).ConvertFPS(29.97).trim(1,149)
    d=DirectShowSource("C:\Users\Bud\Desktop\test.mp4",pixel_type="yuy2").ResampleAudio(48000).Spline36Resize(852,480).ConvertFPS(29.97).trim(1,149)
    aa = TransPush(a,b, 59,"left")
    ba = TransAccord(aa , c, 59,"hor",true,false)
    ca = TransBubbles(ba , d, 59)
    vid=ca
    newvid = vid.ChangeFPS(29.97).Spline36Resize(854,480)
    newvid
    Quote Quote  



Similar Threads