Log in

View Full Version : Oyster (and other pythonic stuff)


boxxybot
16th November 2018, 00:00
I'm running ubuntu 18.10 with a cinnamon desktop. It took me a few days of research but I finally was able to build all the requisites to Oyster. I ran the autogen scripts and had no errors, but still am unable to get it to work. I suspect this is due to some pythonic path issues, but I'm at a complete loss here. When I go right into the folder containing oyster.py and run from the command line I'm told it still cannot find the other modules I built. Is there a basic howto somewhere explaining how these modules are loaded? Even when I copy the .py files into /usr/lib/python3.6 it still seems unable to locate these modules. I've been using a *nix desktop nearly my entire 56 years and some version of linux since the 90s and am still having troubles with this. I feel I must be missing something very basic.

vspipe test.vpy - | x264 - --output encoded.mkv
raw [error]: raw input requires a resolution.
x264 [error]: could not open input file `-'
Script evaluation failed:
Python exception: cannot import name 'Oyster'

Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1937, in vapoursynth.vpy_evaluateScript
File "src/cython/vapoursynth.pyx", line 1938, in vapoursynth.vpy_evaluateScript
File "test.vpy", line 1, in <module>
from vapoursynth import core,Oyster
ImportError: cannot import name 'Oyster'


script
============
from vapoursynth import core,Oyster
clip = core.ffms2.Source(source='DIE ANTWOORD - BANANA BRAIN (Official Video).mkv')
sup = Oyster.Super(clip)
ref_f = Oyster.Basic(clip, sup, short_time=False)
ref_s = Oyster.Basic(clip, sup, short_time=True)
clip = Oyster.Deblocking(clip, ref_f, block_step=2)
clip = Oyster.Deringing(clip, ref_s, sigma=24.0, h=10.8, block_step=2)
#video = core.std.Transpose(video)
video.set_output()

Wolfberry
16th November 2018, 02:30
Although I'm not very familiar with Linux, I can see one problem in your script.

from vapoursynth import core,Oyster
This cannot be right, the vapoursynth python module certainly doesn't have Oyster in it.
Rather, you should use from vapoursynth import core
import Oyster (as ...) and see if that works for you.

boxxybot
16th November 2018, 03:05
Thanks. Doh!. Frustration from spending four days waiting for posting auth here and having to build some packages with slightly misleading error messages...

Progress:
from vapoursynth import core
import Oyster, MVTools
clip = core.ffms2.Source(source='DIE ANTWOORD - BANANA BRAIN (Official Video).mkv')
sup = Oyster.Super(clip)
ref_f = Oyster.Basic(clip, sup, short_time=False)
ref_s = Oyster.Basic(clip, sup, short_time=True)
clip = Oyster.Deblocking(clip, ref_f, block_step=2)
clip = Oyster.Deringing(clip, ref_s, sigma=24.0, h=10.8, block_step=2)
#video = core.std.Transpose(video)
video.set_output()

Output:

vspipe test.vpy - | x264 - --output encoded.mkv
raw [error]: raw input requires a resolution.
x264 [error]: could not open input file `-'
Script evaluation failed:
Python exception: No module named 'mvmulti'

Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1937, in vapoursynth.vpy_evaluateScript
File "src/cython/vapoursynth.pyx", line 1938, in vapoursynth.vpy_evaluateScript
File "test.vpy", line 2, in <module>
import Oyster, MVTools
File "/usr/lib/python3.6/Oyster.py", line 3, in <module>
import mvmulti
ModuleNotFoundError: No module named 'mvmulti'

I get error message whether or not I import "MVTools." Strangely, I get no error when importing MVTools so I must assume not a bad namespace.

$ ls -1 /usr/local/lib
libdfttest.la
libdfttest.so
libfmtconv.la
libfmtconv.so
libmvtoolssf.la
libmvtoolssf.so
libnnedi3.la
libnnedi3.so
python2.7
python3.6
vapoursynth

I feel the need for a linux thread on this. most of the discussion I've found here seems to be people running this, ironically, on windows. Were I using Windows I'd just pull avisynth 2.6 and build it. I contributed a lot of code to that, ages ago. Vapoursynth seems to be what I always wished avisynth would be, but it's taken me nearly a week of free time and still no air... er, vapour.

ChaosKing
16th November 2018, 12:00
Mvtools is a plugin and not a script, so you don't need (or can't) import it.
mvmulti: https://github.com/IFeelBloated/vapoursynth-mvtools-sf/blob/master/src/mvmulti.py
You also need mvtools-sf (not mvtools) for Oyster https://github.com/IFeelBloated/vapoursynth-mvtools-sf

qyot27
16th November 2018, 17:03
vspipe --y4m test.vpy - | x264 --stdin y4m - --output encoded.mkv
Small nit: use y4m so it doesn't complain about the raw input/resolution stuff.

I get error message whether or not I import "MVTools." Strangely, I get no error when importing MVTools so I must assume not a bad namespace.

$ ls -1 /usr/local/lib
libdfttest.la
libdfttest.so
libfmtconv.la
libfmtconv.so
libmvtoolssf.la
libmvtoolssf.so
libnnedi3.la
libnnedi3.so
python2.7
python3.6
vapoursynth

