AviSynth and Motion-Estimation-Related Processing by QTGMC & MVtools 2

Looking for some user-friendly top-down explanation of sensible uses of AviSynth.

See Web-Research further below.

I expect to update this post.

Web-Research:

  • http://www.bubblevision.com/underwater-video/Vegas-YouTube-Vimeo.htm
    • AviSynth (with QTGMC/MVTools) workflow
    • Lengthy (explanatory, detailed) tutorial by Nick Hope
    • It incorporates QTMGC and MaskTools.
      • QTMGC can remove, preserve or strengthen visual noise and very fine detai
      • QTGMC makes an excellent job of deinterlacing and gives a sharper result than other methods such as simple field blending
      • QTGMC is slow, but once you have it working you can speed it up by using it multi-threaded, in a 32-bit or 64-bit environment.
    • There are 64-bit versions of Sony Vegas, DebugMode FrameServer, AviSynth (multi-threaded also), MVTools, RemoveGrain, MaskTools v2, nnedi3, x264
      • The tutorial identifies them and where to download.
  • http://www.sonycreativesoftware.com/forums/ShowMessage.asp?MessageID=794680&Replies=1
    • AviSynth Retime/Velocity + DeInt Combined?
    • Q: There are AviSynth scripts for deinterlacing and for retiming (fps) and/or velocity (e.g. faux-slomo) but are there any that combine the two processes (deint + retime/velocity) into a single operation? In principle, each requires motion estimation, which eats CPU time etc., so it would be good if that was only done once then shared by both processes
    • A (Nick Hope):
      •  Here’s how you might deinterlace and do slomo with QTGMC and MVtools2, lifted from a script I’m currently using a lot. The MVtools vectors created by QTGMC get re-used. There are 3 separate optional slomo lines in this script. Just use one of them and delete the others or comment them out with a #. You can of course adjust the ml value from the value of 100. I would try some extreme values to see what effect that has. 100 seems to work for me. More QTGMC help here. MVTools2 help here.
      • Code Block:
        QTGMC( SubPel=2 )
        super = MSuper(levels=1, pel=2)
        #MFlowFps(super, QTGMC_bVec1, QTGMC_fVec1, num=60000, den=1001) #50% speed @ 29.97p output or 100% @ 59.94p
        #MFlowFps(super, QTGMC_bVec1, QTGMC_fVec1, num=120000, den=1001, ml=100) #25% speed @ 29.97p output or 50% @ 59.94p
        MFlowFps(super, QTGMC_bVec1, QTGMC_fVec1, num=73260, den=1001, ml=100) #num=60000/playback rate for 59.94p
      • QTMG Help: http://www.bubblevision.com/underwater-video/Vegas-YouTube-Vimeo.htm
      • MVTools 2 Help: http://avisynth.org.ru/mvtools/mvtools2.html
    • http://www.sonycreativesoftware.com/forums/ShowMessage.asp?ForumID=4&MessageID=788836
      • Perfectionists’ PAL<=>NTSC Conversion
      • (by Nick Hope)
  • http://www.sonycreativesoftware.com/forums/ShowMessage.asp?ForumID=4&MessageID=780991
    • John Meyer’s Slow Motion Script
      • Code Block:
        loadplugin(“C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools2.dll”)
        setMTMode(5)
        AVISource(“E:\frameserver.avi”).Killaudio() )
        setMTMode(2,0)
        # the following is for DV, change to bff for HD
        assumebff()
        #converttoyv12(interlaced=true)  #Use this if incoming video is RGB
        source=Bob()
        super=MSuper(source,pel=2)
        backward_vec = MAnalyse(super,blksize=8, overlap=2, isb = true,  search=3 )
        forward_vec =  MAnalyse(super,blksize=8, overlap=2, isb = false, search=3 )
        # “num” equals result of 30 fps, times 2, multiplied by slo-mo factor
        # So, 60000 equals normal speed; 120000 equals 50% normal speed, etc.
        # For PAL, num=50, den=1 equals normal speed, so go from there
        MFlowFps(source,super,backward_vec, forward_vec, num=240000, den=1001, ml=500)
        assumebff().separatefields().selectevery(4,1,2).weave()
        assumefps(29.97,true) #Change this to match final framerate (25 for PAL)
  • http://www.sonycreativesoftware.com/forums/ShowMessage.asp?ForumID=4&MessageID=781110
    • SloMo – Velocity Envelope vs Twixtor vs AVISynt by: Nick Hope, 14 Oct 2011
    • Date: 10/14/2011 9:49:24 PM
    • … here’s a “general purpose” slo-mo script I’ve put together, minus the multi-threading code, for anyone starting with interlaced footage, and going down the AviSynth route for slo-mo. As this stands it is extremely slow. The vast majority of it consists of commented-out options and notes.
    • Code Block
      • # General purpose script for slower-than-50% slo-mo from interlaced source
        #Frameserve in RGB24 format (or RGB32 if AviSynth will not accept RGB24)
        AviSource(“d:\fs.avi”)
        AssumeTFF()
        ConvertToYUY2(interlaced=true, matrix=”Rec601″) #Rec601 is correct for encoding Ut Video Codec or Lagarith in Vdub
        QTGMC(SubPel=2) #SubPel must match pel in MSuper below
        super = MSuper(levels=1, pel=2)
        #Might need to create and tweak vectors if the QTGMC vectors produce artefacts
        #See http://forum.doom9.org/showthread.php?p=1510203#post1510203
        #backward_vec = MAnalyse(super,blksize=8, overlap=2, isb = true,  search=3 ) #JohnM
        #forward_vec =  MAnalyse(super,blksize=8, overlap=2, isb = false, search=3 ) #JohnM
        #”num” equals result of 30 fps, times 2, multiplied by slo-mo factor
        #So, 60000 equals normal speed; 120000 equals 50% normal speed, etc.
        #For PAL, num=50, den=1 equals normal speed, so go from there
        #MFlowFps(source,super,backward_vec, forward_vec, num=240000, den=1001, ml=500) #JohnM
        #ml default is 100. Try 49 or 500 etc to reduce artefacts
        #MFlowFps(super, QTGMC_bVec1, QTGMC_fVec1, num=96000, den=1001, ml=100) #25% speed @ 23.976p output
        #MFlowFps(super, QTGMC_bVec1, QTGMC_fVec1, num=100, den=1, ml=100) #25% speed @ 25p output or 50% speed @ 50i
        MFlowFps(super, QTGMC_bVec1, QTGMC_fVec1, num=120000, den=1001, ml=100) #25% speed @ 29.97p output or 50% @ 59.94i
        #Spline36Resize(1280,720)
        #Uncomment one of the following for progressive output
        #AssumeFPS(23.976) #For 24p output
        #AssumeFPS(25) #For 25p output
        AssumeFPS(29.97) #For 30p output
        #Uncomment the following 3 lines for interlaced output
        #separatefields()
        #SelectEvery(4,0,3)
        #Weave()
    • But if 50% is slow enough and you want progressive output from interlaced source then this gives a fantastic result:
    • Code Block:
      • # Script for 50% speed progressive output slo-mo from interlaced source
        #Frameserve in RGB24 format (or RGB32 if AviSynth will not accept RGB24)
        AviSource(“d:\fs.avi”)
        AssumeTFF()
        ConvertToYUY2(interlaced=true, matrix=”Rec601″) #Rec601 is correct for encoding Ut Video Codec or Lagarith in Vdub
        QTGMC(“faster”)
        Spline36Resize(1280,720)
        #Uncomment one of the following for progressive output
        #AssumeFPS(23.976) #For 24p output
        #AssumeFPS(25) #For 25p output
        AssumeFPS(29.97) #For 30p output

Leave a Reply

You must be logged in to post a comment.