Feeding Avisynth scipts to Shotcut (and other video software) on Windows

Hello all!

I’m building my video tool-chain anew (machine & OS change) and thought that using Avisynth with Shotcut directly could interest someone here.

What you’ll need:

  1. Avisynth (obviously), e. g. from here: https://avisynth.org.ru/ (different variants can be found by googling; the excellent documentation [wink! wink! :wink: ] itself is here: https://avisynth.org.ru/docs/english/);
  2. Pismo File Mount (http://pismotec.com/pfm/ – you’ll want to grab the “Audit package”);
  3. AVFS (For Avisynth Virtual File System) at http://turtlewar.org/avfs/;
  4. AvsP, a nice editor with syntax coloring and preview for Avisynth scripts (but you can use Notepad or your favorite editor): http://avisynth.nl/users/qwerpoi/Overview.html.

The first two are standard Windows installers. AVSF (3.) comes as a small executable in a Zip file, you just have to put it somewhere in your PATH (e. g. C:\Windows, it’s explained in the accompanying Readme.txt). The optional AvsP editor (4.) is portable, you store it anywhere you want (preferably not in “Program Files”).

This being done, associate the Avisynth file extension (.avs) with the avfs.exe thingy and you’re good.

How it works:
For those who don’t know it, Avisynth is a frame server with scripting language. You feed it video clips, they get filtered, resized, combined, &c. and the result is sent back to you. Works on soundtracks too, for extracting, resampling, mixing, and so on.
Without the 2. and 3. stuff Shotcut won’t load an .avs script directly (Virtualdub can do that… Wink! Wink!:wink:), so you’ll have to instruct Avisynth to save the result to some temporary video clip.

But if you jumped through all these loops, you’ll get virtual clips. Say you have some Test.avs script; double-click it, a console window will open, and a Test folder will appear in C:\Volumes where you’ll see a Test.avi file which can be opened in Shotcut. Just close the console when you’re done.

It’s a bit cumbersome, I’ll admit. On XP you could just right-click on the script, mount it, and it would automagically become a folder. Doesn’t work anymore on W10.

A commented example I slapped together for this post (BBcode “code” option works differently here? Changed the “sharp” Avisynth comment symbol to C-style //):

// Background clip 1920x1080
clip1 = directshowsource(“00018.MTS”)
// Overlay clip 640x480
// Gets upsized by 50%, then temporally reversed
clip2 = Reverse(Lanczos4Resize(directshowsource(“mvi_2624.avi”),960,720))
// Output
// clip2 gets overlaid over clip1 at position (800, 100), upper left corner coordinates
// and the result converted to RGB colorspace

And a screenshot of the result (the vids aren’t very spectacular, it’s just proof of concept):

Hope I haven’t bored you all to death with this long post! :thinking:

Nice find. Thanks for sharing. Some years ago I tinkered with Avisynth and VirtualDub. It was a black hole for time since you can tinker with your video for hours. AvsP was very nice for automating things a bit. Now that I run Linux those apps are out reach for me. I used to frame serve into Adobe Premiere Elements but when they upgraded to 64 bits the plug-in would no longer work. It wasn’t all that stable or fast on the hardware available back then. After all these years my standards have also changed. When you can create a really nice video in iMovie on an iPhone - never seeing a PC - the days of endlessly fiddling with video are done, at least for me. Unless you are doing archival quality restoration and preservation - and have lots of time on your hands - these tools are no longer as necessary.

Best - have fun!