I have managed to wrap VapourSynth. Just the bare minimum to get something working. It has been a good exercise to learn Nim and to start loving the language. Thank you all for your support.
The code is crappy (my code I mean), but the result really surprised me.
VapourSynth aims to have compatibility with AviSynth. I would say that VapourSynth aims to be a replacement keeping compatibility with all the filters and scripts from AviSynth.
AviSynth has his own scripting language. You can see how it looks here.
There is a python wrapper for VapourSynth which makes it look like (from here):
from vapoursynth import core
video = core.ffms2.Source(source='Rule6.mkv')
video = core.std.Transpose(video)
video.set_output()
then you can play it with vspipe and ffmpeg (or compress it):
vspipe --y4m script.vpy - | ffmpeg -i pipe: encoded.mkv
So, how can Nim improve from there? Well, the equivalent Nim script looks like:
import src/vapoursynth
Source("test/2sec.mkv").Transpose.Pipey4m
you compile it (into myfile for example) an play it back by means of:
./myfile | mplayer -idx -
the myfile takes just 250kb.
So all this effort to get this:
I almost forgot, the link to the code: VapourSynth.nim.
Lot of work ahead.
Very nice
Does it works with filters/plugins already? Say FFT3D or masktools I would guess we would need to create a Nim wrapper for each filter.
FFT3D should work (I haven't tried).
I think Masktools are not available as a plugin for VapourSynth. If I am wrong, let me know and I will wrap it.