vsoneliner generates VapourSynth script file for VSPipe from commandline. It is for the situation where only the simplest VapourSynth script is needed, and where writing and keeping a script file becomes cumbersome.
Install vsoneliner:
python -m pip install vsoneliner
An Example of using vsoneliner using fish shell:
INPUT=(realpath "input.mkv") av1an -i (python -m vsoneliner "import mvsfunc as mvf" "r\"$INPUT\" |> core.lsmas.LWLibavSource |> mvf.Depth\$(depth=10) |> .set_output()") -o "output.mkv" -
Excerpt:
python -m vsoneliner "import mvsfunc as mvf" "r\"$INPUT\" |> core.lsmas.LWLibavSource |> mvf.Depth\$(depth=10) |> .set_output()"
- Each positional argument to vsoneliner corresponds to one line in the resulting Python script. In this example, we have two lines:
import mvsfunc as mvf
andr"INPUT" |> core.lsmas.LWLibavSource |> mvf.Depth$(depth=10) |> .set_output()
. - vsoneliner by default imports
from vapoursynth import core
andimport vapoursynth as vs
, but any additional imports have to be written manually, such asimport mvsfunc as mvf
in the example. - vsoneliner accepts Coconut language in the commandline. Coconut language's syntax is a strict superset of Python, which means if you don't want to learn it, you can write vanilla Python code and it will work just fine. Here in this example,
r"INPUT" |> core.lsmas.LWLibavSource |> mvf.Depth$(depth=10) |> .set_output()
transpiles tomvf.Depth(core.lsmas.LWLibavSource(r"INPUT"), depth=10).set_output()
. - vsoneliner saves the commands to a Python file with
.vpy
file extension and then print the path to the file to stdout before exiting. Use$()
in a POSIX shell to feed this file to vspipe. vsoneliner also accepts--verbose
argument, with which vsoneliner will also print the path to the file to stderr.