Announcement

Collapse
No announcement yet.

AviSynth + VirtualDub2.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • AviSynth + VirtualDub2.

    Do you want to make side-by-side vids (like this one) with not complicated (but still very powerful) and free software?

    Here is the short and quite nonintuitive guide.

    1. Get and install following software:
    VitrualDub2: https://sourceforge.net/projects/vdfiltermod/
    Avisynth: http://avisynth.nl/index.php/Main_Page
    FFMS2 plugin: https://github.com/FFMS/ffms2/releases

    2. Shoot a couple of clips suitable for a side-by-side comparison. Put files into one folder. In my case I had two files named 'hdr-off.MP4' and 'hdr-on.MP4'.

    3. Get ready to deal with some basic scripting.

    The 1st AviSynth script (save as 01.avs, click to open with VirtualDub2):
    Code:
    #path to ffms2
    LoadPlugin("c:\Users\user\Downloads\vdub\ffms2-2.22-msvc\x86\ffms2.dll")
    #path to video files
    SetWorkingDir("d:\")
    
    #open with no audio and crop to 960x1080, use trim for sync
    a = FFMS2("hdr-off.mp4").KillAudio.Trim(0,0).Crop(0,0,-960,0)
    b = FFMS2("hdr-on.mp4").KillAudio.Trim(2,0).Crop(960,0,0,0)
    
    #put crops side by side
    StackHorizontal(a,b)
    
    #overlay some text
    Subtitle("HDR OFF", font="verdana", size=50, text_color=$ffff00, align=1)
    Subtitle("HDR ON", font="verdana", size=50, text_color=$00ff00, align=3)
    Subtitle("www.GoPrawn.com", font="verdana", size=40, text_color=$222222, align=2)
    
    #cut to 1min
    Trim(0,1800)
    Save lossless output. Select 'Video-Compression...-Uncompressed RGB' and press F7.

    Do the same with the 2nd script (save as 02.avs). My temp AVI files were named 'off-on.avi' and 'on-off.avi':
    Code:
    #path to ffms2
    LoadPlugin("c:\Users\user\Downloads\vdub\ffms2-2.22-msvc\x86\ffms2.dll")
    #path to video files
    SetWorkingDir("d:\")
    
    #open with no audio and crop to 960x1080, use trim for sync
    a = FFMS2("hdr-off.mp4").KillAudio.Trim(0,0).Crop(960,0,0,0)
    b = FFMS2("hdr-on.mp4").KillAudio.Trim(2,0).Crop(0,0,-960,0)
    
    #put crops side by side
    StackHorizontal(b,a)
    
    #overlay some text
    Subtitle("HDR OFF", font="verdana", size=50, text_color=$ffff00, align=3)
    Subtitle("HDR ON", font="verdana", size=50, text_color=$00ff00, align=1)
    Subtitle("www.GoPrawn.com", font="verdana", size=40, text_color=$222222, align=2)
    
    #cut to 1min
    Trim(0,1800)
    Use the 3rd one to render your final cut:
    Code:
    #path to ffms2
    LoadPlugin("c:\Users\user\Downloads\vdub\ffms2-2.22-msvc\x86\ffms2.dll")
    #path to video files
    SetWorkingDir("d:\")
    
    #open 10sec clips with fade in/out
    a = FFMS2("off-on.avi").Trim(0,299).FadeIn(10,$000000).FadeOut(5,$ffffff)
    b = FFMS2("on-off.avi").Trim(300,599).FadeIn(3,$ffffff).FadeOut(5,$ffffff)
    c = FFMS2("off-on.avi").Trim(600,899).FadeIn(3,$ffffff).FadeOut(5,$ffffff)
    d = FFMS2("on-off.avi").Trim(900,1199).FadeIn(3,$ffffff).FadeOut(5,$ffffff)
    e = FFMS2("off-on.avi").Trim(1200,1499).FadeIn(3,$ffffff).FadeOut(5,$ffffff)
    f = FFMS2("on-off.avi").Trim(1500,1800).FadeIn(3,$ffffff).FadeOut(5,$000000)
    
    #merge
    a + b + c + d + e + f
    Save with x264 codec and decent bitrate (~24Mbps would be enough for 1080p30).
    Last edited by nutsey; 10-14-2019, 06:19 PM.
    Donate here if you want to support my efforts and this site.

    Email me if you have any offers, requests or ideas.

  • #2
    Side by side comparison with thumbnailed video at the corner.


    This is how it's made (AVS script):
    Code:
    #change path to your plugin
    LoadPlugin("c:\..\vdub\ffms2-2.22-msvc\x86\ffms2.dll")
    
    #change path to your working folder with source files
    SetWorkingDir("r:\")
    
    #open stabilized 4k footage and convert it to 1080, change trim 1st 0 to cut from begining for sync
    a=FFMS2("01.mp4").KillAudio.Trim(0,0).Reduceby2.ConvertToYUY2
    
    #open 4k footage and convert it to 480x270
    b=FFMS2("02.mp4").KillAudio.Trim(0,0).Reduceby2.Reduceby2.Reduceby2.ConvertToYUY2
    
    #put b over a with 100% opacity, change trim 2nd 0 to cut total length
    Return Layer(a, b, "add", x=1440, level=255).Trim(0,0)
    Donate here if you want to support my efforts and this site.

    Email me if you have any offers, requests or ideas.

    Comment

    Working...
    X