Unless something's changed, I'm pretty sure VS doesn't autoload from /usr/local/lib; it autoloads from the vapoursynth subdirectory. Symlink them in there and it should work.

boxxybot
17th November 2018, 03:54
Aha! More clues. I created that vapousynth folder manually in /usr/local/lib. It's this whole "plugins" thing that's screwing with me - it's not pythonic. I get the same error message after putting those modules in the vapoursynth folder. So how, in linux, do I set this vapoursynth "plugin" path?

qyot27
17th November 2018, 04:41
VapourSynth itself has $libdir/vapoursynth as a default value for SystemPluginDir, which is the value in vapoursynth.conf (should one exist) that can set the system autoload path for plugins (UserPluginDir can set it for non-system locations). (http://www.vapoursynth.com/doc/autoloading.html) So effectively, there should be no need to set it, unless you want to use a different location.

What's more important, particularly since you mentioned this is Ubuntu, is how did you install the plugins (dfttest, fmtconv, mvtools-sf, and nnedi)? Did you just sudo make install, and leave it at that, or did you also follow it with sudo ldconfig? Because they are regular libraries, they do need ldconfig run on them before the OS can find them.

boxxybot
18th November 2018, 20:46
After struggling with error messages a day and a half, I installed VS from the apt packages provided in the ppa. It did not create a $LIBDIR/vapoursynth folder or any other. As I said, I created the vapousynth folder in /usr/local/lib. After moving the libraries there and running ldconfig I still get the same error messages.

I built the tools following the directions provided. If those are inaccurate then that explains by questions here.

Can I get a straight answer? How exactly does one install a fully working system (with plugins) in ubuntu? Thanks.

boxxybot
19th November 2018, 04:44
Autoloading can be configured using the file $XDG_CONFIG_HOME/vapoursynth/vapoursynth.conf, or $HOME/.config/vapoursynth/vapoursynth.conf if XDG_CONFIG_HOME is not defined.

After installing the packages, neither /home/user/vapoursynth, /home/user/.config/vapoursynth, nor /home/user/.vapoursynth, was created, I've not tried creating any of these.

Two configuration options may be used: UserPluginDir, empty by default, and SystemPluginDir, whose default value is set at compile time to $libdir/vapoursynth, or to the location passed to the --with-plugindir argument to configure.

When placing Oyster in /usr/lib/python3.6, Oyster is imported but the packages imported by Oyster are not found.

Example vapoursynth.conf:

UserPluginDir=/home/asdf/vapoursynth/plugins
SystemPluginDir=/special/non/default/location

vapoursynth.conf also does not exist in my system...

I located the other plugins in /usr/lib/x86_64-linux-gnu/vapoursynth/
After moving the mods there, mvmulti is still not found for import.

ls -1 /usr/lib/x86_64-linux-gnu/vapoursynth/
addgrain.so
awarpsharp2.so
bifrost.so
bilateral.so
bm3d.so
cnr2.so
combmask.so
convo2d.so
ctmf.so
d2vscan.pl
d2vsource.so
damb.so
dctfilter.so
deblockpp7.so
deblock.so
degrainmedian.so
delogo.so
depan.so
dfttest.so
eedi2.so
eedi3.so
f3kdb.so
ffms2.so
fft3dfilter.so
fieldhint.so
fillborders.so
fluxsmooth.so
fmtconv.so
genericfilters.so
histogram.so
hqdn3d.so
imagereader.so
it.so
knlmeanscl.so
libbm3d.so
libdfttest.la
libdfttest.so
libeedi3.so
libfmtconv.la
libfmtconv.so
libimwri.so
libmiscfilters.so
libmorpho.so
libmvtoolssf.la
libmvtoolssf.so
libnnedi3.la
libnnedi3.so
libocr.so
libremovegrain.so
libsubtext.so
libvinverse.so
libvivtc.so
lsmashsource.so
models
msmoosh.so
mvtools.so
nnedi3.so
rawsource.so
readmpls.so
reduceflicker.so
retinex.so
sangnommod.so
scenechange.so
scrawl.so
scxvid.so
ssiq.so
tc2cfr.so
tcanny.so
tcomb.so
tdeintmod.so
templinearapproximate.so
temporalsoften2.so
temporalsoften.so
tnlmeans.so
ttempsmooth.so
vaguedenoiser.so
vautodeint.so
videoscope.so
w3fdif.so
waifu2x-opt.so
waifu2x-w2xc.so
wwxd.so
yadifmod.so

Are_
19th November 2018, 23:52
All these vapoursynth.conf locations are in case you want to overwrite the defaults, you have to create it yourself to a location of your liking, if you want.

There are plugins (binaries) and python modules (scripts). Oyster and mvmulty are modules and they go into /usr/lib64/python3.X/site-packages or something like that.

Plugins can auto-load and are better that way, modules cant.

EDIT: Sorry if I'm stating the obvious but you have a problem most probably with a simple solution and I don't really understand everything you are doing, specifically with the python modules.