Log in

View Full Version : Just starting out with VapourSynth


MysteryX
24th May 2018, 20:33
I wrote several plugins for Avisynth including FrameRateConverter and AvisynthShader. I'm finally taking a first look into VapourSynth to see whether it would be easy to convert those filters.

In doing so I have a few questions.

1. How is ConditionalFilter done in VapourSynth? I had written ConditionalFilterMT to make it work in MT but I guess that shouldn't be necessary here.

2. How are string arguments handled in VapourSynth?

3. What are the main differences to look for in supporting VapourSynth vs Avisynth?

Anything else I should know?

amichaelt
24th May 2018, 22:35
Pretty much everything you're asking about is covered by the Vapoursynth docs (http://www.vapoursynth.com/doc/). It even has a section called "common pitfalls".

TheFluff
25th May 2018, 02:32
1. pretty much all of the avisynth runtime stuff is doable with some combination of core.std.FrameEval and general purpose Python scripting

2. what?

3. some things off the top of my head in no particular order:
- getframe is asynchronous
- frames can have metadata (even other frames or entire clips) attached to them so a lot of scripting things that are really awkward or require global state in avisynth are trivially easy
- planar rgb only
- the scripting layer isn't nearly as tightly bound to the api as in avisynth
- alpha isn't stored as a color channel, instead you attach the alpha "channel" in the form of a separate grayscale clip as metadata to the original clip

jackoneill
25th May 2018, 06:45
2. Everything's supposed to be UTF8, so that's how you should save your scripts too. It Just Works.

3. Try to make your plugins usable in Linux and OS X too.

amayra
25th May 2018, 16:50
2) - you should have some knowledge about python as first step

MysteryX
28th May 2018, 23:12
I thought the best way to learn VapourSynth SDK would be to back-port a VapourSynth plugin to Avisynth. Porting Deblock right now; so far things are going well.

I notice there's more code in VapourSynth to parse parameters, handle errors and handle calls from the core.

I'm also wondering, is it possible for the same DLL to support both VapourSynth and Avisynth, or it needs to be 2 separate projects?

DJATOM
28th May 2018, 23:19
https://forum.doom9.org/showthread.php?t=175339

videoh
28th May 2018, 23:49
I'm also wondering, is it possible for the same DLL to support both VapourSynth and Avisynth, or it needs to be 2 separate projects? Yes, a single DLL that can support both is easy to make. The challenge, as DJATOM points out, is to do it without having to duplicate code. I still haven't found a good solution and just bite the bullet and duplicate what I have to.