VapourSynth installation on Debian or Mint systems

22:12:00 , 0 Comments

Picture from Bart Everson New Orleans, Louisiana, USA


VapurSynth is an application for video manipulation and an excellent alternative to avisynth for many reasons:
  • Works on linux natively, the core is written in C ++ and modules use Python.
  • Multithreaded ,avisynth needs third-party software to run in multithreaded mode.
  • Compatible with a large number of Avisynth plugins
  • Additional metadata can be attached to frames
  • An optional graphical editor in QT5 is avaliable, to create scripts, making crops , etc ...


Installation:

First time, we are going to install all required dependencies :

apt-get install build-essential yasm git libavcodec-dev libswscale-dev libass-dev python3-pip python3-dev cython dh-autoreconf autotools-dev

Then we are ready to clone into the git with the latest source code:

git clone https://github.com/vapoursynth/vapoursynth.git
A new directory called vapoursynth will be created with a recent copy of the repository inside, enter the directory to prepare the sources and compile:

cd vapoursynth
./autogen.sh
./configure --disable-ocr
make
make install
*Note I removed OCR support because is not needed. If you need it, first install this dependencies:

apt-get install libtesseract-dev tesseract-ocr 
Now vapoursynth is installed in our system and ready to use if you changed defaults install path.

Troubleshooting:

Run this command line:

$ vspipe -v

If it doesn't work, sure you need to edit the user path:

If it show: "library libvapoursynth-script.so missing or not found" put this couple of lines in a terminal like user:


LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"
export LD_LIBRARY_PATH
If it show:
Failed to initialize VapourSynth environment

We can fix it adding a couple more of lines:

PYTHONPATH="${PYTHONPATH}:/usr/local/lib/python3.4/site-packages"
export PYTHONPATH
To avoid writing this, each time we launch vspipe, we need to editing .bashrc .It is located in our user $home

*Note the point before the name, tell us the file is hidding.

As user:

cd
it take us to our $home
then we can use nano as our terminal editor:

nano -w .bashrc
add the following to it:

LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"
export LD_LIBRARY_PATH
PYTHONPATH="${PYTHONPATH}:/usr/local/lib/python3.4/site-packages"
export PYTHONPATH
also we can use "echo" or a graphical editor like gedit.
Once made these changes will see that the output has changed:

$ vspipe -v
VapourSynth Video Processing Library
Copyright (c) 2012-2014 Fredrik Mellbin
Core R26
API R3.1
It works !!!

Making our first script:


We are ready to write our first script and then encode it with x264

Example:

vspipe --y4m script.vpy - | x264 --demuxer y4m - --output encoded.mkv
If x264 is not already installed put this in a terminal:

apt-get install x264
Scripts has vpy extension, an example as could be:

import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin('/usr/lib/x86_64-linux-gnu/libffms2.so.3')
ret = core.ffms2.Source(source='/ruta/archivo/prueba.mkv')
ret = core.std.CropRel(clip = ret, left=0, right=0, top=20, bottom=20)
ret = core.std.AssumeFPS(clip=ret, fpsnum=24000, fpsden=1001)
ret.set_output()

*Line 3 is needed to create a index, we indicate the library path in our system. Rest is very similar to Avisynth, and easy to understand.

0 comentarios: