View Full Version : Vapoursynth
asarian
5th April 2016, 00:42
Is that the correct .dll or a typo ?
In the older version I'm using it's vsfs.dll , not vsvfw.dll
Things might have changed, if it's vsvfw.dll, try calling it with vsvfw neela.vpy
Also there might some differences with portable vs installed version. I'm using an old installed version
Yeah, that was a typo. :) (I looked at the wrong dll). This is from the cmd output:
F:\jobs>pfm register "C:\Program Files (x86)\VapourSynth\core64\vsfs.dll"
Registering formatter "C:\Program Files (x86)\VapourSynth\core64\vsfs.dll".
F:\jobs>vsfs neela.vpy
'vsfs' is not recognized as an internal or external command,
operable program or batch file.
F:\jobs>start vsfs neela.vpy
The system cannot find the file vsfs.
poisondeathray
5th April 2016, 00:50
How did you run AVFS ? If are running an older pismo mount package, then it's right click in the context menu => mount
Otherwise, I don't know, sorry
asarian
5th April 2016, 01:10
How did you run AVFS ? If are running an older pismo mount package, then it's right click in the context menu => mount
Otherwise, I don't know, sorry
Odd. I installed the latest Pismo File Mount Audit Package build 181 (just installed everything VS two days ago); yet it still has a context right-click 'mount' option (wasn't that supposed to be gone?!). And the mount option, surprisingly, is actually the thing that works. :) The Pismo system shows 'vsfs' as a registered package, so it's all good.
Not sure why I can't make 'vsfs' work from a command prompt; but, then again, I'm thinking it maybe really was meant to only work via that mount option.
Anyway, thank you kindly for your assistence! :)
asarian
5th April 2016, 09:39
Hmm, this gives me green borders:
vid = core.std.AddBorders (clip=vid, left=240, right=240, top=0, bottom=0, color=[0, 0, 0])
That can't be right. :) (Found the syntax for AddBorders on this forum, btw: manual doesn't say how, does it?)
Myrsloik
5th April 2016, 09:41
Hmm, this gives me green borders:
vid = core.std.AddBorders (clip=vid, left=240, right=240, top=0, bottom=0, color=[0, 0, 0])
That can't be right. :) (Found the syntax for AddBorders on this forum, btw: manual doesn't say how, does it?)
Sure it's right. If ypu have a yuv clip you need to specify the color as yuv, not rgb. Or skip iy since it defaults to black anyway.
asarian
5th April 2016, 09:44
Ah yes, LOL, that would explain it. :) Thx.
asarian
5th April 2016, 11:30
So, what is needed then to make QTGMC work under VS 64-bit?! Cuz I'm having the hardest time getting it to even load. (See below). Several things, like MaskTools for VapourSynth, I can't even find anywhere. I call it as follows:
import vapoursynth as vs
import havsfunc as haf
import mvsfunc as mvf
import adjust
core = vs.get_core ()
vid = core.lsmas.LWLibavSource ("f:/video/neela.mkv")
vid = haf.QTGMC (vid, InputType=0, Preset="Very Slow", TR2=3, TFF=True)
Errors:
Script evaluation failed:
Python exception: No attribute with the name scd exists. Did you mistype a plugin namespace?
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1489, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:26885)
File "f:\jobs\neela.vpy", line 10, in <module>
vid = haf.QTGMC (vid, InputType=0, Preset="Very Slow", TR2=3, TFF=True)
File "C:\Program Files\Python35\lib\site-packages\havsfunc.py", line 978, in QTGMC
if TR0 > 0: ts1 = TemporalSoften(bobbed, 1, 255 << shift, CMts << shift, 28 << shift, 2) # 0.00 0.33 0.33 0.33 0.00
File "C:\Program Files\Python35\lib\site-packages\havsfunc.py", line 4287, in TemporalSoften
clip = set_scenechange(clip, scenechange)
File "C:\Program Files\Python35\lib\site-packages\havsfunc.py", line 4319, in set_scenechange
sc = core.scd.Detect(sc, thresh)
File "src\cython\vapoursynth.pyx", line 1103, in vapoursynth.Core.__getattr__ (src\cython\vapoursynth.c:20711)
AttributeError: No attribute with the name scd exists. Did you mistype a plugin namespace?
Are_
5th April 2016, 11:46
The same as for avisynth you need to download all needed plug-ins.
If you search this thread for "list" you will find some of them: http://forum.doom9.org/showthread.php?p=1753688&highlight=list#post1753688
That being said, maybe the script changed and you will need some more... or not. scd makes reference to SceneChange.
In an ideal world the author will maintain an updated list somewhere, because this script is a monster.
asarian
5th April 2016, 12:21
The same as for avisynth you need to download all needed plug-ins.
If you search this thread for "list" you will find some of them: http://forum.doom9.org/showthread.php?p=1753688&highlight=list#post1753688
That being said, maybe the script changed and you will need some more... or not. scd makes reference to SceneChange.
In an ideal world the author will maintain an updated list somewhere, because this script is a monster.
Thanks for your reply. I already have the following dll's loaded:
Directory of C:\Program Files (x86)\VapourSynth\plugins64
05-Apr-16 13:11 <DIR> .
05-Apr-16 13:11 <DIR> ..
09-Jun-15 10:37 316,928 DFTTest.dll
25-Mar-16 17:01 1,206,272 fmtconv.dll
15-Mar-14 18:29 2,545,034 libfftw3-3.dll
15-Mar-14 18:29 2,604,934 libfftw3f-3.dll
15-Mar-14 18:30 1,191,702 libfftw3l-3.dll
03-Apr-16 15:12 3,522,048 libmvtools.dll
24-Jan-16 14:59 824,320 libnnedi3.dll
01-Oct-13 11:31 115,930 libtemporalsoften.dll
05-Nov-14 20:00 127,488 templinearapproximate.dll
07-Mar-16 11:13 16,264,192 vslsmashsource.dll
10 File(s) 28,718,848 bytes
2 Dir(s) 102,245,715,968 bytes free
Not SceneChange yet, though (couldn't find 64-bit version of it yet). I shall try to acquire that too.
Are_
5th April 2016, 12:33
http://forum.doom9.org/showthread.php?p=1694970#post1694970
Chikuzen stuff is somewhat unmaintained by him, so you need to find updated versions somewhere in the middle of the threads :/
asarian
5th April 2016, 12:52
^^ Brilliant! Thx. :) For a moment I thought my project would strand on the absence of a 64-bit scenechange dll.
asarian
5th April 2016, 22:33
Just want to say, VapourSynth rocks! I was looking at a 90 hours job, with AviSynth and MCTD, and now, in VapourSynth and TempLinearApproximateMC (similar settings), I'm looking at an eta of ~11 hours! As expected/hoped, VapourSynth does an astounding, thread-safe job occupying your full CPU! And all in 64-bit!
Took me a bit to get it all straightened out, but this is gold, I tell you. Pure gold! :)
Myrsloik
6th April 2016, 20:41
Try out R32 RC2 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R32-RC2.exe). It will be released in a day or two if no serious issues are found.
Changes:
r32:
fixed cache not being automatically added for filters with nfmakelinear flag set (jackoneill)
assvapour now has integrated blending (jackoneill)
added the experimental function setfieldbased for convenience, expect it to change in the future
the tff argument is now optional and ignored for doubleweave when the _field property is present in a valid combination, _fieldbased will also be properly set now
the tff argument is now optional and ignored for separatefields when the _fieldbased property is present
added support for interlaced resizing
extended avisynth mvtools compatibility hack to work for 64bit version as well
fixed regression from r29 that would make compatyuy2 conversions vertically flipped
vspipe now outputs planar rgb in gbr plane order to better match what other software expects as input
now has a slightly more informative error message when the wrong type is passed as an argument in python
vsvfw now prints per frame errors on the corresponding frame
splicing two incompatible clips could sometimes give a confusing error message
removed planeaverage
asarian
6th April 2016, 23:43
^^ Thx for (soon to be) R32!
When it is released, will I just be able to install it over the existing R31 (never done this before with VapourSynth), or do I need to preserve plugins64 directory and such first?!
RiCON
7th April 2016, 15:44
The installer shouldn't do anything to the third party plugins directory, so you can just install over it.
asarian
7th April 2016, 17:06
The installer shouldn't do anything to the third party plugins directory, so you can just install over it.
Thx. :) Hoping R32 Final will follow soon thereafter.
asarian
7th April 2016, 20:50
Btw, does anyone know of a filter like AutoAdjust (64-bit) for VS? Would really love to see that one day. :)
Or at least maybe someone knows of a way to adjust brightness/contrast?
luigizaninoni
7th April 2016, 21:30
Adjust.py is a script that adjusts contrast brightness and saturation
jackoneill
7th April 2016, 21:51
Btw, does anyone know of a filter like AutoAdjust (64-bit) for VS? Would really love to see that one day. :)
Or at least maybe someone knows of a way to adjust brightness/contrast?
You could always nag/bribe the author of AutoAdjust to support VapourSynth.
asarian
7th April 2016, 21:57
Adjust.py is a script that adjusts contrast brightness and saturation
Thx. ;) I'll have a look at that. For this job I just adjusting manually will suffice. But I've really come to love AutoAdjust.
asarian
8th April 2016, 11:47
Blu-ray IDX/SUB filters (the kind extracted with BDSup2Sub, for example), is it possible to incorporate those in VS too?! That would be sweet, as I like my subs (like for Japanese material) to be unmodified.
EDIT: Looking for something like SupTitle.
jackoneill
8th April 2016, 12:42
Blu-ray IDX/SUB filters (the kind extracted with BDSup2Sub, for example), is it possible to incorporate those in VS too?! That would be sweet, as I like my subs (like for Japanese material) to be unmodified.
EDIT: Looking for something like SupTitle.
I think there is no such filter for VapourSynth (yet?), but you can do it with mpv:
mpv video.mov --sub-file subtitles.idx --vf vapoursynth=script.py --ovc libx264 --oac libvorbis -o output.mkv
It will filter video.mov using script.py, then it will render the subtitles and encode the result with x264.
asarian
8th April 2016, 13:05
^^ Brilliant! :) Thank you!
Myrsloik
8th April 2016, 16:15
R32 has been released. Full changelog in the first post. The release has fixes not in the RC.
The usual blog post (http://www.vapoursynth.com/2016/04/r32-interlaced-resizing-is-evil/).
Mostly bug fixes, one of them important since it fixes caches not always being properly added since the nfMakeLinear addition in R30.
And interlaced resizing. Because the world is a horrible place.
asarian
8th April 2016, 21:14
Thank you!! :)
asarian
10th April 2016, 15:09
Hmm, how do I tackle this one?
vid = core.avisource.AVISource ("f:/jobs/test.avi")
Script evaluation failed:
Python exception: AVISource: couldn't locate a decompressor for fourcc DX50
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1491, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:26897)
File "f:\jobs\test.vpy", line 7, in <module>
vid = core.avisource.AVISource ("f:/jobs/test.avi")
File "src\cython\vapoursynth.pyx", line 1383, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:25204)
vapoursynth.Error: AVISource: couldn't locate a decompressor for fourcc DX50
stax76
10th April 2016, 15:13
install either
DivX, XviD or ffdshow VFW decomressor
or use ffms2 or l-smash-works
LigH
10th April 2016, 15:15
Do you have a VfW decoder for DivX 5+ installed? (Assuming that AVISource requires installed VfW codecs as decoder...)
stax76
10th April 2016, 15:19
Do you have a VfW decoder for DivX 5+ installed? (Assuming that AVISource requires installed VfW codecs as decoder...)
vs AVISource uses VFW like avs AVISource so vs AVISource can open avs for instance to use avs DGSource.
asarian
10th April 2016, 15:19
install either
DivX or ffdshow VFW decomressor
or use ffms2 or l-smash-works
About the latter, 'core.lsmas.LWLibavSource' made the process crash immediately. I'll try ffms2, and I'll look into getting the other 2 to work with VS. Thanks!
Darn AVI! I hate that format!
asarian
10th April 2016, 15:43
'vid = core.ffms2.Source' can't make head or tails out of it either. It just keeps blabbing about needing to crop (and even when I do, it makes no difference):
Python exception: Crop: cropped area needs to have mod 2 height offset
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1491, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:26897)
File "F:\jobs\test.vpy", line 9, in <module>
vid = core.std.CropRel (clip=vid, left=0, right=0, top=1, bottom=0)
File "src\cython\vapoursynth.pyx", line 1383, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:25204)
vapoursynth.Error: Crop: cropped area needs to have mod 2 height offset
sneaker_ger
10th April 2016, 15:47
"mod 2" means you can only achieve even numbers of pixel dimension. You cannot crop just one pixel away, you have to crop away 2 or 4 or 6 or 8 etc. This depends on the colorspace. For progressive YUV 4:2:0 you need to use mod 2.
asarian
10th April 2016, 15:50
"mod 2" means you can only achieve even numbers of pixel dimension. You cannot crop just one pixel away, you have to crop away 2 or 4 or 6 or 8 etc. This depends on the colorspace. For progressive YUV 4:2:0 you need to use mod 2.
The AVI in question has a height of 225; so cropping per 2 is going to prove difficult; but I can add a border first. :) Thx.
EDIT: Yeah, AddBorders isn't going to work either, for the same reason. Sigh.
LigH
10th April 2016, 16:03
Must be quite a *censored* who produced such videos ... I wonder if you have a chance to ask the codec to return RGB24 or RGB32 (with their respective ffmpeg style format strings).
__
Different question:
Does anyone provide binaries of plugins ported by VFR-maniac, but only linked as source repos on the plugins list (http://www.vapoursynth.com/doc/pluginlist.html) (FFT3DFilter (https://github.com/VFR-maniac/VapourSynth-FFT3DFilter), ReduceFlicker (https://github.com/VFR-maniac/VapourSynth-ReduceFlicker), TNLMeans without OpenCL (https://github.com/VFR-maniac/VapourSynth-TNLMeans))?
asarian
10th April 2016, 16:22
Must be quite a *censored* who produced such videos ...
I'll say. ;)
This is totally silly. I can resize it first, but then I can't deblock it properly any more. Arghh.
asarian
10th April 2016, 16:37
I'll say. ;)
This is totally silly. I can resize it first, but then I can't deblock it properly any more. Arghh.
On that note, could I use some sort of Overlay() in VS? (So as to crop things later) Didn't find an Overlay() function in VS, but I'm sure it supports something similar.
LigH
10th April 2016, 21:58
I remember that in AviSynth, you could resize a clip rectangle, optionally. Not sure if VapourSynth supports this syntax too.
asarian
10th April 2016, 23:21
I remember that in AviSynth, you could resize a clip rectangle, optionally. Not sure if VapourSynth supports this syntax too.
I had to fall back to AviSynth, for the moment, and do the OverLay() trick: not particularly elegant, but it works. I simply start with a static 400x240 background image, and overlay the oddly coded 400x225 vid over it (at x=0, y=0), and then crop -16 from the bottom, when all deblocking/denoising etc is done.
Really would love to see Overlay() in VS too, one day. :)
feisty2
11th April 2016, 03:27
I had to fall back to AviSynth, for the moment, and do the OverLay() trick: not particularly elegant, but it works. I simply start with a static 400x240 background image, and overlay the oddly coded 400x225 vid over it (at x=0, y=0), and then crop -16 from the bottom, when all deblocking/denoising etc is done.
Really would love to see Overlay() in VS too, one day. :)
Overlay is lame sh*t, the fancy way to do such thing is doing it under gray color space, 3 gray clips, one for each plane
asarian
11th April 2016, 03:33
^^ Maybe you should have told me that 4 posts ago?! :) Anyway, 'quick and dirty' works for me.
Elegant
11th April 2016, 04:16
Does anyone provide binaries of plugins ported by VFR-maniac, but only linked as source repos on the plugins list (http://www.vapoursynth.com/doc/pluginlist.html) (FFT3DFilter (https://github.com/VFR-maniac/VapourSynth-FFT3DFilter), ReduceFlicker (https://github.com/VFR-maniac/VapourSynth-ReduceFlicker), TNLMeans without OpenCL (https://github.com/VFR-maniac/VapourSynth-TNLMeans))?
I've been searching for this as well; it shouldn't be that bad to do it by hand though.
l33tmeatwad
11th April 2016, 23:14
Does anyone provide binaries of plugins ported by VFR-maniac, but only linked as source repos on the plugins list (http://www.vapoursynth.com/doc/pluginlist.html) (FFT3DFilter (https://github.com/VFR-maniac/VapourSynth-FFT3DFilter), ReduceFlicker (https://github.com/VFR-maniac/VapourSynth-ReduceFlicker), TNLMeans without OpenCL (https://github.com/VFR-maniac/VapourSynth-TNLMeans))?
Ask and ye shall receive:
FFT3DFilter (http://www.mediafire.com/download/ajq0cbsg94qhpc5/VapourSynth-FFT3DFilter.7z)
ReduceFlicker (http://www.mediafire.com/download/7bna7baoaqe1gue/VapourSynth-ReduceFlicker_r2.7z)
TNLMeans (http://www.mediafire.com/download/rnv4hqp6edz4x66/VapourSynth-TNLMeans_r30.7z)
I only tested the x64 versions of each...
LigH
11th April 2016, 23:23
A bunch of :thanks: to you...
littlepox
12th April 2016, 17:48
There is a bug in using Expr:
import vapoursynth as vs
import sys
core = vs.get_core()
core.max_cache_size=1000
a = "anysource.mkv"
src8 = core.lsmas.LWLibavSource(a,threads=1)
res = core.std.Expr(src8, ["128 x - 1 < 128 128 ?",""])
res.set_output()
the vapoursynth.dll shall crash.
However, once can just avoid it by using "x - 128 -1 > 128 128 ?"
Waiting for replies, thanks.
jackoneill
12th April 2016, 19:48
There is a bug in using Expr:
import vapoursynth as vs
import sys
core = vs.get_core()
core.max_cache_size=1000
a = "anysource.mkv"
src8 = core.lsmas.LWLibavSource(a,threads=1)
res = core.std.Expr(src8, ["128 x - 1 < 128 128 ?",""])
res.set_output()
the vapoursynth.dll shall crash.
However, once can just avoid it by using "x - 128 -1 > 128 128 ?"
Waiting for replies, thanks.
Fixed now. It affects expressions that use the ternary operator, where its first operand is an expression that begins with a constant.
littlepox
13th April 2016, 04:15
Fixed now. It affects expressions that use the ternary operator, where its first operand is an expression that begins with a constant.
Thanks dude. So efficient.:thanks:
BakaProxy
16th April 2016, 07:29
Just a thought I had recently but is it actually possible to use vpy within c++ without having to call python scripts snd whatnot. I'm talking about calling vpy functions and plugins from within the cpp project.
For example I have a cpp project that generates an image and I want to resize that image without fully making my own resize function, could I then call vpy's internal resize function to do the work or even call the nnedi3 plugin?
feisty2
16th April 2016, 09:02
see
https://github.com/dubhater/vapoursynth-nnedi3/commit/51ad1bd6aec7362f146552939c141e8f874a1f87
jackoneill
16th April 2016, 09:05
Just a thought I had recently but is it actually possible to use vpy within c++ without having to call python scripts snd whatnot. I'm talking about calling vpy functions and plugins from within the cpp project.
For example I have a cpp project that generates an image and I want to resize that image without fully making my own resize function, could I then call vpy's internal resize function to do the work or even call the nnedi3 plugin?
Yes, it's possible. You can build a filter graph in C/C++. Here is an example that happens to invoke the internal resizer: https://github.com/vapoursynth/vapoursynth/blob/master/src/filters/assvapour/assvapour.c#L504 . For your particular case, you'll also need to implement a VapourSynth source filter in your application.
If it's only the internal resizer you want, you should use zimg directly. It has C (https://github.com/sekrit-twc/zimg/blob/master/src/zimg/api/zimg.h) and C++ (https://github.com/sekrit-twc/zimg/blob/master/src/zimg/api/zimg++.hpp) APIs.
sofakng
18th April 2016, 18:16
Has anybody been able to cross-compile VapourSynth using Linux?
I'm trying to use MXE (M Cross Environment; mingw32-w64 toolchain builder) and it compiles mpv without any problems, but VapourSynth requires Python 3.4 and I'm stumped on how to properly compile the VapourSynth DLL...
jackoneill
18th April 2016, 20:00
Has anybody been able to cross-compile VapourSynth using Linux?
I'm trying to use MXE (M Cross Environment; mingw32-w64 toolchain builder) and it compiles mpv without any problems, but VapourSynth requires Python 3.4 and I'm stumped on how to properly compile the VapourSynth DLL...
It has been done. There are some hoops to jump through.
Note that cross-compiling a 32 bit libvapoursynth produces a broken DLL. I didn't investigate, but I think it has to do with function decorations somehow.
You could try to cross-compile Python, but I found it easier to use the official win64 installer in Wine (even if it took a few hours to find the magic switch that made msiexec work).
So, assuming you will use the official Python installer, the configure command will look something like this:
./configure --host=x86_64-w64-mingw32 --disable-python-module --disable-plugins PYTHON3_CFLAGS='/path/to/Python3.h' PYTHON3_LIBS='-L/path/to/libpython3.dll -lpython3'
--disable-python-module because Python modules have to be compiled with the same compiler as libpython, so you'll have to use the Python module provided in the official VapourSynth installer.
--disable-plugins because I assume you won't need those.
PYTHON3_CFLAGS needs to be passed to please the configure script. Point it to the Python installation's "include" folder.
PYTHON3_LIBS is also needed to please the configure script. Point it to the Python installation's "DLLs" folder. Inside, you will need to rename Python3.dll to libpython3.dll because otherwise libtool refuses to acknowledge its existence. This means you'll also need to rename Python3.dll on the Windows machine where this thing will run.
Most unfortunately, you will receive a libvapoursynth-script-0.dll instead of vsscript.dll.
Don't use GCC 5.3.0 for this because its libstdc++ has a bug that makes wstring_convert unusable. This is a problem for VapourSynth. GCC 5.1.0 is okay.
If it's for mpv, I think you'll find it much easier to convince mpv's build system to use the vsscript.dll provided in the official VapourSynth installer, or the portable archive.
sofakng
18th April 2016, 20:55
Thanks a lot for the help. I ended up using dlltool to generate the lib files (for vapoursynth.dll and vsscript.dll) and I was able to get mpv compiled with vapoursynth supported. I still need to try it on my actual win32 machine so who knows if it will work but at least it compiled :)
sofakng
19th April 2016, 02:22
Sorry, but one more question.
Is there an installer for the 64-bit version of VapourSynth? It looks like VapourSynth-R32.exe only installs the 32-bit version.
speedyrazor
29th April 2016, 07:11
Hi, I am getting "VSPipe.exe has stopped working" when trying to process Quicktime Prores 4444 files. Here is the script:
import vapoursynth as vs
core = vs.get_core(threads=4)
ret = core.lsmas.LibavSMASHSource(source=r"Prores_4444_HD_Test.mov")
ret = core.fmtc.resample (clip=ret, w=480, h=384, css="444", kernel="spline36")
ret = core.fmtc.matrix (clip=ret, mats="709", matd="601")
ret = core.fmtc.resample (clip=ret, css="420")
ret = core.fmtc.bitdepth (clip=ret, bits=10)
retFinal = ret
retFinal.set_output()
I am on the latest version of Vapoursynth (R32) and the latest version of LSMASHSource (r877). Here is the crash report:
Problem signature:
Problem Event Name: APPCRASH
Application Name: VSPipe.exe
Application Version: 0.0.0.0
Application Timestamp: 5707beaa
Fault Module Name: vslsmashsource.dll
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 00000000
Exception Code: c0000005
Exception Offset: 0000000000001c80
OS Version: 6.2.9200.2.0.0.272.7
Locale ID: 2057
Additional Information 1: a279
Additional Information 2: a279be6c627875dc7e1b7d38560dd807
Additional Information 3: 750b
Additional Information 4: 750b3a6db190a3b8cb8b4f7bce54513d
Am I doing something wrong, or is this a bug?
Kind regards.
stax76
29th April 2016, 13:55
I've downloaded a YUV444P10 sample and got an VS error telling YUV444P10 is not supported by VFW module, could it be supported? I get this error not only with StaxRip and VirtualDub but also with MPC-BE which I thought does not use VFW.
Sample is from here:
https://www.arri.com/camera/amira/learn/amira_sample_footage/
Count : 334
Count of stream of this kind: 1
Kind of stream : Video
Kind of stream : Video
Stream identifier : 0
StreamOrder : 0
ID : 1
ID : 1
Format : ProRes
Commercial name : ProRes
Format version : Version 1
Format profile : 4444
Codec ID : ap4h
Codec ID/Url : http://www.apple.com/quicktime/download/standalone.html
Codec : ap4h
Codec : ap4h
Codec/CC : ap4h
Duration : 10240
Duration : 10s 240ms
Duration : 10s 240ms
Duration : 10s 240ms
Duration : 00:00:10.240
Duration : 00:00:10:06
Duration : 00:00:10.240 (00:00:10:06)
Bit rate mode : VBR
Bit rate mode : Variable
Bit rate : 286246400
Bit rate : 286 Mbps
Width : 1920
Width : 1 920 pixels
Clean aperture width : 1920
Clean aperture width : 1 920 pixels
Height : 1080
Height : 1 080 pixels
Clean aperture height : 1080
Clean aperture height : 1 080 pixels
Pixel aspect ratio : 1.000
Clean aperture pixel aspect ratio: 1.000
Display aspect ratio : 1.778
Display aspect ratio : 16:9
Clean aperture display aspect ratio: 1.778
Clean aperture display aspect ratio: 16:9
Rotation : 0.000
Frame rate mode : CFR
Frame rate mode : Constant
Frame rate : 25.000
Frame rate : 25.000 fps
Frame count : 256
Chroma subsampling : 4:4:4
Chroma subsampling : 4:4:4
Scan type : Progressive
Scan type : Progressive
Bits/(Pixel*Frame) : 5.522
Delay : 10280
Delay : 10s 280ms
Delay : 10s 280ms
Delay : 10s 280ms
Delay : 00:00:10.280
Delay_Settings : DropFrame=No / 24HourMax=Yes / IsVisual=No
Delay_DropFrame : No
Delay, origin : Container
Delay, origin : Container
Stream size : 366395392
Stream size : 349 MiB (97%)
Stream size : 349 MiB
Stream size : 349 MiB
Stream size : 349 MiB
Stream size : 349.4 MiB
Stream size : 349 MiB (97%)
Proportion of this stream : 0.96949
Writing library : Arnold & Richter Cine Technik
Writing library : Arnold & Richter Cine Technik
Language : en
Language : English
Language : English
Language : en
Language : eng
Language : en
Encoded date : UTC 2014-07-02 09:44:35
Tagged date : UTC 2014-07-02 09:44:45
colour_description_present: Yes
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
colour_description_present_Original: Yes
matrix_coefficients_Original: RGB
Myrsloik
29th April 2016, 14:03
The problem is that there is no fourcc to represent it that I know of. The closest are ms p010 or whatever it was called and v210 which are both 10bit but subsampled. Find me a fourcc that's actually supported in applications and I'll consider adding it.
stax76
29th April 2016, 14:17
Who might help here, maybe the author of MediaInfo or VirtualDub?
stax76
29th April 2016, 14:21
found something:
http://wiki.multimedia.cx/index.php?title=Apple_ProRes
Myrsloik
29th April 2016, 14:35
found something:
http://wiki.multimedia.cx/index.php?title=Apple_ProRes
No, must be uncompressed formats obviously.
poisondeathray
29th April 2016, 15:05
YUV 444 10bit packed is known as "Y410", but it's not supported in ffmpeg as a pixel format .
https://msdn.microsoft.com/en-us/library/windows/desktop/bb970578%28v=vs.85%29.aspx#_444formats
https://en.wikipedia.org/wiki/FFmpeg#Pixel_formats
It's also known as "v410" (analgous to "v210" for 10bit422) but 10bit444
https://www.mplayerhq.hu/DOCS/codecs-status.html
stax76
29th April 2016, 15:24
yuv fourcc on apple dev page:
https://developer.apple.com/library/mac/technotes/tn2273/_index.html#//apple_ref/doc/uid/DTS40009994-CH1-SECTION3
d:\Temp>ffmpeg -codecs -hide_banner | findstr 4:4:4
DEVI.. ayuv Uncompressed packed MS 4:4:4:4
DEVI.. v308 Uncompressed packed 4:4:4
DEVI.. v408 Uncompressed packed QT 4:4:4:4
DEVI.S v410 Uncompressed 4:4:4 10-bit
Khanattila
29th April 2016, 16:34
I don't think it's helpful.
x264/x265 accept i420, yv12, nv12, i422, yv16, nv16, i444, yv24:
- yv12, yv16 and yv24 are planar, good;
- i420, i422, i444 are identical except that the U and V plane order is reversed, good;
- nv12, nv16 are semi-planar.
Why add a packed format?
Myrsloik
29th April 2016, 16:45
My personal opinion is that you should just let vfw die. I know it's convenient and simple sometimes but it simply doesn't define enough things. Simply convert to RGB24 or yv24 at the end of all scripts you're only going to preview and be done with it.
If anything I thinkbthe future belongs to specialized editors/preview apps that have proper 10bit and up handling. There are monitors that truly support a higher depth but I don't think any open source solution is capable of properly doing that yet. Let vfw die, it's old and tired.
And you can easily pipe y4m at higher depths into x264 so that makes even less sense. I got that stuff added to y4m several years ago to work around this.
stax76
29th April 2016, 19:16
I don't give it up yet, I'm getting closer though.
Myrsloik
29th April 2016, 19:45
I don't give it up yet, I'm getting closer though.
Why does staxrip need it at all when doing VS stuff?
stax76
29th April 2016, 20:05
It does not really need it, it just was always good enough.
speedyrazor
30th April 2016, 07:08
Does this all relate to this issue?
http://forum.doom9.org/showthread.php?p=1766005&highlight=Hi%2C+VSPipe.exe+has+stopped+working#post1766005
stax76
30th April 2016, 07:11
Does this all relate to this issue?
http://forum.doom9.org/showthread.php?p=1766005&highlight=Hi%2C+VSPipe.exe+has+stopped+working#post1766005
no, vspipe don't use VFW
speedyrazor
30th April 2016, 18:50
The fault comes from the source filter you use. You'd better open an issue on https://github.com/VFR-maniac/L-SMASH-Works and provide a small sample file so the author can reproduce the problem.
Done, thanks for the suggestion.
feisty2
29th May 2016, 10:00
anyone ever thought about making a GUI based editor, something like Nuke for vs?
I mean vseditor is cool but it's based on script writing still... you're gonna have to write scripts even for some pretty simple tasks and that is not very user friendly..
would be nice if such GUI thing exists and you manipulate the filters and modules as "nodes" and it generates python scripts automatically for you..
You are probably thinking of something similar to "AVE AviSynth Visual Editor" (which was probably abandoned, IIRC).
feisty2
29th May 2016, 10:26
You are probably thinking of something similar to "AVE AviSynth Visual Editor" (which was probably abandoned, IIRC).
shame, I always think it's good to "GUI whatever if possible and script manually only where it must"
That's the POV of the user.
The developer looks from the opposite angle and needs to have basic routines working first. A pretty GUI on a brittle core is like a penthouse floating above a basement still being built.
AviSynth was developed as (scriptable) frameserver; it was meant to be invisible. VapourSynth is a video filtering framework, not the same as a frameserver, but still meant to be the invisible engine covered by any kind of casing. Because the VapourSynth engine itself is partially made of a common programming language (Python), it is even more probable than for AviSynth that a user interface could be made which may change the video processing script as a part of itself. But this is just a very elaborate challenge...
anyone ever thought about making a GUI based editor, something like Nuke for vs?
I mean vseditor is cool but it's based on script writing still... you're gonna have to write scripts even for some pretty simple tasks and that is not very user friendly..
would be nice if such GUI thing exists and you manipulate the filters and modules as "nodes" and it generates python scripts automatically for you..
Not sure if it is exactly what you meant, but somebody did think about it and wrote pyhenkan (https://github.com/alucryd/pyhenkan).
I don't know if it works out of the box in Windows, it's not mentioned anywhere, and has some bugs here and there, looks a little unfinished yet.
I don't really know what's Nuke, but is not Staxrip (https://github.com/stax76/StaxRip) similar to what you are asking for (I have not used it, so I don't really know what it is)?
feisty2
29th May 2016, 11:08
The developer looks from the opposite angle and needs to have basic routines working first. A pretty GUI on a brittle core is like a penthouse floating above a basement still being built.
been years since the first vs release, I actually think the vs core should be pretty stable by now, trivial changes and improvements and bug fixes will always be going but nothing drastic, the basement is done imho
feisty2
29th May 2016, 11:13
I don't really know what's Nuke
Nuke is a node based commercial NLE software, it's a pretty popular thing in movie industry, see https://www.thefoundry.co.uk/products/nuke/
and it's different from transcoding toolkits like Staxrip or MeGUI, it's designed specifically for video manipulating not transcoding
Mystery Keeper
29th May 2016, 14:22
anyone ever thought about making a GUI based editor, something like Nuke for vs?
I mean vseditor is cool but it's based on script writing still... you're gonna have to write scripts even for some pretty simple tasks and that is not very user friendly..
would be nice if such GUI thing exists and you manipulate the filters and modules as "nodes" and it generates python scripts automatically for you..
Like Cycles in Blender? Doable. But how usable it would be? Writing scripts is simply faster. It lets you copy/paste and comment out lines. A complex script might use tens of nodes.
feisty2
30th May 2016, 03:58
Like Cycles in Blender? Doable. But how usable it would be? Writing scripts is simply faster. It lets you copy/paste and comment out lines. A complex script might use tens of nodes.
It's extremely useful on complex restoration projects like VideoFred's stuff, you got a clearer view of the entire process chain instead of figuring it out by hours of script reading and organizing, and it helps the function calling also, some fat plugins, mvtools kind of thing, might contain 20+ parameters or so, and you got them all on a gui panel, no more staring at the extra long function calling and tryna locate the parameter you set before and wanna modify now...
feisty2
30th May 2016, 04:03
And scripts tend to be messy and confusing and likely to go wrong when things get big and complex, cuz we humans make mistakes...GUI nodes help with that too
dipje
1st June 2016, 07:52
Utvideo codec has now RGB 10-bit and RGB-with-alpha 10-bit versions, with quicktime support and working (import/export) in Adobe After Effects for Windows at least.
Virtualdub FilterMod has added b64a support and tested the codecs and they seem to work.
But there is no way yet to go from Vapoursynth (with RGB30 / RGB48) into Virtualdub FilterMod since Vapoursynth doesn't support those colorspaces in the VfW module. May I request this? There is a legit use now for it :).
(Vpy RGB30 into Utvideo 'UQRG' seems to be close to 50% of the same RGB30 as a DPX sequence in disksize so it helps a lot with disk i/o in After Effects)
An alternative would be an updated ffmpeg with the 10-bit utvideo versions in _encoding_ mode, but since there doesn't seem to be support for the (now a fear years old) YUV422-10bit mode (UQR2) I have little hope for that happening.
Myrsloik
1st June 2016, 07:59
I'll add b64a then. The reason I don't add all formats is that b64a (until now) didn't have an easy way to test it.
dipje
1st June 2016, 09:18
Now comes to noobish question.
What is 'b64a'. 16-bit-per-pixel RGB with A? Planer or packed?
What output format should my Vapoursynth be if it would have to go to b64a? Regular vs.RGB48 or do I somehow need to fake an alpha channel?
(Or do you don't know yet till you worked on it :P)
shekh
1st June 2016, 10:54
Yes, 16-bit-per-pixel RGB with A, packed.
I could also support b48r (no alpha) if it gives any benefit. Currently both UQRG and UQRA accept b64a so I did not bother with b48r.
I check whether alpha is valid by the codec id, not by bitmap format, so if you expect alpha from Vapoursynth I need to do something else.
dipje
1st June 2016, 16:40
Well I couldn't care about alpha, but some other people I guess do.
But just 'support whatever is needed to get UQRG working' is enough for me to be honest :).
kolak
13th June 2016, 19:39
I'll add b64a then. The reason I don't add all formats is that b64a (until now) didn't have an easy way to test it.
b64a is quite universal, so good to have it.
Myrsloik
13th June 2016, 19:42
b64a is quite universal, so good to have it.
I'm having trouble finding something to test b64a in. Is there any free program I can use? (madvr doesn't count since it+mpc-hc doesn't play nice with debuggers)
kolak
13th June 2016, 19:45
Utvideo codec has now RGB 10-bit and RGB-with-alpha 10-bit versions, with quicktime support and working (import/export) in Adobe After Effects for Windows at least.
Virtualdub FilterMod has added b64a support and tested the codecs and they seem to work.
But there is no way yet to go from Vapoursynth (with RGB30 / RGB48) into Virtualdub FilterMod since Vapoursynth doesn't support those colorspaces in the VfW module. May I request this? There is a legit use now for it :).
(Vpy RGB30 into Utvideo 'UQRG' seems to be close to 50% of the same RGB30 as a DPX sequence in disksize so it helps a lot with disk i/o in After Effects)
An alternative would be an updated ffmpeg with the 10-bit utvideo versions in _encoding_ mode, but since there doesn't seem to be support for the (now a fear years old) YUV422-10bit mode (UQR2) I have little hope for that happening.
Both UQY2 and UQRG has been added to ffmpeg in recent days.
kolak
13th June 2016, 19:47
I'm having trouble finding something to test b64a in. Is there any free program I can use? (madvr doesn't count since it+mpc-hc doesn't play nice with debuggers)
Hmmm...modded Vdub which has been mentioned here?
ffplay?
Myrsloik
13th June 2016, 19:49
Hmmm...modded Vdub which has been mentioned here?
Nope, it says it doesn't know b64a. That makes me sad. Maybe there's some obscure codec that also provides b64a "decoding".
kolak
13th June 2016, 19:58
What about graphstudio + MadVR or ffplay?
shekh
13th June 2016, 20:31
Nope, it says it doesn't know b64a. That makes me sad. Maybe there's some obscure codec that also provides b64a "decoding".
Can I help with this?
Maybe vpy is handled by some other code path in vdub.
I tested UQRG with "avi (compat)" open option and it works.
For reference, this is how BitmapInfoHeader is filled:
biWidth = w
biHeight = h
biPlanes = 1
biCompression = VDMAKEFOURCC('b', '6', '4', 'a')
biBitCount = 64
biSizeImage = w*8 * h
Or I can try your intermediate version and see what happens.
Myrsloik
13th June 2016, 21:34
R33 test 1 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R33-test1.exe)
RGB24 will now be automatically packed to BGRA so VFW likes it more.
RGB48 will be packed to b64a.
YUV444P14 will be packed to Y416.
The b64a I haven't managed to test so report your success with that.
Not much else changed, really.
shekh
13th June 2016, 23:06
I made some fixes and in general it "works" (will make fixed update soon).
However it looks like VS output has different component order and byte order (UQRG matches this description http://www.bitjazz.com/en/products/sheervideo/faq/formats/pixel_formats.php#b64a)
Myrsloik
13th June 2016, 23:16
I made some fixes and in general it "works" (will make fixed update soon).
However it looks like VS output has different component order and byte order (UQRG matches this description http://www.bitjazz.com/en/products/sheervideo/faq/formats/pixel_formats.php#b64a)
I double checked it and I'm fairly certain I match it. The evils of endianness and so on. Even the simple description says that the order of the components is ARGB which the big endian example confirms.
shekh
14th June 2016, 11:20
I confirm that your output is correct. My mistake.
Uploaded new version, now everything works fine.
dipje
14th June 2016, 13:44
I installed Vapoursynth r33 test 1 (x64, python 35) together with virtualDub64_pack_37197 (that was the latest one you were talking about, right shekh?)
If I open a .vpy file with RGB48 I get VirtualDub FilterMod showing it as b64a and it displays fine, and I can scrub around and it seems to work.
Setting the VDubFilterMod to 'direct stream copy' in video mode I can save a raw b64a AVI file no problem.
But whatever I try to save a Utvideo 10bit version VDub seems to crash.
Is it working with UQRA / UQRG? I know Myrsloik said it's basically untested but if I see the video OK in VDubFilterMod I'm guessing Vapoursynth has done it's job.
Shekh, you said you tested your b64a with Utvideo right? Did it break doing the latest changes?
kolak
14th June 2016, 13:46
Same here. Looks like UTVideo problem or something in between.
dipje
14th June 2016, 13:49
Both UQY2 and UQRG has been added to ffmpeg in recent days.
Decoding only from the looks of it
shekh
14th June 2016, 16:37
I installed Vapoursynth r33 test 1 (x64, python 35) together with virtualDub64_pack_37197 (that was the latest one you were talking about, right shekh?)
If I open a .vpy file with RGB48 I get VirtualDub FilterMod showing it as b64a and it displays fine, and I can scrub around and it seems to work.
Setting the VDubFilterMod to 'direct stream copy' in video mode I can save a raw b64a AVI file no problem.
But whatever I try to save a Utvideo 10bit version VDub seems to crash.
Is it working with UQRA / UQRG? I know Myrsloik said it's basically untested but if I see the video OK in VDubFilterMod I'm guessing Vapoursynth has done it's job.
Shekh, you said you tested your b64a with Utvideo right? Did it break doing the latest changes?
It works for me. Tested UQRA, UQRG, x86, amd64 - all work.
Can you narrow down the test which will crash and share source & script so I try it? Also crash report from vdub may be useful.
update:
Looks like it crashed when preferences->video compression threads is set to 0.
Fixed now, build 37201
Selur
18th June 2016, 19:48
http://www.vapoursynth.com/doc/functions/levels.html doesn't mention the 'gamma' option of levels.
jackoneill
18th June 2016, 20:59
http://www.vapoursynth.com/doc/functions/levels.html doesn't mention the 'gamma' option of levels.
I didn't know what to say about it. Any suggestions?
Selur
18th June 2016, 21:01
Whoever is responsible for the doc should also add the gamma option to the description,...
jackoneill
18th June 2016, 21:25
Whoever is responsible for the doc should also add the gamma option to the description,...
Any suggestions for what the documentation should say about the gamma parameter?
Selur
18th June 2016, 21:35
Something along the lines that http://avisynth.nl/index.php/Levels mentions. ;)
I think much explanation isn't necessary, main thing is that the doc should mention all options.
Selur
26th June 2016, 09:34
Is there an alternative to VFRtoCFR (http://forum.doom9.org/showthread.php?t=165045) for Vapoursynth? (a filter, which isn't a source filter, which can do a vfr -> cfr conversion)
Reel.Deel
26th June 2016, 12:31
Is there an alternative to VFRtoCFR (http://forum.doom9.org/showthread.php?t=165045) for Vapoursynth? (a filter, which isn't a source filter, which can do a vfr -> cfr conversion)
There's tc2cfr (https://github.com/gnaggnoyil/tc2cfr) but it does not support Matroska timecodes (v2) files.
Myrsloik
26th June 2016, 12:49
Is there an alternative to VFRtoCFR (http://forum.doom9.org/showthread.php?t=165045) for Vapoursynth? (a filter, which isn't a source filter, which can do a vfr -> cfr conversion)
Or you could simply add VapourSynth support to it yourself. It has the calculations all nicely split into a separate function...
Selur
29th June 2016, 05:41
@myesloik: that would require some reading into how to do that and spending time in the future on potential bug fixes etc.
-> no thanks, my free time is already cramped with lots of stuff I want to code, not keen on adding another 'project'.
l33tmeatwad
29th June 2016, 16:28
Could matrix be added to the output for vspipe --info? Currently working on a GUI for FFMPEG that uses vspipe to encode scripts and being able to pull that info would be nice.
Myrsloik
29th June 2016, 16:44
Could matrix be added to the output for vspipe --info? Currently working on a GUI for FFMPEG that uses vspipe to encode scripts and being able to pull that info would be nice.
That's a per frame property and not a constant thing so there's no single matrix value to return. Not sure what to do about it.
LigH
11th July 2016, 10:28
With AssVapour, a filter for ASS text script based hard subtitling does exist for VapourSynth. But there is no plugin listed yet supporting subpicture bitmap based hard subtitling.
I found VapourSynth-XY-VSFilter by Tsuki on Github (https://github.com/Tsuki/VapourSynth-XY-VSFilter/), if it already works well, it should possibly be added to the plugins list (http://www.vapoursynth.com/doc/pluginlist.html).
jackoneill
11th July 2016, 16:06
With AssVapour, a filter for ASS text script based hard subtitling does exist for VapourSynth. But there is no plugin listed yet supporting subpicture bitmap based hard subtitling.
I found VapourSynth-XY-VSFilter by Tsuki on Github (https://github.com/Tsuki/VapourSynth-XY-VSFilter/), if it already works well, it should possibly be added to the plugins list (http://www.vapoursynth.com/doc/pluginlist.html).
You should volunteer to test it... if you can find binaries.
LigH
11th July 2016, 17:29
I do not even have material at the moment ... but Selur is very interested, to boost up Hybrid, I believe.
There are 19 releases (https://github.com/Tsuki/VapourSynth-XY-VSFilter/releases) so far. But I did not yet download to check if they are publicly usable already... :o
Selur
11th July 2016, 17:34
the releases do only contain the source, no compiled dlls :/
to boost up Hybrid, I believe.
Yup
mawen1250
12th July 2016, 14:53
I haven't used that ported VSFilter yet. But as far as I know, there were someone encountering random crash with it. It might still be a safer choice to use the AviSynth API instead.
EDIT: it's probably the problem with xy-VSFilter, plain VSFilter should be OK.
Myrsloik
16th July 2016, 13:26
R33 test 3 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R33-test3.exe).
Lots of changes to VSFS (now called AVFS an merged with the avisynth version), vfw which can now output a lot more raw formats and avisource which should be able to read a lot more raw fourccs formats.
Note that the avisource change are completely untested so if you want to help give all the raw input formats supported by avisource a try.
r33:
directshowsource from recent avs+ can now be used
fixed swapped uv planes with yuv411 output in vsvfw and avfs
merged vsfs with the latest version of avfs, avfs now work for both vapoursynth and avisynth scripts and no longer has shell integration
avisource can now open all formats vsvfw can output plus b48r
fixed corrupted output in vfm when clip2 isn't 8 bit
fixed crash due to stack overflow if an extremely long filter graph is freed
now installs the vs2015 update 3 runtimes on windows
vsvfw will now automatically convert rgb24 to packed bgra for convenience
added b64a and P416 output to vsvfw
updated to zimg v2.1 branch
mixed imwri fixes
fixed rare access violation in expr when ternary operator is used (jackoneill)
Selur
19th July 2016, 04:39
using r32 (portable) with:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/Support/fmtconv.dll")
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/SourceFilter/FFMS2/ffms2.dll")
# Loading Source: F:\TestClips&Co\MPEG-4 H.264\00000.m2ts
clip = core.ffms2.Source(source="F:/TESTCL~1/MPEG-4~1.264/00000~1.M2T",cachefile="H:/Temp/m2ts_072de0f49267ed8dfe42a17f5d571a8e_4827.ffindex",fpsnum=25)
original = clip
# adjusted resizing of clio to achieve PAR 1:1 for preview
#clip = core.fmtc.resample(clip=clip, kernel="spline16", w=966, h=544, interlaced=False)
# adjusted resizing of original to achieve PAR 1:1 for preview
#original = core.fmtc.resample(clip=original, kernel="spline16", w=966, h=544, interlaced=False)
stacked = core.std.StackHorizontal([original,clip])
# Output
stacked.set_output()
works fine, but:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/Support/fmtconv.dll")
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/SourceFilter/FFMS2/ffms2.dll")
# Loading Source: F:\TestClips&Co\MPEG-4 H.264\00000.m2ts
clip = core.ffms2.Source(source="F:/TESTCL~1/MPEG-4~1.264/00000~1.M2T",cachefile="H:/Temp/m2ts_072de0f49267ed8dfe42a17f5d571a8e_4827.ffindex",fpsnum=25)
original = clip
# adjusted resizing of clio to achieve PAR 1:1 for preview
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=966, h=544, interlaced=False)
# adjusted resizing of original to achieve PAR 1:1 for preview
original = core.fmtc.resample(clip=original, kernel="spline16", w=966, h=544, interlaced=False)
stacked = core.std.StackHorizontal([original,clip])
# Output
stacked.set_output() crashes VSPipe.
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/Support/fmtconv.dll")
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/SourceFilter/FFMS2/ffms2.dll")
# Loading Source: F:\TestClips&Co\MPEG-4 H.264\00000.m2ts
clip = core.ffms2.Source(source="F:/TESTCL~1/MPEG-4~1.264/00000~1.M2T",cachefile="H:/Temp/m2ts_072de0f49267ed8dfe42a17f5d571a8e_4827.ffindex",fpsnum=25)
# adjusted resizing of clio to achieve PAR 1:1 for preview
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=966, h=544, interlaced=False)
original = clip
stacked = core.std.StackHorizontal([original,clip])
# Output
stacked.set_output()
works too, but using 'core.fmtc.resample' on two 'different' clips seems to fail.
Am I missing/overlocking something?
feisty2
19th July 2016, 12:42
I get weird crashes sometimes when previewing complex and slow scripts, and the debugger traced the error back to fmtconv.dll dereferencing a nullptr like every time when that happened
http://i.imgur.com/gq3tF2g.png
maybe there's a bug or something in fmtconv, who knows anyways
Mystery Keeper
19th July 2016, 13:55
Sounds awfully like a memory allocation failure. Open Process Explorer/Task Manager and see how VapourSynth is taking memory. You're probably running out of it.
Myrsloik
19th July 2016, 14:11
...
Am I missing/overlocking something?
I can't reproduce it so I'm not sure what it could be. Maybe you're using an older fmtconv?
It's probably not an out of memory error either since VS only uses 1GB of ram as cache at most by default.
Mystery Keeper
19th July 2016, 20:12
I can't reproduce it so I'm not sure what it could be. Maybe you're using an older fmtconv?
It's probably not an out of memory error either since VS only uses 1GB of ram as cache at most by default.
Cache is one thing, but there's also memory, allocated by filters. Intermediate buffers and such. When these buffers need to be large for large frames - you can easily run out of continuous memory chunks to allocate them.
Howdy folks,
I'm having some difficulty getting qtgmc to work with r32. Here is my script:
import vapoursynth as vs
import sys
sys.path.append("/usr/local/lib/python2.7/site-packages")
import mvsfunc
import adjust
import havsfunc as hf
import functools
core = vs.get_core()
core.std.LoadPlugin("/usr/local/lib/libffms2.so")
core.std.LoadPlugin("/usr/local/lib/libmvtools.so")
core.std.LoadPlugin("/usr/local/lib/libnnedi3.so")
core.std.LoadPlugin("/usr/local/lib/libfmtconv.so")
core.std.LoadPlugin("/usr/local/lib/libtemporalsoften.so")
#core.std.LoadPlugin("/usr/local/lib/vapoursynth/libremovegrain.so")
video = core.ffms2.Source('lossless.avi')
deint = hf.QTGMC(video, Preset='Medium', TFF=True)
deint.set_output()
and here is the error I'm receiving:
vspipe --y4m 1.vpy - | ffmpeg -i - -c:v huffyuv qtgmc.avi
ffmpeg version N-81036-g2b14204 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
configuration: --enable-gpl --enable-version3 --enable-shared --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid
libavutil 55. 28.100 / 55. 28.100
libavcodec 57. 50.100 / 57. 50.100
libavformat 57. 42.100 / 57. 42.100
libavdevice 57. 0.102 / 57. 0.102
libavfilter 6. 47.100 / 6. 47.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
Script evaluation failed:
Python exception: No attribute with the name scd exists. Did you mistype a plugin namespace?
Traceback (most recent call last):
File "vapoursynth.pyx", line 1491, in vapoursynth.vpy_evaluateScript (src/cython/vapoursynth.c:24032)
File "1.vpy", line 19, in <module>
deint = hf.QTGMC(video, Preset='Medium', TFF=True)
File "/usr/local/lib/python2.7/site-packages/havsfunc.py", line 980, in QTGMC
if TR0 > 0: ts1 = TemporalSoften(bobbed, 1, 255 << shift, CMts << shift, 28 << shift, 2) # 0.00 0.33 0.33 0.33 0.00
File "/usr/local/lib/python2.7/site-packages/havsfunc.py", line 4330, in TemporalSoften
clip = set_scenechange(clip, scenechange)
File "/usr/local/lib/python2.7/site-packages/havsfunc.py", line 4362, in set_scenechange
sc = core.scd.Detect(sc, thresh)
File "vapoursynth.pyx", line 1105, in vapoursynth.Core.__getattr__ (src/cython/vapoursynth.c:18358)
AttributeError: No attribute with the name scd exists. Did you mistype a plugin namespace?
Any ideas why I can't find that module?
VS_Fan
21st July 2016, 04:55
Howdy folks,
sc = core.scd.Detect(sc, thresh) ...
AttributeError: No attribute with the name scd exists. Did you mistype a plugin namespace?
You're missing the SceneChange (http://forum.doom9.org/showthread.php?t=166769) plugin.
Thank you for the reply vs_fan.
I have downloaded the package, and see c code, but no configure or make file for compiling on Linux.
Those of you using Linux, how did you compile this plugin? My early attempts with gcc are failing.
jackoneill
21st July 2016, 18:39
Thank you for the reply vs_fan.
I have downloaded the package, and see c code, but no configure or make file for compiling on Linux.
Those of you using Linux, how did you compile this plugin? My early attempts with gcc are failing.
Try this:
gcc -fPIC -O2 -msse2 -std=c99 -shared -I/usr/lib/vapoursynth -o libscenechange.so scenechange.c
Thanks jackoneill. That got me going. I had to do the same for the temporalsoften.c file that came with chikuzen's scene change package.
Selur
23rd July 2016, 06:48
I can't reproduce it so I'm not sure what it could be. Maybe you're using an older fmtconv?
I'm using 64bit version for fmtconv r20 from https://github.com/EleonoreMizo/fmtconv/releases
Is there a newer version to try?
-> redownloaded the version, rebooted system cleared python cache and now it works
---------------
Just wondering:
Is there a IVTC filter for Vapoursynth with works with all color spaces?
(IT (https://github.com/HomeOfVapourSynthEvolution/VapourSynth-IT) and VIVTC (http://www.vapoursynth.com/doc/plugins/vivtc.html) seem to only work with YUV420P8 from what I could gather.)
I was hoping to get rid of all the ConvertTo...-calls which I sometimes have to add to my AvisynthScripts to be able to use all filters.
feisty2
24th July 2016, 15:19
requested by @Mystery Keeper here (http://forum.doom9.org/showthread.php?p=1771651#post1771651)
floating point TemporalSoften, don't wanna start another thread so I'll just post it here
src:https://github.com/IFeelBloated/TemporalSoften
bin:https://github.com/IFeelBloated/TemporalSoften/releases/tag/r1
namespace changed to "tsoft"
luma/chroma_threshold, scenechange are all floating point parameters now and they range from 0.0 to 255.0 still for compatibility reasons.
edit:
uhmm, and the useless parameter "mode" got its ass kicked
Myrsloik
24th July 2016, 21:35
I'm using 64bit version for fmtconv r20 from https://github.com/EleonoreMizo/fmtconv/releases
Is there a newer version to try?
-> redownloaded the version, rebooted system cleared python cache and now it works
---------------
Just wondering:
Is there a IVTC filter for Vapoursynth with works with all color spaces?
(IT (https://github.com/HomeOfVapourSynthEvolution/VapourSynth-IT) and VIVTC (http://www.vapoursynth.com/doc/plugins/vivtc.html) seem to only work with YUV420P8 from what I could gather.)
I was hoping to get rid of all the ConvertTo...-calls which I sometimes have to add to my AvisynthScripts to be able to use all filters.
Nope, vivtc only does its decision in one colorspace. Use the clip2 argumebt to apply thr matches to the unconverted clip. It's slightly more awkward but there's just so little telecined material in higher bitdepths...
aegisofrime
27th July 2016, 04:58
Hi all,
I'm wondering, is anyone actively developing a native Vapoursynth version of DGDecNV?
I somehow had a native version of DGDecNV (I think it was released by Donald Graft himself), but then I just upgraded to the GTX 1070. The older version of DGNV doesn't work at all with the Pascal cards, so I had to update my version to DGNV to the latest ones.
Now, the problem is that the older version of DGDecNV won't open an index file created by a newer version, and I can't import the AVS dll of DGDecNV because it's an Avisynth 2.5 plugin. So at this point it feels like I'm screwed. What are my options now?
Selur
27th July 2016, 05:17
Afaik. Donald Graft is the only one with the source code, so he is probably the only one with the means to implement a native Vapoursynth version of DGDecNV.
IIrc DG won't write a native version for Vapoursynth unless Vapoursynth changes, see: http://rationalqm.us/board/viewtopic.php?f=8&t=441
your options are probably:
a. hope the Vapoursynth developers change their code (Avisynth 2.5 filter support and/or handling the frame rate normalization)
b. hope that DG changes his code (dropping Avisynth 2.5 support or alternatively share a 2.5 and 2.6 filter and/or so the frame rate normalization)
c. you could try if it works to create an avisynth script where you use DGDecNV and then open that script as source using vsavsreader, but reading the end of http://forum.doom9.org/showthread.php?t=165957 that might also not work
d. forget DGDecNV in Vapoursynth for the time being
-> my guess is that if c. doesn't work you are stuck with d.
-----
Use the clip2 argumebt to apply thr matches to the unconverted clip.
thanks, totally overlooked that parameter :)
Cu Selur
Mystery Keeper
27th July 2016, 10:59
requested by @Mystery Keeper here (http://forum.doom9.org/showthread.php?p=1771651#post1771651)
floating point TemporalSoften, don't wanna start another thread so I'll just post it here
src:https://github.com/IFeelBloated/TemporalSoften
bin:https://github.com/IFeelBloated/TemporalSoften/releases/tag/r1
namespace changed to "tsoft"
luma/chroma_threshold, scenechange are all floating point parameters now and they range from 0.0 to 255.0 still for compatibility reasons.
edit:
uhmm, and the useless parameter "mode" got its ass kicked
CMts = 255.0 if chromamotion else 0.0
ts1 = core.tsoft.TemporalSoften(bob, 1, 255.0, CMts, 28.0)
ts2 = core.tsoft.TemporalSoften(bob, 2, 255.0, CMts, 28.0)
Segfaults every time in temporalsoften_x64_avx2.dll
from __future__ import print_function
import vapoursynth as vs
core = vs.get_core(threads=8)
core.set_max_cache_size(8000)
#core.std.LoadPlugin(r'D:\Programming\vapoursynth-sandbox\build\release-64bit-gcc\vapoursynth-sandbox.dll')
import sys
sys.path.append('D:\\vapoursynth-plugins\\py\\')
import platform
architecture = platform.architecture()
if architecture[0] == '64bit':
vapoursynth_plugins_path = 'D:\\vapoursynth-plugins\\64bit\\'
else:
vapoursynth_plugins_path = 'D:\\vapoursynth-plugins\\32bit\\'
print('Plugins folder: ', vapoursynth_plugins_path, end='\n', file=sys.stderr)
import os
for filename in os.listdir(vapoursynth_plugins_path):
if filename[-4:] != '.dll':
continue
try:
core.std.LoadPlugin(vapoursynth_plugins_path + filename)
except Exception as e:
print('Error: ', e, end='\n', file=sys.stderr)
clip = core.ffms2.Source(r'F:\Video\Mystery Keeper\Sound Horizon - 石畳の緋き悪魔.mkv')
clip = core.resize.Spline16(clip, format=vs.YUV444PS)
clip = core.tsoft.TemporalSoften(clip, 1, 255.0, 255.0, 28.0)
clip.set_output()
Same. The script does evaluate in VSEdit. But segfaults on preview.
feisty2
27th July 2016, 12:47
guess I messed "scenechange" up
investigating...
kolak
27th July 2016, 20:08
Could someone translate this into vs please:
changeFPS(60000, 1001)
assumeTFF()
separateFields()
selectEvery(4, 0, 3)
weave()
if it's actually possible. Thx!
~SimpleX~
27th July 2016, 21:35
Could someone translate this into vs please:
changeFPS(60000, 1001)
assumeTFF()
separateFields()
selectEvery(4, 0, 3)
weave()
if it's actually possible. Thx!
import vapoursynth as vs
import havsfunc as haf
import mvsfunc as mvs
core = vs.get_core()
src = ...
last = src
last = haf.ChangeFPS(last, 60000, 1001)
last = mvs.AssumeTFF(last) # Actually, not all filters support this, unfortunately
last = core.std.SeparateFields(last)
last = core.std.SelectEvery(last, 4, [0, 3])
last = haf.Weave(last, tff=True) # this one doesn't
last.set_output()
This should do it. You need mvsfunc and havsfunc for this to work.
kolak
27th July 2016, 22:14
:thanks:
I assume this won't support 8bit+ bit depths?
feisty2
28th July 2016, 07:42
CMts = 255.0 if chromamotion else 0.0
ts1 = core.tsoft.TemporalSoften(bob, 1, 255.0, CMts, 28.0)
ts2 = core.tsoft.TemporalSoften(bob, 2, 255.0, CMts, 28.0)
Segfaults every time in temporalsoften_x64_avx2.dll
from __future__ import print_function
import vapoursynth as vs
core = vs.get_core(threads=8)
core.set_max_cache_size(8000)
#core.std.LoadPlugin(r'D:\Programming\vapoursynth-sandbox\build\release-64bit-gcc\vapoursynth-sandbox.dll')
import sys
sys.path.append('D:\\vapoursynth-plugins\\py\\')
import platform
architecture = platform.architecture()
if architecture[0] == '64bit':
vapoursynth_plugins_path = 'D:\\vapoursynth-plugins\\64bit\\'
else:
vapoursynth_plugins_path = 'D:\\vapoursynth-plugins\\32bit\\'
print('Plugins folder: ', vapoursynth_plugins_path, end='\n', file=sys.stderr)
import os
for filename in os.listdir(vapoursynth_plugins_path):
if filename[-4:] != '.dll':
continue
try:
core.std.LoadPlugin(vapoursynth_plugins_path + filename)
except Exception as e:
print('Error: ', e, end='\n', file=sys.stderr)
clip = core.ffms2.Source(r'F:\Video\Mystery Keeper\Sound Horizon - 石畳の緋き悪魔.mkv')
clip = core.resize.Spline16(clip, format=vs.YUV444PS)
clip = core.tsoft.TemporalSoften(clip, 1, 255.0, 255.0, 28.0)
clip.set_output()
Same. The script does evaluate in VSEdit. But segfaults on preview.
https://github.com/IFeelBloated/TemporalSoften/releases/tag/r2
should work now, I wasn't cautious enough with all that pointer arithmetic stuff...
and added sanity check
Mystery Keeper
28th July 2016, 08:43
https://github.com/IFeelBloated/TemporalSoften/releases/tag/r2
should work now, I wasn't cautious enough with all that pointer arithmetic stuff...
and added sanity checkIt works! Thank you!
feisty2
28th July 2016, 09:41
It works! Thank you!
just out of curiosity, no offense, you obviously should be a much better programmer than me cuz you wrote vsedit, and making a floating point version of temporalsoften should be easy like a blink to you, right?
Mystery Keeper
28th July 2016, 09:48
just out of curiosity, no offense, you obviously should be a much better programmer than me cuz you wrote vsedit, and making a floating point version of temporalsoften should be easy like a blink to you, right?If I knew how it was supposed to work - yes. If I would dedicate time to read and understand the original filter - sure, I could have rewritten it for float input. Or even simply upgrade the existing one. But I've got much on my plate. Not even working on vsedit as much as I'd like to.
feisty2
28th July 2016, 17:37
just rewrote TemporalSoften, now it supports all sample types except half precision
and changed the namespace back to "focus"
x64+avx2 binary here, https://github.com/IFeelBloated/TemporalSoften/releases/tag/r3
replace VapourSynth\core64\plugins\libtemporalsoften.dll with this
compile the cpp yourself if you're looking for the x86 binary or if you don't have an AVX2 cpu
Myrsloik
28th July 2016, 17:42
just rewrote TemporalSoften, now it supports all sample types except half precision
and changed the namespace back to "focus"
x64+avx2 binary here, https://github.com/IFeelBloated/TemporalSoften/releases/tag/r3
replace VapourSynth\core64\plugins\libtemporalsoften.dll with this
compile the cpp yourself if you're looking for the x86 binary or if you don't have an AVX2 cpu
Does avx2 actually make it faster? Visual studio is generally shit at autovectorizing and even trivial things can make it give up.
And if this thing actually works and isn't slower than the previous version I guess I'll include it in the installer.
feisty2
28th July 2016, 17:46
Does avx2 actually make it faster? Visual studio is generally shit at autovectorizing and even trivial things can make it give up.
And if this thing actually works and isn't slower than the previous version I guess I'll include it in the installer.
dunno, simply turned the autovectorizing switch on...
I'll be thrilled if someone could make a gcc build..
Myrsloik
28th July 2016, 17:47
Here's R33 test4 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R33-test4.exe)
Main attraction: float support added to just about all remaining core functions. Also spaghetti intrinsics optimized so everything should be much faster.
Beware of bugs and check any script using the updated functions a bit extra.
Changes:
r33:
the rshift argument of sobel/prewitt is now deprecated because it's pointless, simply scale the min and max args as appropriate
optimized minimum, maximum, median, deflate, inflate, convolution (1x3, 3x1 and 3x3) on x86 cpus
added float support to minimum, maximum, median, deflate, inflate, convolution, prewitt, sobel, invert, limiter, binarize and levels functions, note that most of the arguments have been changed from int to float
the whole project can now be compiled with clang-cl under windows
directshowsource from recent avs+ can now be used
fixed swapped uv planes with yuv411 output in vsvfw and avfs
merged vsfs with the latest version of avfs, avfs now work for both vapoursynth and avisynth scripts and no longer has shell integration
avisource can now open all formats vsvfw can output plus b48r
fixed corrupted output in vfm when clip2 isn't 8 bit
fixed crash due to stack overflow if an extremely long filter graph is freed
now installs the vs2015 update 3 runtimes on windows
vsvfw will now automatically convert rgb24 to packed bgra for convenience
added b64a and P416 output to vsvfw
updated to zimg v2.1 branch
mixed imwri fixes
fixed rare access violation in expr when ternary operator is used (jackoneill)
feisty2
28th July 2016, 18:19
@Myrsloik
my version runs faster
import vapoursynth as vs
core = vs.get_core()
clp = blah
clp = core.fmtc.bitdepth(clp,bits=16,fulls=False,fulld=True)
clp = core.std.ShufflePlanes(clp,0,vs.GRAY)
clp= core.focus.TemporalSoften(clp,luma_threshold=255)
clp.set_output()
my version
http://i.imgur.com/PvvToxY.png
the one comes with the installer
http://i.imgur.com/h1hag8u.png
feisty2
28th July 2016, 18:32
maybe the compiler inlined all lambda expressions so my version runs faster but not SIMD kind of faster (both are AVX2)
modern c++ is awesome
jackoneill
28th July 2016, 18:38
1. Use the dot as output file name so vspipe doesn't write the frames anywhere.
2. Let vspipe finish and post the speeds printed at the end.
feisty2
28th July 2016, 19:05
my version
http://i.imgur.com/aLAgGQd.png
installer one
http://i.imgur.com/03KIYsI.png
my version runs slower this time and actually it's kind of expected, my version contains an extra clamping on integer samples to prevent possible over/underflow and the installer one doesn't
it's just weird my version ran faster the first time..
LigH
28th July 2016, 19:58
I hope there is also still an SSE2 only version, or I could not use it on my Phenom-II PCs.
feisty2
28th July 2016, 21:07
Does avx2 actually make it faster? Visual studio is generally shit at autovectorizing and even trivial things can make it give up.
you're right, visual studio compiler is a piece of lame shit, so I switched autovectorizing off and the performance is exactly the same as when it was on...damn
so maybe my version runs slower cuz it has no SIMD opt and the installer one does..
I hope there is also still an SSE2 only version, or I could not use it on my Phenom-II PCs.
I replaced r3 with a plain x64 binary without any SIMD opt..
kolak
28th July 2016, 21:12
import vapoursynth as vs
import havsfunc as haf
import mvsfunc as mvs
core = vs.get_core()
src = ...
last = src
last = haf.ChangeFPS(last, 60000, 1001)
last = mvs.AssumeTFF(last) # Actually, not all filters support this, unfortunately
last = core.std.SeparateFields(last)
last = core.std.SelectEvery(last, 4, [0, 3])
last = haf.Weave(last, tff=True) # this one doesn't
last.set_output()
This should do it. You need mvsfunc and havsfunc for this to work.
Sort of double my question- no way of running this on vs native capabilities with 8bit+ support?
feisty2
29th July 2016, 01:20
kind of a more fair test here
did some cleanup to my version and it runs a bit faster now... just a little bit
http://i.imgur.com/jqv4sH5.png
and jackoneill's version (https://github.com/dubhater/vapoursynth-temporalsoften/blob/master/src/temporalsoften.c)
inserted clamping, and compiled with the same settings used in my version
http://i.imgur.com/e76T5Ur.png
still faster..
dunno what's happening here cuz I'm no professional programmer...
looking for some advice
feisty2
29th July 2016, 11:33
so I managed to get rid of alloca(), and got a performance boost again,
http://i.imgur.com/eRxhyis.png
interesting, so alloca() actually cost some time here, thought stack memory allocation should come with miniature and negligible costs...
@Myrsloik
Is 347.69fps against 371.93fps (6.517% performance loss) acceptable?
I'll stop investigating further about performance stuff if so...
Myrsloik
29th July 2016, 12:51
I guess it's close enough. Sometimes just changing irrelevant stuff makes it compile things very differently and slower. That's life. Try making gcc builds of both and compare that. The result could be completely different. Or try clang-cl (http://llvm.org/builds/) which is easy to use in windows.
Myrsloik
29th July 2016, 12:53
This is an important filtering announcement:
Stop using RemoveGrain!
...at least some of the modes.
Several RemoveGrain functions have now gotten better substitutes in the core that support float as well.
Mode 4 replacement (always same speed or faster, much faster for 8bit): Median()
Mode 20 replacement (always same speed or faster): Convolution(matrix=[1, 1, 1, 1, 1, 1, 1, 1, 1])
Mode 19 replacement (about half as fast): Convolution(matrix=[1, 1, 1, 1, 0, 1, 1, 1, 1])
Mode 11&12 replacement (about half as fast): Convolution(matrix=[1, 2, 1, 2, 4, 2, 1, 2, 1])
feisty2
29th July 2016, 17:16
https://github.com/IFeelBloated/vapoursynth-focus
repo renamed to vapoursynth-focus, added SpatialSoften port, all sample types except half precision are supported like TemporalSoften
SpatialSoften was coded for YUY2 in avisynth and I gotta say, YUY2 is a BITCH!!!
@Myrsloik
guess you could simply merge it to https://github.com/vapoursynth/vapoursynth/tree/master/src/filters
LigH
29th July 2016, 17:19
SpatialSoften was coded for YUY2 in avisynth and I gotta say, YUY2 is a BITCH!!!
Yes, packed-pixel formats are a lot more annoying than planar formats. That's why AviSynth people still hope for a full featured YV16 port of QTGMC... or does it already work? Okay, wrong topic here. :rolleyes:
Boulder
29th July 2016, 17:25
The Windows compiling instructions say that YASM 1.3.0 is broken on Windows. In what way - i.e., does it affect compiling other stuff such as x264 or x265 as well?
LigH
29th July 2016, 17:41
YASM 1.3.0 - broken in which way? x265 relies on it...
Myrsloik
29th July 2016, 18:11
The Windows compiling instructions say that YASM 1.3.0 is broken on Windows. In what way - i.e., does it affect compiling other stuff such as x264 or x265 as well?
The visual studio integration is broken.
feisty2
30th July 2016, 09:48
Yes, packed-pixel formats are a lot more annoying than planar formats. That's why AviSynth people still hope for a full featured YV16 port of QTGMC... or does it already work? Okay, wrong topic here. :rolleyes:
//Avisynth SpatialSoften
...
int edge = (diameter+1) & -4; //wtf????
for (x=0; x<edge; ++x) // diameter-1 == (diameter>>1) * 2
dstp[y*dst_pitch + x] = srcp[y*src_pitch + x];
for (; x < row_size - edge; x+=2)
{
int cnt=0, _y=0, _u=0, _v=0;
int xx = x | 3; //wtf?????
int Y = srcp[y*src_pitch + x], U = srcp[y*src_pitch + xx - 2], V = srcp[y*src_pitch + xx];
for (int h=0; h<diameter; ++h)
{
for (int w = -diameter+1; w < diameter; w += 2)
{
int xw = (x+w) | 3; //?????
if (IsClose(line[h][x+w], Y, luma_threshold) && IsClose(line[h][xw-2], U,
chroma_threshold) && IsClose(line[h][xw], V, chroma_threshold))
{
++cnt; _y += line[h][x+w]; _u += line[h][xw-2]; _v += line[h][xw];
}
}
}
dstp[y*dst_pitch + x] = (_y + (cnt>>1)) / cnt;
if (!(x&3)) { //??????
dstp[y*dst_pitch + x+1] = (_u + (cnt>>1)) / cnt;
dstp[y*dst_pitch + x+3] = (_v + (cnt>>1)) / cnt;
}
}
...
been told C is nothing but a glorified assembly language, never thought that to be serious, and I actually do think that's being serious not kidding staring at all these bizarre bullshit bitwise operations required for YUY2
YUY2 is evil
jackoneill
30th July 2016, 12:01
been told C is nothing but a glorified assembly language, never thought that to be serious, and I actually do think that's being serious not kidding staring at all these bizarre bullshit bitwise operations required for YUY2
YUY2 is evil
I'm pretty they are not required. It all depends on the programmer's style:
// the largest multiple of 4 less than or equal to diameter + 1:
int edge = (diameter+1) & -4; //wtf????
// Slightly more intelligible because I don't have to think about how -4 looks in binary:
int edge = (diameter + 1) & ~3;
// And more still:
int edge = (diameter + 1) / 4 * 4;
// or:
int edge = (diameter + 1) - ((diameter + 1) % 4);
GCC output with -O2:
4003b0: 8d 47 01 lea eax,[rdi+0x1]
4003b3: 83 e0 fc and eax,0xfffffffc
4003b0: 8d 47 01 lea eax,[rdi+0x1]
4003b3: 83 e0 fc and eax,0xfffffffc
4003b0: 8d 47 04 lea eax,[rdi+0x4]
4003b3: 83 c7 01 add edi,0x1
4003b6: 0f 49 c7 cmovns eax,edi
4003b9: 83 e0 fc and eax,0xfffffffc
4003b0: 8d 47 01 lea eax,[rdi+0x1]
4003b3: 89 c1 mov ecx,eax
4003b5: c1 f9 1f sar ecx,0x1f
4003b8: c1 e9 1e shr ecx,0x1e
4003bb: 8d 14 08 lea edx,[rax+rcx*1]
4003be: 83 e2 03 and edx,0x3
4003c1: 29 ca sub edx,ecx
4003c3: 29 d0 sub eax,edx
Notice how even the latter two don't contain the dreaded idiv instruction. Furthermore, these seem to be unsigned quantities. If you make the variables unsigned instead of int:
4003b0: 8d 47 01 lea eax,[rdi+0x1]
4003b3: 83 e0 fc and eax,0xfffffffc
4003b0: 8d 47 01 lea eax,[rdi+0x1]
4003b3: 83 e0 fc and eax,0xfffffffc
4003b0: 8d 47 01 lea eax,[rdi+0x1]
4003b3: 83 e0 fc and eax,0xfffffffc
4003b0: 8d 47 01 lea eax,[rdi+0x1]
4003b3: 83 e0 fc and eax,0xfffffffc
int xx = x | 3; //wtf?????
// The next multiple of 4, minus 1
int xx = x / 4 * 4 + 3;
GCC output with -O2:
4003b0: 89 f8 mov eax,edi
4003b2: 83 c8 03 or eax,0x3
4003b0: 8d 47 03 lea eax,[rdi+0x3]
4003b3: 85 ff test edi,edi
4003b5: 0f 49 c7 cmovns eax,edi
4003b8: 83 c8 03 or eax,0x3
With unsigned variables:
4003b0: 89 f8 mov eax,edi
4003b2: 83 c8 03 or eax,0x3
4003b0: 89 f8 mov eax,edi
4003b2: 83 c8 03 or eax,0x3
// If x is a multiple of 4:
if (!(x&3)) { //??????
if (x % 4 == 0) {
GCC output with -O2:
4003b0: 89 f8 mov eax,edi
4003b2: 83 e0 03 and eax,0x3
4003b0: 89 fa mov edx,edi
4003b2: c1 fa 1f sar edx,0x1f
4003b5: c1 ea 1e shr edx,0x1e
4003b8: 8d 04 17 lea eax,[rdi+rdx*1]
4003bb: 83 e0 03 and eax,0x3
4003be: 29 d0 sub eax,edx
With unsigned variables:
4003b0: 89 f8 mov eax,edi
4003b2: 83 e0 03 and eax,0x3
4003b0: 89 f8 mov eax,edi
4003b2: 83 e0 03 and eax,0x3
tl;dr: C lets you fiddle with the bits directly, but you don't have to if you'd rather not.
TheFluff
30th July 2016, 12:13
Avisynth code looks like it does because it is from the dark ages and written by people who really didn't care about code maintenance.
Selur
31st July 2016, 08:18
As a side note: the new DGDecNV version which uses Avisynth 2.6 seems to work fine with Vapoursynth. (http://rationalqm.us/board/viewtopic.php?f=8&t=463&start=10#p5005 and following)
Boulder
31st July 2016, 10:41
Whoa, that's perfect :) I never got a notification from that thread, thanks for pointing it out.
feisty2
3rd August 2016, 09:37
sometimes I just think something like this
auto src_stride = vsapi->getStride(src, plane) / sizeof(float);
auto srcp = reinterpret_cast<const float *>(vsapi->getReadPtr(src, plane));
auto h = vsapi->getFrameHeight(src, plane);
auto w = vsapi->getFrameWidth(src, plane);
for (auto y = 0; y < h; ++y) {
for (auto x = 0; x < w; ++x) {
//srcp[x], blah blah blah
}
srcp += src_stride;
}
which is the widely used way of filter writing, is super inconvenient, the frame itself is 2D obviously
and treating it like 1D(single line each time) brings a lot of extra trouble sometimes, referencing neighbor pixels at the current line is direct and handy, and referencing vertically neighbor pixels goes straight to pointer arithmetic and that's error prone and not nice..
so why not just treat it like 2D cuz it's, well, just actually 2D..
auto src_stride = vsapi->getStride(src, plane) / sizeof(float);
auto srcp = reinterpret_cast<const float *>(vsapi->getReadPtr(src, plane));
auto h = vsapi->getFrameHeight(src, plane);
auto w = vsapi->getFrameWidth(src, plane);
auto actual_srcp = reinterpret_cast<decltype(&srcp)>(alloca(sizeof(srcp) * h));
for (auto i = 0; i < h; ++i)
actual_srcp[i] = srcp + i * src_stride;
for (auto y = 0; y < h; ++y)
for (auto x = 0; x < w; ++x) {
//actual_srcp[y][x], blah blah blah
}
this makes referencing vertically and horizontally neighbor pixels equally handy, no pointer arithmetic required since actual_srcp itself is a 2D pointer.
just wondering why no one ever did this, I mean, what's the con of writing filter this way?
Myrsloik
3rd August 2016, 09:47
Worse code generation. That's why. Every time you try to be clever the visual studio compiler punishes you with insanely stupid code generation.
And it's not 2D at all in memory. Obfuscation will only make fewer people remember that.
~SimpleX~
4th August 2016, 00:05
Myrsloik, does "std.PlaneStats" work correctly? Should PlaneStatsDiff be calculated like abs(f[0].props.PlaneStatsAverage - f[1].props.PlaneStatsAverage)?
I have a script like this:
sep = core.std.PlaneStats(core.std.SeparateFields(clip, tff=True), plane=0)
top = core.std.SelectEvery(sep, 2, 0)
bot = core.std.SelectEvery(sep, 2, 1)
def _apply_show(n, f):
fout = f[0].copy()
diff = abs(f[1].props.PlaneStatsAverage - f[2].props.PlaneStatsAverage)
fout.props.FieldsDiff = diff
return fout
propclip = core.std.ModifyFrame(clip, clips=[clip, top, bot], selector=_apply_show)
if True:
return core.text.FrameProps(core.std.PlaneStats(top, bot, plane=0))
else:
return core.text.FrameProps(propclip, props=["FieldsDiff"])
PlaneStatsDiff value is not even close to FieldsDiff.
Myrsloik
4th August 2016, 00:29
Myrsloik, does "std.PlaneStats" work correctly? Should PlaneStatsDiff be calculated like abs(f[0].props.PlaneStatsAverage - f[1].props.PlaneStatsAverage)?
I have a script like this:
sep = core.std.PlaneStats(core.std.SeparateFields(clip, tff=True), plane=0)
top = core.std.SelectEvery(sep, 2, 0)
bot = core.std.SelectEvery(sep, 2, 1)
def _apply_show(n, f):
fout = f[0].copy()
diff = abs(f[1].props.PlaneStatsAverage - f[2].props.PlaneStatsAverage)
fout.props.FieldsDiff = diff
return fout
propclip = core.std.ModifyFrame(clip, clips=[clip, top, bot], selector=_apply_show)
if True:
return core.text.FrameProps(core.std.PlaneStats(top, bot, plane=0))
else:
return core.text.FrameProps(propclip, props=["FieldsDiff"])
PlaneStatsDiff value is not even close to FieldsDiff.
Only planestats gives the correct value. The planeaverage way is wrong. I think I brainfarted when I wrote that lpng ago.
shekh
4th August 2016, 08:06
this makes referencing vertically and horizontally neighbor pixels equally handy, no pointer arithmetic required since actual_srcp itself is a 2D pointer.
just wondering why no one ever did this, I mean, what's the con of writing filter this way?
You precomputed result of multiply into table.
Advantages:
marginally cleaner code
Disadvantages:
no performance gain (integer multiply is fast)
longer code to access pixel (maybe slower)
extra cache pollution
littlepox
5th August 2016, 14:55
Bug Report for std.Expr(probably another bug in the ternary operator):
src8 = core.lsmas.LWLibavSource("xxx.mkv") # some normal video input
res = core.std.Expr(src8, "x 5 < 0 x 10 < x 16 - dup * 256 ? ?")
res.set_output()
This crashes.
#####################################################
However,
src8 = core.lsmas.LWLibavSource("xxx.mkv") # some normal video input
res = core.std.Expr(src8, "x 5 >= x 10 < x 16 - dup * 256 ? 0 ?")
res.set_output()
This works.
Myrsloik
5th August 2016, 15:06
Bug Report for std.Expr(probably another bug in the ternary operator):
src8 = core.lsmas.LWLibavSource("xxx.mkv") # some normal video input
res = core.std.Expr(src8, "x 5 < 0 x 10 < x 16 - dup * 256 ? ?")
res.set_output()
This crashes.
#####################################################
However,
src8 = core.lsmas.LWLibavSource("xxx.mkv") # some normal video input
res = core.std.Expr(src8, "x 5 >= x 10 < x 16 - dup * 256 ? 0 ?")
res.set_output()
This works.
And which version did you use?
littlepox
5th August 2016, 15:08
And which version did you use?
R32 64bit with Python 3.5.0
Myrsloik
5th August 2016, 15:14
R32 64bit with Python 3.5.0
Try the latest R33 test version then.
feisty2
5th August 2016, 15:18
replicable under r33 test4
http://i.imgur.com/bobM2Gj.png
littlepox
5th August 2016, 15:21
Excuse me if this is trivial, but where can I get the builds for the test versions?
Boulder
5th August 2016, 17:16
Excuse me if this is trivial, but where can I get the builds for the test versions?
http://forum.doom9.org/showthread.php?p=1775684#post1775684
Myrsloik compiles them every now and then and posts the links here.
littlepox
5th August 2016, 17:24
http://forum.doom9.org/showthread.php?p=1775684#post1775684
Myrsloik compiles them every now and then and posts the links here.
Thanks. Just as f2 pointed out, that bug is replicate under R33 test4.
Selur
5th August 2016, 18:35
When using LWLibavSource in Vapoursynth like this:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/SourceFilter/LSmashSource/vslsmashsource.dll")
# Loading Source: C:/Users/Selur/Desktop/test2160.mov ProRes 10bit 4196x2160
clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/test2160.mov")
# Cropping
clip = core.std.CropRel(clip=clip, left=0, right=0, top=224, bottom=224)
# Output
clip.set_output()
I notice:
a. it's really slow compared to when using LWLibavSource in an Avisynth script
b. I get an error message when I close the preview :
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001cb3508e060] ignoring 'frma' atom of 'mp4a', stream format is 'mp4a' is there a way to suppress that error? (not really interested in the audio,..)
Cu Selur
Ps.: is there also a portable version of the latest vapoursynth test build?
Myrsloik
5th August 2016, 18:50
R33 test6 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R33-test6.exe)
Changes from test4:
Should fix the recently reported expr bug
The installer now allows other python distributions to be used, works with anaconda under certain conditions
Some more genericfunctions tweaks that probably no one will notice
feisty2
5th August 2016, 18:56
Okay...
Where's test5?
Selur
5th August 2016, 19:38
@myrsloik: any chance for a portable version of the test6 ?
Myrsloik
5th August 2016, 20:03
@myrsloik: any chance for a portable version of the test6 ?
Maybe when I reach RC stage. Still have to test so many things. But at least I'm done with all new features for R33... I think.
QTGMC (and other complex scripts) speed comparisons with R32 are also welcome. I'm curious how bug different it makes. Just remember to replace the relevant removegrainmodes first.
~SimpleX~
5th August 2016, 20:30
Myrsloik, could you please fix PlaneStats (average/diff)? I'd like to use it in SmartFade function (which compares average luma of top/bottom fields).
Myrsloik
5th August 2016, 20:47
Myrsloik, could you please fix PlaneStats (average/diff)? I'd like to use it in SmartFade function (which compares average luma of top/bottom fields).
Fix what? It's correct. Or you at least have to describe why you think it sin't correct.
~SimpleX~
5th August 2016, 21:08
Why abs(f[0].props.PlaneStatsAverage - f[1].props.PlaneStatsAverage) is not the same with the PlaneStatsDiff generated by core.std.PlaneStats(clip1, clip2, plane=0)?
I've asked that one page ago.
Myrsloik
5th August 2016, 21:17
Why abs(f[0].props.PlaneStatsAverage - f[1].props.PlaneStatsAverage) is not the same with the PlaneStatsDiff generated by core.std.PlaneStats(clip1, clip2, plane=0)?
I've asked that one page ago.
Because that's not how a per pixel difference is calculated
jackoneill
5th August 2016, 21:21
Myrsloik, could you please fix PlaneStats (average/diff)? I'd like to use it in SmartFade function (which compares average luma of top/bottom fields).
Maybe this helps: https://github.com/dubhater/Wobbly/blob/27be6fba018139dd46d77b8aa3fc956e84833149/src/wibbly/WibblyJob.cpp#L280
~SimpleX~
5th August 2016, 22:21
Only planestats gives the correct value. The planeaverage way is wrong. I think I brainfarted when I wrote that lpng ago.
Then I didn't understand what you meant here. Sorry.
Maybe this helps: https://github.com/dubhater/Wobbly/blob/27be6fba018139dd46d77b8aa3fc956e84833149/src/wibbly/WibblyJob.cpp#L280
Yup, thanks. That's close to my function, but I like the code. :thanks:
aculnaig
18th August 2016, 21:32
VapourSynth latest git.
zimg latest git.
Give me this.
CXX src/core/libvapoursynth_la-vsresize.lo
src/core/vsresize.cpp: In constructor ‘{anonymous}::vszimg::vszimg(const VSMap*, void*, VSCore*, const VSAPI*)’:
src/core/vsresize.cpp:747:69: error: ‘NAN’ was not declared in this scope
src_left = propGetScalarDef<double>(in, "src_left", NAN, vsapi);
^~~
make: *** [Makefile:1457: src/core/libvapoursynth_la-vsresize.lo] Error 1
GCC info
gcc --version
gcc (GCC) 6.1.1 20160802
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
EDIT --> Rolling back to commit f96db59 compile fine
feisty2
19th August 2016, 16:05
@Myrsloik
http://forum.doom9.org/showthread.php?t=173470
http://forum.doom9.org/showthread.php?t=173703
these 2 modules I wrote are well documented and seem to be bug free for now after series of different tests..
can you add them to the plugin list?
Myrsloik
19th August 2016, 17:50
It's time for the glorious R33 RC1 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R33-RC1.exe)!
It's now mostly compiled with clang-cl which should give slightly better performance and hopefully no new bugs either. Note that the internal resizers now have reached feature parity with fmtconv apart from a few of the more exotic dithering methods.
And remember to STOP USING REMOVE GRAIN (http://forum.doom9.org/showpost.php?p=1775776&postcount=2191) (sometimes)
Changes:
r33:
added autoadjust to prefetch list
the resizers can now have the active image region specified to do things like subpixel shifts and cropping
genericfilters is no longer included with the installer and has been deprecated for a long time, if you for some reason miss canny simply use the tcanny plugin instead for a better implementation
assvapour was renamed to subtext and now supports bitmap subtitles as well (jackoneill)
alternative python installations can now be selected when installing on windows, note that there many pitfalls when not using python from python.org
the rshift argument of sobel/prewitt is now deprecated because it's pointless, simply scale the min and max args as appropriate
optimized minimum, maximum, median, deflate, inflate, convolution (1x3, 3x1 and 3x3) on x86 cpus
added float support to minimum, maximum, median, deflate, inflate, convolution, prewitt, sobel, invert, limiter, binarize and levels functions, note that most of the arguments have been changed from int to float
the whole project can now be compiled with clang-cl under windows
directshowsource from recent avs+ can now be used
fixed swapped uv planes with yuv411 output in vsvfw and avfs
merged vsfs with the latest version of avfs, avfs now work for both vapoursynth and avisynth scripts and no longer has shell integration
avisource can now open all formats vsvfw can output plus b48r
fixed corrupted output in vfm when clip2 isn't 8 bit
fixed crash due to stack overflow if an extremely long filter graph is freed
now installs the vs2015 update 3 runtimes on windows
vsvfw will now automatically convert rgb24 to packed bgra for convenience
added b64a and P416 output to vsvfw
updated to zimg v2.2 branch
mixed imwri fixes
fixed rare access violation in expr when ternary operator is used (jackoneill)
As usual speed comparisons with R32 are welcome. Especially with scripts with fmtconv and removegrain replaced.
Myrsloik
19th August 2016, 17:57
@Myrsloik
http://forum.doom9.org/showthread.php?t=173470
http://forum.doom9.org/showthread.php?t=173703
these 2 modules I wrote are well documented and seem to be bug free for now after series of different tests..
can you add them to the plugin list?
Vine I'll add but something that even calls itself placebo is something I'm not so sure would be useful to others...
feisty2
19th August 2016, 18:40
Vine I'll add but something that even calls itself placebo is something I'm not so sure would be useful to others...
I found that performance boost without serious quality degradation is possible for Oyster recently, so keeping the temporal radius 6 for Oyster.Basic and setting a smaller radius like 3 or 2 in other functions gave me at least 10x speed boost! speed could be further revved by using 0.5 pixel precision motion estimation instead of 0.25 pixel precision stuff, and MVTools' internal resampling function instead of NNEDI
and besides, it could also be useful if someone has some short and precious footage that suffers from compression artifacts, in this case people care much less about performance and much more about quality, like movies that were shot mostly on 35mm but a few scenes on 70mm IMAX because those scenes are valuable and deserve better
or maybe someone like me finds it interesting and would like to toy or experiment with it...
Selur
19th August 2016, 19:26
It's time for the glorious R33 RC1!
Portable version too ? :D
Myrsloik
19th August 2016, 19:28
Portable version too ? :D
32bit (https://dl.dropboxusercontent.com/u/73468194/VapourSynth32-Portable-R33-RC1.7z)
64bit (https://dl.dropboxusercontent.com/u/73468194/VapourSynth64-Portable-R33-RC1.7z)
Selur
19th August 2016, 19:28
Thanks! :)
feisty2
20th August 2016, 09:01
https://github.com/IFeelBloated/vapoursynth-focus/releases/tag/r4
windows binaries(x86+x64 with no extension) for spatialsoften and temporalsoften
I messed around with LLVM a while ago and the binary it generated was slower than msvc binary...
Myrsloik
21st August 2016, 12:19
R33 RC2 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R33-RC2.exe)
Possibly fixes some newly introduced resizing issues
Will post a portable version after things are confirmed to actually be fixed
Selur
21st August 2016, 12:20
:D Portable version too ? :D
Myrsloik
21st August 2016, 22:15
R33 RC2 32 portable (https://dl.dropboxusercontent.com/u/73468194/VapourSynth32-Portable-R33-RC2.7z)
R33 RC2 64 portable (https://dl.dropboxusercontent.com/u/73468194/VapourSynth64-Portable-R33-RC2.7z)
This should be the final rc I guess. Test it well. Will release in 3 days or so if no major bugs are found.
Selur
22nd August 2016, 04:29
Thanks.
Myrsloik
23rd August 2016, 17:01
R33 is released!!!!!1111 :eek:
The usual blog post is here (http://www.vapoursynth.com/2016/08/r33-a-somewhat-experimental-release/).
VS_Fan
23rd August 2016, 21:03
Happy 5th birthday VS !!! 2 days in advance :D:D:D
Thanks Myrsloik :)
feisty2
23rd August 2016, 21:13
Why is there a huge date gap like over a year between #1 and #2?
What happened?
edit: typo
Myrsloik
23rd August 2016, 21:13
Happy 5th birthday VS !!! 2 days in advance :D:D:D
Thanks Myrsloik :)
According to my calculations it's 4 years but maybe you started being a fan before VS turned into a mainstream sellout:D
Reel.Deel
24th August 2016, 00:31
Happy 5th birthday VS !!! 2 days in advance :D:D:D
Thanks Myrsloik :)
I remember when it was just a baby. :D
But yeah, VS has come a long way since then. Kudos to Myrsloik, jackoneill, and everyone else who has contributed. :thanks:
I used it before it was cool! :p
hydra3333
24th August 2016, 02:55
QTGMC (and other complex scripts) speed comparisons with R32 are also welcome. I'm curious how bug different it makes. Just remember to replace the relevant removegrainmodes first.
This is an important filtering announcement: Stop using RemoveGrain! ...at least some of the modes.
Several RemoveGrain functions have now gotten better substitutes in the core that support float as well.
Mode 4 replacement (always same speed or faster, much faster for 8bit): Median() http://www.vapoursynth.com/doc/functions/median.html
Mode 20 replacement (always same speed or faster): Convolution(matrix=[1, 1, 1, 1, 1, 1, 1, 1, 1]) http://www.vapoursynth.com/doc/functions/convolution.html
Mode 19 replacement (about half as fast): Convolution(matrix=[1, 1, 1, 1, 0, 1, 1, 1, 1]) http://www.vapoursynth.com/doc/functions/convolution.html
Mode 11&12 replacement (about half as fast): Convolution(matrix=[1, 2, 1, 2, 4, 2, 1, 2, 1]) http://www.vapoursynth.com/doc/functions/convolution.html
OK, QTGMC is in HAvsFunc which uses removegrain http://forum.doom9.org/showthread.php?p=1603176#post1603176. Per http://forum.doom9.org/showthread.php?p=1777252#post1777252 I have a local copy of HAvsFunc R23 with a change to temporalsoften (not in r23), do I also need to find and change these two uses of removegrain in it ?
Mode 4 replacement (always same speed or faster, much faster for 8bit): Median()
Mode 20 replacement (always same speed or faster): Convolution(matrix=[1, 1, 1, 1, 1, 1, 1, 1, 1])
Or, is there likely to be an updated HAvsFunc in the near future ?
edit:
Especially with scripts with fmtconv and removegrain replaced.
same thing applies for uses of fmtconv I suppose, any hints on what to change ?
AzraelNewtype
24th August 2016, 07:26
Using rgvs.RemoveGrain still works, it's just often slower. fmtconv also still works, it's just that there's less reason to bother with it now that the z.img based internal resizers support left-top/width-height offsets. It may have just gotten a speed boost too, but I forget now. There are still a couple extremely niche uses for fmtconv over the internal, but they are much rarer (invks, or the need for specialized dither patterns that mostly aren't going to survive lossy encoding anyway).
You should definitely swap them out anyway and run some tests, because everybody likes numbers. Hell, do tests at every individual replacement point. Go hog wild. Then you can even pull request the updated version for HolyWu, so the changes don't have to be duplicated by hand.
Myrsloik
24th August 2016, 12:09
I released R33.1 because memory leaks suck.
Boulder
24th August 2016, 16:25
While trying to build VapourSynth with MSVC 2015 (I like to play around with these open source projects to learn things), I get a bit of errors when zimg is being compiled and also a fair amount of other warnings/errors. I don't recall seeing these before. Did something change so that building with MSVC is not as straightforward as it used to be?
http://pastebin.com/8map1cJQ
Myrsloik
24th August 2016, 16:31
While trying to build VapourSynth with MSVC 2015 (I like to play around with these open source projects to learn things), I get a bit of errors when zimg is being compiled and also a fair amount of other warnings/errors. I don't recall seeing these before. Did something change so that building with MSVC is not as straightforward as it used to be?
http://pastebin.com/8map1cJQ
You have update 3 installed too, right?
Boulder
24th August 2016, 16:39
For some reason I thought Windows Update would have handled it but apparently not..at least the installer didn't complain. I'll install it and see what happens.
EDIT: works fine after installing update 3. What is Microsoft Update good for if it doesn't update Microsoft products automatically?:angry:
jackoneill
26th August 2016, 09:06
What is wrong with VapourSynth's plugin autoloading? I've seen several people using walls of LoadPlugin. What is the point?
mikewando
26th August 2016, 09:54
genericfilters is no longer included with the installer and has been deprecated for a long time, if you for some reason miss canny simply use the tcanny plugin instead for a better implementation
So I literally wrote a script with generic.GBlur(sigma=2.83) yesterday. My impression is that I should be able to replace it with some std.Convolution(matrix=[...])? To be honest I'm having a hard time replicating the output... I just can't seem to get a strong blur out of std.Convolution() no matter what kernel I try. Could someone who understands the math help me out or at least point me in the right direction? Or if someone just has a good way to get a (really) strong blur other than calling generic.GBlur(sigma=2.83) 50 times (literally) I'd be interested.
Alternatively, if someone has an elegant way to generate a gradient that would be helpful. A simple GRAY8 white to black horizontal gradient is really all I'm trying to get (for a mask in a screen wipe). At this point I probably could've just made a bitmap in gimp, but I also feel like I should be able to do it programatically.
jackoneill
26th August 2016, 10:14
So I literally wrote a script with generic.GBlur(sigma=2.83) yesterday. My impression is that I should be able to replace it with some std.Convolution(matrix=[...])? To be honest I'm having a hard time replicating the output... I just can't seem to get a strong blur out of std.Convolution() no matter what kernel I try. Could someone who understands the math help me out or at least point me in the right direction? Or if someone just has a good way to get a (really) strong blur other than calling generic.GBlur(sigma=2.83) 50 times (literally) I'd be interested.
Alternatively, if someone has an elegant way to generate a gradient that would be helpful. A simple GRAY8 white to black horizontal gradient is really all I'm trying to get (for a mask in a screen wipe). At this point I probably could've just made a bitmap in gimp, but I also feel like I should be able to do it programatically.
stripes = []
for i in range(256):
stripes += core.std.BlankClip(format=vs.GRAY8, color=i, width=1)
gradient = core.std.StackHorizontal(stripes)
AzraelNewtype
26th August 2016, 10:19
Not making any guarantees, but try using TCanny with mode=-1 for your gaussian blur needs. Actually, it's possible the gradient map mode can be hit with a hammer to serve your purposes too.
Also what jackoneill said, to avoid the problem entirely.
Myrsloik
26th August 2016, 10:21
So I literally wrote a script with generic.GBlur(sigma=2.83) yesterday....
The reason you don't get the same blur is because GBlur with those settings has radius 8. I bet the convolutions you tried had a much smaller radius. And what jackoneill said.
DarkSpace
26th August 2016, 13:35
or it could be something like this, even, which avoids the list.append stuff entirely:
stripes = [core.std.BlankClip(format=vs.GRAY8, color=i, width=1) for i in range(256)]
Selur
26th August 2016, 17:43
What is wrong with VapourSynth's plugin autoloading? I've seen several people using walls of LoadPlugin. What is the point?
Personally I don't like autoloading since:
a. I usually prefer a portable version
b. I generate my scripts and it's easier to debug if you know what is loaded and what isn't.
Myrsloik
26th August 2016, 17:49
Spoiler: the portable version has autoloading too
Selur
26th August 2016, 17:51
yes, but only if only use it for the filters that come with Vapoursynth, the others are in separate sub-folders. ;)
hydra3333
27th August 2016, 01:41
What is wrong with VapourSynth's plugin autoloading? I've seen several people using walls of LoadPlugin. What is the point?I would be one. Personal preference and habit; like an explicit typing standard in the old days, it is in your face.
trip_let
27th August 2016, 22:32
Quick question: in R33, (old) planestats MinMax got split into separate Min and Max, but how?
The (old) planestats MinMax[0] is now what, Min? And (old) MinMax[1] would be Max? Or what?
Thanks.
Myrsloik
27th August 2016, 23:09
Quick question: in R33, (old) planestats MinMax got split into separate Min and Max, but how?
The (old) planestats MinMax[0] is now what, Min? And (old) MinMax[1] would be Max? Or what?
Thanks.
Yes
Filler
mikewando
9th September 2016, 02:47
gradient = core.std.StackHorizontal(stripes)
Ahh stacking, yes that seems so obvious now.
As a side note, the bilateral plugin also contains a gaussian filter with different implementation (https://github.com/HomeOfVapourSynthEvolution/VapourSynth-Bilateral#gaussian). That filter is faster for very large sigma, as it's speed is independent of the radius.
Thanks for the note, this also helped me out with a completely different instance in which I actually just wanted a strong blur.
Selur
10th September 2016, 12:05
using R33.1 64bit portable and:
# Imports
import sys
import os
import vapoursynth as vs
core = vs.get_core()
# Import Scripts Folder
scriptPath = 'G:/Hybrid/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Import havsfunc
import havsfunc as havsfunc
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/SourceFilter/LSmashSource/vslsmashsource.dll")
# Loading F:\TestClips&Co\test.avi using LWLibavSource
clip = core.lsmas.LWLibavSource(source="F:/TestClips&Co/test.avi", cache=0)
# adding 'G:\workspace\Hybrid\resources\background.png' using Overlay
logo = core.imwri.Read(filename="G:/workspace/Hybrid/resources/background.png")
clip = havsfunc.Overlay(clipa=clip, clipb=logo)
# Output
clip.set_output()
I get:
Failed to evaluate the script:
Python exception: No attribute with the name imwri exists. Did you mistype a plugin namespace?
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1491, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:26905)
File "H:\Temp\tempPreviewVapoursynthFile12_54_07_495.vpy", line 16, in <module>
logo = core.imwri.Read(filename="G:/workspace/Hybrid/resources/background.png")
File "src\cython\vapoursynth.pyx", line 1105, in vapoursynth.Core.__getattr__ (src\cython\vapoursynth.c:20799)
AttributeError: No attribute with the name imwri exists. Did you mistype a plugin namespace?
Is there something wrong with the documentation at http://www.vapoursynth.com/doc/plugins/imwri.html or am I missing something?
Cu Selur
Ps.: also tried 'imwrif' as name, but that also isn't right, also there doesn't seem to be a specific .dll for the reader inside the coreplugins-folder, should there be?
captaiŋadamo
10th September 2016, 17:36
com.vapoursynth.imwrif is the namespace according to the source code.
Selur
10th September 2016, 17:46
So instead of 'core.imwri.Read' I should use 'com.vapoursynth.imwrif.Read' or should it be 'vs.imwrif.Read' (since I imported vapoursynth as vs), or something totally different ?
sneaker_ger
10th September 2016, 17:55
Unless something has changed it is not included in the official Windows packages.
http://forum.doom9.org/showthread.php?p=1731196#post1731196
Selur
10th September 2016, 18:13
Okay thanks, that post and the follwing explain that.
It's listed as included in the docs:
http://www.vapoursynth.com/doc/includedplugins.html
....
That should be read as "included in the source tree"
WTF? Found a download at http://forum.doom9.org/showthread.php?p=1769737#post1769737
Out of curiosity: Why isn't it included in the release packages/installer? License issues?
sneaker_ger
10th September 2016, 18:15
Read again.
captaiŋadamo
10th September 2016, 18:17
Selur, the linked post says it's not included due to its size.
Myrsloik
10th September 2016, 18:18
Okay thanks, that post and the follwing explain that.
WTF? Found a download at http://forum.doom9.org/showthread.php?p=1769737#post1769737
Out of curiosity: Why isn't it included in the release packages/installer? License issues?
It's also not included because it has serious issues and debugging or even compiling a working version is near impossible.
Selur
10th September 2016, 18:18
Sorry, overlooked that.
@myrsloik: than don't put it under 'included plugins', that is way confusing, also see documentation seems to be of since it states 'imwri' and not 'imwrif'.
Selur
10th September 2016, 19:10
# Imports
import sys
import os
import vapoursynth as vs
core = vs.get_core()
# Import Scripts Folder
scriptPath = 'G:/Hybrid/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Import havsfunc
import havsfunc as havsfunc
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/SourceFilter/Imagemagick/libimwri.dll")
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/SourceFilter/LSmashSource/vslsmashsource.dll")
# Loading F:\TestClips&Co\test.avi using LWLibavSource
clip = core.lsmas.LWLibavSource(source="F:/TestClips&Co/test.avi", cache=0)
# adding 'F:\TestClips&Co\background.png' using Overlay
logo = core.imwrif.Read(filename="F:/TestClips&Co/background.png")
logo = core.resize.Bicubic(clip=logo, format=vs.YUV420P8, matrix_s="709")
clip = havsfunc.Overlay(clipa=clip, clipb=logo)
# Output
clip.set_output()
seems to do the job now, only problem is that this way, the alpha channel of the logo isn't transparent. :(
In case this is even possible with Vapoursynth atm.: before I send another few hours trying to figure stuff out, does anyone know how to add a logo with a transparent background onto a video and could post a sample?
My guess atm. is that I probably need to use 'alpha=True' with imwrif, when get a logo and an alpha gray scale and somehow apply those to the video.
Myrsloik
10th September 2016, 19:31
# Imports
import sys
import os
import vapoursynth as vs
core = vs.get_core()
# Import Scripts Folder
scriptPath = 'G:/Hybrid/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Import havsfunc
import havsfunc as havsfunc
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/SourceFilter/Imagemagick/libimwri.dll")
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/SourceFilter/LSmashSource/vslsmashsource.dll")
# Loading F:\TestClips&Co\test.avi using LWLibavSource
clip = core.lsmas.LWLibavSource(source="F:/TestClips&Co/test.avi", cache=0)
# adding 'F:\TestClips&Co\background.png' using Overlay
logo = core.imwrif.Read(filename="F:/TestClips&Co/background.png")
logo = core.resize.Bicubic(clip=logo, format=vs.YUV420P8, matrix_s="709")
clip = havsfunc.Overlay(clipa=clip, clipb=logo)
# Output
clip.set_output()
seems to do the job now, only problem is that this way, the alpha channel of the logo isn't transparent. :(
In case this is even possible with Vapoursynth atm.: before I send another few hours trying to figure stuff out, does anyone know how to add a logo with a transparent background onto a video and could post a sample?
My guess atm. is that I probably need to use 'alpha=True' with imwrif, when get a logo and an alpha gray scale and somehow apply those to the video.
Yes, alpha=true and then use maskedmerge assuming you're applying it to something with the same format.
Selur
10th September 2016, 19:41
Would be nice if you or someone else could post a simple example.
I got a YUV420P8 clip (640x352) and a png (100x84 8bit) and maskedmerge requires clips with the same dimension.
trip_let
10th September 2016, 22:54
Would be nice if you or someone else could post a simple example.
I got a YUV420P8 clip (640x352) and a png (100x84 8bit) and maskedmerge requires clips with the same dimension.
Pad or resize the image to 640x352. There's AddBorders (http://www.vapoursynth.com/doc/functions/addborders.html) and the usual resizers. Or maybe I misunderstand the intent.
Selur
10th September 2016, 22:58
@trip_let: simply add ?black? borders to both the logo and the alpha channel? does that make sense?
trip_let
11th September 2016, 00:31
@trip_let: simply add ?black? borders to both the logo and the alpha channel? does that make sense?
Erm, not sure how Overlay works. Never used it.
You may want to use the mask parameter, specifying that you're allowing a change in the part where you're putting the logo (area where the mask is white), and not allowing a change elsewhere (area where the mask is black).
# black clip the size of logo
mask = core.std.BlankClip(logo)
# now change to white
mask = core.std.Invert(mask)
# add black borders to right and bottom of the area (apply logo to upper-left)
mask = core.std.AddBorders(mask, right=clip.width-logo.width, bottom=clip.height-logo.height)
warning: didn't test; am not a regular user of these functions and not that familiar with VS
Or I guess if you max out the alpha in the logo for the garbage/padding, it would be 100% transparent and not change the picture there. That's probably easier, actually.
Selur
11th September 2016, 06:49
@HolyWu: as I understood it alphy=True returns two clips, don't I need to take both?
[logo, alpha] = core.imwrif.Read(filename="F:/TestClips&Co/background.png", alpha=True)
-> okay forget that just understood the [0] and [1] part
tried:
# Imports
import sys
import os
import vapoursynth as vs
core = vs.get_core()
# Import Scripts Folder
scriptPath = 'G:/Hybrid/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Import havsfunc
import havsfunc as havsfunc
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/SourceFilter/Imagemagick/libimwri.dll")
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/SourceFilter/LSmashSource/vslsmashsource.dll")
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/Support/fmtconv.dll")
# Loading F:\TestClips&Co\test.avi using LWLibavSource
clip = core.lsmas.LWLibavSource(source="F:/TestClips&Co/test.avi", cache=0)
# adding 'F:\TestClips&Co\background.png' using Overlay
[logo, alpha] = core.imwrif.Read(filename="F:/TestClips&Co/background.png", alpha=True)
logo = core.resize.Bicubic(clip=logo, format=clip.format.id, matrix_s="709")
alpha = core.fmtc.bitdepth(clip=alpha, bits=clip.format.bits_per_sample)
clip=havsfunc.Overlay(clipa=clip, clipb=logo, mask=alpha)
# Output
clip.set_output()
but that still ignored the alpha (background all black)
https://s15.postimg.org/uc46pwdiv/test_vpy_0.png (https://postimg.org/image/uc46pwdiv/)
Selur
11th September 2016, 08:34
]Here's the png I used. :D
Cu Selur
Selur
11th September 2016, 10:19
Thanks! That works!
Positioning and only showing the logo for a short time works fine too:
# Imports
import sys
import os
import vapoursynth as vs
core = vs.get_core()
# Import Scripts Folder
scriptPath = 'G:/Hybrid/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Import havsfunc
import havsfunc as havsfunc
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/SourceFilter/Imagemagick/libimwri.dll")
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/Support/fmtconv.dll")
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/SourceFilter/LSmashSource/vslsmashsource.dll")
# Loading F:\TestClips&Co\test.avi using LWLibavSource
clip = core.lsmas.LWLibavSource(source="F:/TestClips&Co/test.avi", cache=0)
# adding 'F:\TestClips&Co\background.png' using Overlay
[logo, alpha] = core.imwrif.Read(filename="F:/TestClips&Co/background.png", alpha=True)
logo = core.resize.Bicubic(clip=logo, format=clip.format.id, matrix_s="709")
alpha = core.fmtc.bitdepth(clip=alpha, bits=clip.format.bits_per_sample, fulld=True).std.Invert()
beforeLogo = core.std.Trim(clip,last=49)
selection = core.std.Trim(clip,first=50,last=100)
afterLogo = core.std.Trim(clip,first=101)
selection = havsfunc.Overlay(clipa=selection, clipb=logo, mask=alpha, x=20, y=40)
clip = beforeLogo + selection + afterLogo
# Output
clip.set_output()
-> Next question: How to fade the logo in and out over x frames?
Cu Selur
splinter98
12th September 2016, 20:42
-> Next question: How to fade the logo in and out over x frames?
Try my crossfade function from: http://forum.doom9.org/showthread.php?p=1755234#post1755234
Selur
12th September 2016, 20:44
Will do :) Thanks!
aculnaig
13th September 2016, 11:37
Can't build vapoursynth ( gcc (GCC) 6.2.1 20160830 )
VapourSynth ( latest git )
git describe --tags
R33.1-18-gf65402b
zimg ( latest git )
git describe --tags
release-2.2.1-13-g1855661
Errors
src/core/vsresize.cpp:33:2: error: #error zAPI v2 or greater required
#error zAPI v2 or greater required
^~~~~
src/core/vsresize.cpp:121:23: error: ‘ZIMG_TRANSFER_ST2084’ was not declared in this scope
{ "st2084", ZIMG_TRANSFER_ST2084 },
^~~~~~~~~~~~~~~~~~~~
src/core/vsresize.cpp:122:23: error: ‘ZIMG_TRANSFER_ARIB_B67’ was not declared in this scope
{ "std-b67", ZIMG_TRANSFER_ARIB_B67 },
^~~~~~~~~~~~~~~~~~~~~~
src/core/vsresize.cpp:123:5: error: no matching function for call to ‘std::unordered_map<std::__cxx11::basic_string<char>, zimg_transfer_characteristics_e>::unordered_map(<brace-enclosed initializer list>)’
};
src/core/vsresize.cpp:760:26: error: ‘struct vszimgxx::zfilter_graph_builder_params’ has no member named ‘nominal_peak_luminance’
m_params.nominal_peak_luminance = propGetScalarDef<double>(in, "nominal_luminance", NAN, vsapi);
Myrsloik
13th September 2016, 11:38
You need to use the hdr branch of zimg to build it.
aculnaig
13th September 2016, 12:26
Thanks, It worked.
Sm3n
13th September 2016, 13:15
Hello,
can you tell me if my guesses are true. Can I compile zimg on debian?
if yes why can't I compile it? Not sure I actualy can.
System: Debian wheezy x64
Here is my error code: http://paste2.org/tgXKhezc
cheers in advance
Myrsloik
13th September 2016, 13:49
Hello,
can you tell me if my guesses are true. Can I compile zimg on debian?
if yes why can't I compile it? Not sure I actualy can.
System: Debian wheezy x64
Here is my error code: http://paste2.org/tgXKhezc
cheers in advance
You compiler is too old.
Sm3n
14th September 2016, 22:03
OK. And do you think I can upgrade it? I'm not very confortable with debian - that's why I ask but I can manage it eventualy.
I'm trying to look for it right now...
Are_
14th September 2016, 23:06
OK. And do you think I can upgrade it? I'm not very confortable with debian - that's why I ask but I can manage it eventualy.
I'm trying to look for it right now...
https://linuxconfig.org/how-to-upgrade-debian-linux-system-from-wheezy-to-jessie-stable-release
Sm3n
15th September 2016, 10:13
https://linuxconfig.org/how-to-upgrade-debian-linux-system-from-wheezy-to-jessie-stable-release
Thx a lot. :)
Selur
17th September 2016, 20:20
I'm trying to get Vapoursynth working on mac, using:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="/Users/selur/build-Hybrid-Desktop-Release/Hybrid.app/Contents/MacOS/vsfilters/SourceFilter/FFMS2/ffms2.dylib")
# Loading /Users/selur/Desktop/公演后感言.mp4 using FFMS2
clip = core.ffms2.Source(source="/Users/selur/Desktop/公演后感言.mp4",cachefile="/Users/selur/Desktop/temp/mp4_d59244d4d4de113a5823257ae88125fc_16807.ffindex")
# Output
clip.set_output()
I get:
Failed to evaluate the script:
Python exception: Failed to load /Users/selur/build-Hybrid-Desktop-Release/Hybrid.app/Contents/MacOS/vsfilters/SourceFilter/FFMS2/ffms2.dylib. Error given: dlopen(/Users/selur/build-Hybrid-Desktop-Release/Hybrid.app/Contents/MacOS/vsfilters/SourceFilter/FFMS2/ffms2.dylib, 1): image not found
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1491, in vapoursynth.vpy_evaluateScript (src/cython/vapoursynth.c:26897)
File "/Users/selur/Desktop/temp/tempPreviewVapoursynthFile21_04_39_802.vpy", line 5, in <module>
core.std.LoadPlugin(path="/Users/selur/build-Hybrid-Desktop-Release/Hybrid.app/Contents/MacOS/vsfilters/SourceFilter/FFMS2/ffms2.dylib")
File "src/cython/vapoursynth.pyx", line 1383, in vapoursynth.Function.__call__ (src/cython/vapoursynth.c:25204)
vapoursynth.Error: Failed to load /Users/selur/build-Hybrid-Desktop-Release/Hybrid.app/Contents/MacOS/vsfilters/SourceFilter/FFMS2/ffms2.dylib. Error given: dlopen(/Users/selur/build-Hybrid-Desktop-Release/Hybrid.app/Contents/MacOS/vsfilters/SourceFilter/FFMS2/ffms2.dylib, 1): image not found
Do I need to load the filter in another way ?
(I'm on mac osx, vapoursynth was installed using homebrew, ffms2 was separately compiled and copied to '/Users/selur/build-Hybrid-Desktop-Release/Hybrid.app/Contents/MacOS/vsfilters/SourceFilter/FFMS2/ffms2.dylib' )
kolak
17th September 2016, 20:55
Use L-SMASH Source- I found it more reliable than ffms2, which is far from being perfect.
Selur
17th September 2016, 20:59
haven't figured out to compile l-smash on mac and I'm not sure if I the loading script is correct,...
jackoneill
17th September 2016, 21:49
Do I need to load the filter in another way ?
(I'm on mac osx, vapoursynth was installed using homebrew, ffms2 was separately compiled and copied to '/Users/selur/build-Hybrid-Desktop-Release/Hybrid.app/Contents/MacOS/vsfilters/SourceFilter/FFMS2/ffms2.dylib' )
Are you sure you have the right file name? Are you sure that file is a library?
kolak
17th September 2016, 22:48
haven't figured out to compile l-smash on mac and I'm not sure if I the loading script is correct,...
Vapoursynth OSX installer has it. You can find post about it in vs section.
Selur
18th September 2016, 05:28
Are you sure you have the right file name? Are you sure that file is a library?
Ahhh it was a typo. :) Now I get a 'Video codec not found', but that is probably due to some mistake during the ffms2 compilation. (forgot the ffmpeg libs) Thanks totally didn't see the typo yesterday.
Vapoursynth OSX installer has it. You can find post about it in vs section.
Problem with that is that it interferes with the vapoursynth version I installed through homebrew to be able to compile my own vsedit version (contains some limited ipc capabilities).
+ There doesn't seem to be a way to uninstall it and it's r33 not r33.1
Myrsloik
24th September 2016, 12:57
I have too much other stuff to do and I think some of you could help me on the Python side.
Task 1:
If you do something like clip1 + clip2 + clip3 + clip4... this expands to Splice([Splice([Splice([clip1, clip2]), clip3]), clip4])...
It works but becomes a bit inefficient when hundreds of clips are involved and combining it into a single Splice[clip1, clip2, clip3, ...] would be better. Something like a delayed evaluation object for splice operations could be nice to have. Something similar for trim could also be useful. I guess.
The relevant code to modify can be found here (https://github.com/vapoursynth/vapoursynth/blob/master/src/cython/vapoursynth.pyx#L932). Needs cython to compile but works just like normal python.
Task 2:
I want to flatten things so you don't need to keep a core object around anymore like this:
import vapoursynth as vs
vs.std.BlankClip()
So basically also check the object returned from get_core() for all the attributes not found directly in the vapoursynth module. Cython unfortunately doesn't seem to like the usual Python tricks so I'm a bit stuck there too. Too bad __getattr__ doesn't exist on the module level.
Sm3n
26th September 2016, 12:15
Hi,
What would be the best, fastest and effective way to do a SelectRangeEvery like Avisynth does?
I read this https://forum.doom9.org/showthread.php?t=172277&highlight=selectrangeevery but the only thing I can do is a simple SelectEvery.
Should I trim some part of the clip then merge them together or is there an easiest way with the function above?
Myrsloik
26th September 2016, 13:07
Hi,
What would be the best, fastest and effective way to do a SelectRangeEvery like Avisynth does?
I read this https://forum.doom9.org/showthread.php?t=172277&highlight=selectrangeevery but the only thing I can do is a simple SelectEvery.
Should I trim some part of the clip then merge them together or is there an easiest way with the function above?
Why is my previously proposed solution not simple enough?
clip = core.std.SelectEvery(clip = clip, cycle = x, offsets = range(14))
This is functionally identical to SelectRangeEvery. If you want to change the initial offset just trim the input clip. Done!
Sm3n
26th September 2016, 14:11
My bad. The values for x and range was way to low. ^^'
It's definitely easy.
Is it possible to tweak QTGMC like in avisynth using mode to get the max speed or vapoursynth does it by itself automaticaly with vs.get_core?
The x264 process is slower with a vpy script than an avs script. It's a simple script:
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core(threads=8)
core.avs.LoadPlugin(r'C:\Program Files (x86)\AviSynth+\plugins64\DGDecodeNV.dll')
video = core.avs.DGSource(r'H:\Videos1.dgi')+core.avs.DGSource(r'H:\Videos2.dgi')+core.avs.DGSource(r'H:\Videos3.dgi')+core.avs.DGSource(r'H:\Videos4.dgi')
video = haf.QTGMC(video, Preset='Medium', TFF=True, FPSDivisor=2).fmtc.resample(kernel="spline36", w=1280, h=720).fmtc.bitdepth(bits=8)
video.set_output()
I think I read that Spline36 resize method is much slower than a simple one. I'm also using it with avisynth. Is it slower than avs's and that would explain the difference of speed?
Myrsloik
26th September 2016, 14:46
My bad. The values for x and range was way to low. ^^'
It's definitely easy.
Is it possible to tweak QTGMC like in avisynth using mode to get the max speed or vapoursynth does it by itself automaticaly with vs.get_core?
The x264 process is slower with a vpy script than an avs script. It's a simple script:
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core(threads=8)
core.avs.LoadPlugin(r'C:\Program Files (x86)\AviSynth+\plugins64\DGDecodeNV.dll')
video = core.avs.DGSource(r'H:\Videos1.dgi')+core.avs.DGSource(r'H:\Videos2.dgi')+core.avs.DGSource(r'H:\Videos3.dgi')+core.avs.DGSource(r'H:\Videos4.dgi')
video = haf.QTGMC(video, Preset='Medium', TFF=True, FPSDivisor=2).fmtc.resample(kernel="spline36", w=1280, h=720).fmtc.bitdepth(bits=8)
video.set_output()
I think I read that Spline36 resize method is much slower than a simple one. I'm also using it with avisynth. Is it slower than avs's and that would explain the difference of speed?
What mode? I don't know what you mean.
Bonus points for not saying how much slower it is so I can speculate why. Different code, different speed. I don't have much to add there.
Try another resizer and find out? Looks easy enough to do...
Sm3n
26th September 2016, 15:03
Avisynth can use MTMode so we can make QTGMC process much faster. Sure you already knew. ^^
Can we do that in vapoursynth? For exemple in avisynth QTGMC has this option: EdiThreads=3. Vapoursynth hasn't.
My speed tests:
Avs (QTGMC=medium, spline36) + x264 (veryslow) = 5min to achieve 5.30fps
Vpy (QTGMC=medium, spline36) + x264 (veryslow) = 5min to achieve 4fps
Very significant. I assume CPU doesn't assing the same % to the pipe process.
Sure I can try all I know but I rather ask for all I don't. Maybe there is some options I don't know yet or what.
Myrsloik
26th September 2016, 15:07
Avisynth can use MTMode so we can make QTGMC process much faster. Sure you already knew. ^^
Can we do that in vapoursynth? For exemple in avisynth QTGMC has this option: EdiThreads=3. Vapoursynth hasn't.
My speed tests:
Avs (QTGMC=medium, spline36) + x264 (veryslow) = 5min to achieve 5.30fps
Vpy (QTGMC=medium, spline36) + x264 (veryslow) = 5min to achieve 4fps
Very significant. I assume CPU doesn't assing the same % to the pipe process.
Sure I can try all I know but I rather ask for all I don't. Maybe there is some options I don't know yet or what.
The mtmode stuff only exists in avisynth because there threading is one big hack. Or at least used to be.
What's the cpu usage like? is it 100% for both or less for VS?
Sm3n
26th September 2016, 15:42
The mtmode stuff only exists in avisynth because there threading is one big hack. Or at least used to be.
What's the cpu usage like? is it 100% for both or less for VS?
Yup, 100% both.
I ran a new test. Vpy = 4.90fps
Now sure for some, difference could be nothing but during an encode taking hours, at the end it might have time wasted.
Thx for your help.
Myrsloik
26th September 2016, 15:44
Yup, 100% both.
I ran a new test. Vpy = 4.90fps
Now sure for some, difference could be nothing but during an encode taking hours, at the end it might have time wasted.
If the difference is that big between runs you really need a better way to measure things. Seriously. With that kind of variation you can't even say that one is faster than the other.
Sm3n
26th September 2016, 20:01
If the difference is that big between runs you really need a better way to measure things. Seriously. With that kind of variation you can't even say that one is faster than the other.
I'm doing lot of comparison. Have you a good method to measure things to me? Using Avsmeter, encoding 2h show at least once a week et cetera. My knowledge is limited but for that purpose I think I know how my system runs and I'm able to say this is more fastest than that or not. I ran lot of encode I think I understand what is the limit of the speed on case by case.
In fact, next project I have to do I'll be using a vpy script. Usualy an encode takes a bit less than 8h. It will be easy to see the difference I'm sure.
If my cpu can handle X fps in x min using avs vs Y fps in x min using vpy where Y is slowest, I'm pretty sure that avs+x264 process will finish sooner than vpy+x264. Maybe I'm wrong but it makes sense to me.
TheFluff
26th September 2016, 22:55
https://zedshaw.com/archive/programmers-need-to-learn-statistics-or-i-will-kill-them-all/
see especially the part about confounding
Myrsloik
29th September 2016, 23:18
R34 RC1 YO! Check it out! Basically it fixes the horrible buggy untested mess that R33 was. Should be a safe to use. Just note that the abomination that is temporalsoften no longer is an included plugin.
Installer (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R34-RC1.exe)
Portable 64bit (https://dl.dropboxusercontent.com/u/73468194/VapourSynth64-Portable-R34-RC1.7z)
Portable 32bit (https://dl.dropboxusercontent.com/u/73468194/VapourSynth32-Portable-R34-RC1.7z)
Changes:
r34:
it's now possible to skip installing the visual studio runtimes in the installer to reduce online dependency of installer (installation may not work until manually installed, obviously)
temporalsoften plugin is no longer included in the windows installer, it has been replaced by the misc plugin containing various functions useful for avisynth compatibility
the default max memory usage is now 4GB on 64bit systems
fixed several unpacking issues in avisource introduced in the previous version
added warning if there are any nodes or frames still in use when the core is free
improved avfs prefetch logic for vpy
added premultiplied blending mode to maskedmerge
added premultiply filter to premultiply a clip with alpha
makediff and adddiff no longer pointlessly clamp float to a limited range since there's no good reason to do so
fixed memory leak when the core is freed introduced in the previous version
fixed memory leak in avfs introduced in the previous version
removed rshift and replaced it with a scale argument in sobel and prewitt
fixed sobel and prewitt wrongly passing through the input pixel values
added support for hdr formats and dci-p3 in zimg
optimized planestats
added float support to pemverifier
fixes active region offset and height for interlaced resizing
added support for more different subsampled input formats for vfm (jackoneill)
~ VEGETA ~
30th September 2016, 05:06
I am using R33-1 and it is working fine. I use the x64 portable version with python352 and the editor all in one folder as recommended. Now, for updating to newer versions, should I just copy and replace VS files (excluding plugins folder)?
Myrsloik
30th September 2016, 08:37
I am using R33-1 and it is working fine. I use the x64 portable version with python352 and the editor all in one folder as recommended. Now, for updating to newer versions, should I just copy and replace VS files (excluding plugins folder)?
Including the plugins dir. Overwriting an existing version is fine.
dipje
30th September 2016, 10:44
The HDR stuff seems to work nicely. Able to convert some clips to something that is quite OK to look at on regular screens. I do a little gamma tweak (like 1.2 or 1.3) to lift the shadows a bit at the end with a nominal luminance somewhere between 400 and 600 and so far so good.
That being said, can someone help me to get something like highlight compression or shadow boosting without altering the entire gamma?
A bit like Photo-correcting software does.
Is something possible? with Expr or something? Or make / define a curve myself with float values that map values close-to 1.0 and over 1.0 to a sane value within the 0.0 - 1.0 range?
And / or, is it possible to load and apply 3d Cube lut files?
Myrsloik
30th September 2016, 10:50
The HDR stuff seems to work nicely. Able to convert some clips to something that is quite OK to look at on regular screens. I do a little gamma tweak (like 1.2 or 1.3) to lift the shadows a bit at the end with a nominal luminance somewhere between 400 and 600 and so far so good.
That being said, can someone help me to get something like highlight compression or shadow boosting without altering the entire gamma?
A bit like Photo-correcting software does.
Is something possible? with Expr or something? Or make / define a curve myself with float values that map values close-to 1.0 and over 1.0 to a sane value within the 0.0 - 1.0 range?
And / or, is it possible to load and apply 3d Cube lut files?
1. Loading cube luts (http://wwwimages.adobe.com/content/dam/Adobe/en/products/speedgrade/cc/pdfs/cube-lut-specification-1.0.pdf) is eternally on my todo list but don't wait for it
2. If you only want 1d adjustment you can definitely do that with expr if you don't mind creating your own expression
3. I have no idea what algorithm photo correction software uses (and I can't google my way to it since you didn't list software+mode) but I suspect it's closer to local constrast enhancement than a 1d lut adjustment
~ VEGETA ~
30th September 2016, 15:02
Including the plugins dir. Overwriting an existing version is fine.
Well, I have done some effort collecting plugins into that folder, and I have another folder called "scripts" beside it.
The plugins folder comes empty anyway. If you mean the core plugins then fine, I can replace it.
Myrsloik
30th September 2016, 15:05
Well, I have done some effort collecting plugins into that folder, and I have another folder called "scripts" beside it.
The plugins folder comes empty anyway. If you mean the core plugins then fine, I can replace it.
Yes, that's what I meant.
VS_Fan
1st October 2016, 05:14
That being said, can someone help me to get something like highlight compression or shadow boosting without altering the entire gamma?
A bit like Photo-correcting software does.
Some time ago I got amazing results in AVIsynth with the "HDR AGC plugin (http://forum.doom9.org/showthread.php?t=93571)".
Also, have you tried "Retinex" (http://forum.doom9.org/showthread.php?t=171307) plugin for VapourSynth?
Myrsloik
11th October 2016, 12:34
Changes from RC1:
Pismo PFM runtime included in the installer to make AVFS usage easier
AVFS supports avs+ high bitdepth output
Super minor fixes nobody will ever notice
R34 RC2 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R34-RC2.exe)
Portable 64bit (https://dl.dropboxusercontent.com/u/73468194/VapourSynth64-Portable-R34-RC2.7z)
Portable 32bit (https://dl.dropboxusercontent.com/u/73468194/VapourSynth32-Portable-R34-RC2.7z)
Myrsloik
15th October 2016, 11:37
R34 released. Post about stuff (http://www.vapoursynth.com/2016/10/r34-being-nice-to-avisynth/). Finally got everything tested. Use the donation button so you can say you've contributed to real donationware!
Changes:
r34:
avfs can now output the same high bitdepth formats for avisynth+ as for vapoursynth
it's now possible to skip installing the visual studio runtimes in the installer to reduce online dependency of installer (installation may not work until manually installed, obviously)
temporalsoften plugin is no longer included in the windows installer, it has been replaced by the misc plugin containing various functions useful for avisynth compatibility
the default max memory usage is now 4GB on 64bit systems
fixed several unpacking issues in avisource introduced in the previous version
added warning if there are any nodes or frames still in use when the core is freed
improved avfs prefetch logic for vpy
added premultiplied blending mode to maskedmerge
added premultiply filter to premultiply a clip with alpha
makediff and adddiff no longer pointlessly clamp float to a limited range since there's no good reason to do so
fixed memory leak when the core is freed introduced in the previous version
fixed memory leak in avfs introduced in the previous version
removed rshift and replaced it with a scale argument in sobel and prewitt
fixed sobel and prewitt wrongly passing through the input pixel values
added support for hdr formats and dci-p3 in zimg
optimized planestats
added float support to pemverifier
fixes active region offset and height for interlaced resizing
added support for more different subsampled input formats for vfm (jackoneill)
bin.n2f
17th October 2016, 16:00
:thanks: Myrsloick
========
GenericFilters is no longer included because the core functions plus the TCanny plugin can now replace 99% of its uses
========
i want to use GBlur,2.83 in R34
what is alternative for that at same strength?
& thanks again
Myrsloik
17th October 2016, 16:10
:thanks: Myrsloick
========
GenericFilters is no longer included because the core functions plus the TCanny plugin can now replace 99% of its uses
========
i want to use GBlur,2.83 in R34
what is alternative for that at same strength?
& thanks again
It should be about the same I guess? I haven't really compared the details and it's a better question for the TCanny author. Or just experiment until it looks the same. That's rarely wrong.
lansing
19th October 2016, 02:11
how do you unmount the script in the new version?
EDIT: ok I figured that the file unmount itself when I close the cmd window.
other problems I have, there're no check on the files that you're going to mount, I can type in whatever filename at the end of the cmd and the program will still sees it as a file and mounted it.
And I have a video file that gives me garble images after mount, which it has not happen before.
Myrsloik
19th October 2016, 08:48
how do you unmount the script in the new version?
EDIT: ok I figured that the file unmount itself when I close the cmd window.
other problems I have, there're no check on the files that you're going to mount, I can type in whatever filename at the end of the cmd and the program will still sees it as a file and mounted it.
And I have a video file that gives me garble images after mount, which it has not happen before.
What's the output format of the images and what do you try to open them with?
lansing
19th October 2016, 14:41
What's the output format of the images and what do you try to open them with?
The output format YV12 in avi container. The script previewed normal in the vapoursynth editor, but when I open it with Adobe Premiere or Virutaldub after mount, they all give me garble images. I tried mounting different video files with the same script and they were all fine.
Myrsloik
19th October 2016, 14:42
The output format YV12 in avi container. The script previewed normal in the vapoursynth editor, but when I open it with Adobe Premiere or Virutaldub after mount, they all give me garble images. I tried mounting different video files with the same script and they were all fine.
Can you cut a sample that reproduces it or take a screenshot of the garbled output?
littlepox
19th October 2016, 14:49
:thanks: Myrsloick
========
GenericFilters is no longer included because the core functions plus the TCanny plugin can now replace 99% of its uses
========
i want to use GBlur,2.83 in R34
what is alternative for that at same strength?
& thanks again
Simply use:
res = core.tcanny.TCanny(src,sigma=2.83,mode=-1)
lansing
19th October 2016, 15:21
Can you cut a sample that reproduces it or take a screenshot of the garbled output?
Okay after more testings, I found out that the problem came from the cropRel function in my script
clip = core.std.CropRel(clip, left=12, top=0, right=10, bottom=10)
clip = core.std.CropRel(clip, left=12, top=0, right=12, bottom=12)
The top one gives my garbage image after mount, the bottom one works fine
littlepox
19th October 2016, 16:44
Okay after more testings, I found out that the problem came from the cropRel function in my script
clip = core.std.CropRel(clip, left=12, top=0, right=10, bottom=10)
clip = core.std.CropRel(clip, left=12, top=0, right=12, bottom=12)
The top one gives my garbage image after mount, the bottom one works fine
Is it because of mod4/mod8/mod16 issue?
I believe for the top one you get a video with width or height not divisible by 4, which may be problematic in certain cases.
Myrsloik
19th October 2016, 22:38
Okay after more testings, I found out that the problem came from the cropRel function in my script
clip = core.std.CropRel(clip, left=12, top=0, right=10, bottom=10)
clip = core.std.CropRel(clip, left=12, top=0, right=12, bottom=12)
The top one gives my garbage image after mount, the bottom one works fine
That is kinda odd. I can reproduce it but I have no idea why it happens. Oddly enough mpc-hc seems to play the file right. That makes it even weirder.
Myrsloik
19th October 2016, 23:40
R35-RC1 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R35-RC1.exe)
Should fix the avfs issues. Report any other bugs you find.
r35:
fixed avfs frame packing so it matches vfw behavior
fixed one frame leak on script reload in avfs
fixed 8bit 3x3 convolution where the upper left pixel wouldn't be taken into account correctly on x86
lansing
20th October 2016, 02:35
yes problem fixed, thanks
bin.n2f
20th October 2016, 21:13
Simply use:
res = core.tcanny.TCanny(src,sigma=2.83,mode=-1)
:thanks:
Myrsloik
27th October 2016, 10:43
R35 released. Same changes as for RC1 a few posts up. Now we're back to regular stable maintenance releases again I guess since AVFS, optimizations and other big refactoring has been tested now.
Selur
19th November 2016, 10:30
Got an invalid syntax error and I'm not sure what I'm doing wrong,..
(I'm on Ubuntu 14.04)
trying to load:
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = '/usr/lib/python3/dist-packages'
sys.path.append(os.path.abspath(scriptPath))
# Import scripts
import vs-havsfunc as havsfunc
# Loading /home/selur/Desktop/Test-AC3-5.1.avi using LWLibavSource
clip = core.lsmas.LWLibavSource(source="/home/selur/Desktop/Test-AC3-5.1.avi", cache=0)
# stabilizing using Stab
clip = havsfunc.Stab(clp=clip)
# Output
clip.set_output()
I get:
Failed to evaluate the script:
Python exception: invalid syntax (test.vpy, line 10)
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1490, in vapoursynth.vpy_evaluateScript (src/cython/vapoursynth.c:26958)
File "/home/selur/Desktop/test.vpy", line 10
import vs-havsfunc as havsfunc
^
SyntaxError: invalid syntax
havsfunc is present inside '/usr/lib/python3/dist-packages/vs-havsfunc.py'
-> How would I properly load the havsfunc script?
Are_
19th November 2016, 11:27
The problem is you are using a dash character in the module's name. Why?
Convert it to an underscore or even better, use the original name.
Selur
19th November 2016, 11:41
got the script from a ppa where the dash was inside the name. :)
Thanks for the info. :)
Khanattila
25th November 2016, 18:53
Feature request: native support for OpenCL platform.
Really, it's not a joke.
Selur
25th November 2016, 18:56
native support for OpenCL platform.
What OpenCL support is there aside from native?
Myrsloik
25th November 2016, 19:16
Feature request: native support for OpenCL platform.
Really, it's not a joke.
To solve what problem exactly? The slow upload/download of frames?
Khanattila
25th November 2016, 21:31
To solve what problem exactly? The slow upload/download of frames?
To share the same command queue or the same opencl context across multiple plugins.
Ok, for now there is only KNLMeansCL, but could be interesting for the future.
xekon
26th November 2016, 22:36
I am not sure this is the right place to discuss this, but its the only hit I found when searching "vapoursynth forum" on google.
I am wondering if anybody has put together any kind of software/scripts to use vapoursynth across multiple machines, not necessarily for a single job, but for multiple jobs.
I know encoding a single movie/episode across multiple computers has its pitfalls, however what if you had 30 movies to encode, or 380 episodes....
What I am wondering is if anyone found a way to script it so that they could encode all 380 episodes across 15 different machines, and each time a machine finishes an episode it would start the next one in the queue.
I was thinking some clever unix scripting could probably accomplish this, and thought I would ask if anyone is doing anything like that with vapoursynth.
I could SSH into all 15 machines and run the separate scripts for each machine, so that they all work on different files, but I was thinking that if there was a more centralized/automated way that would really be convenient and a time saver.
Q3CPMA
27th November 2016, 00:49
What I am wondering is if anyone found a way to script it so that they could encode all 380 episodes across 15 different machines, and each time a machine finishes an episode it would start the next one in the queue.
https://www.gnu.org/software/parallel/
xekon
30th November 2016, 05:41
very cool! thanks for letting me know about gnu.org parallel! I just formatted and installed ubuntu server 16.04.1 onto my machine.
I was following the documentation to install it under Ubuntu: http://www.vapoursynth.com/doc/installation.html
and I am having trouble with one package 'zimg' when I try to install zimg it says it depends on libmagickcore5 & libmagickwand5
as far as I can tell those are not available on Ubuntu 16.04.1, should I just go ahead and format again and install Ubuntu 15 instead? or has somebody gotten vapoursynth to work under Ubuntu 16.04.1?
thanks for any reply, I really appreciate it.
luigizaninoni
30th November 2016, 07:25
I installed it on Mint 18 (which is based on Ubuntu 16.04) and it works fine.
I followed this guide:
http://www.animemusicvideos.org/forum/viewtopic.php?t=125039
xekon
30th November 2016, 08:01
I installed it on Mint 18 (which is based on Ubuntu 16.04) and it works fine.
I followed this guide:
http://www.animemusicvideos.org/forum/viewtopic.php?t=125039
Thank you so much, looks like an excellent guide! going to get to it now. :)
feisty2
19th December 2016, 12:50
vs2017 rc is out, time to include msvcr2017 in the installer?
Myrsloik
19th December 2016, 12:54
vs2017 rc is out, time to include msvcr2017 in the installer?
I don't include alpha software.
Sm3n
20th December 2016, 19:46
Hello,
I'm using Vapoursynth x64 on windows. Can I load .ass as textsub?
I tried "core.avs.LoadPlugin(r'C:\Program Files (x86)\AviSynth+\plugins64\VSFilter.dll')" but it returns "Avisynth Loader: 2.5 plugins can't be loaded on x64"
I found this: https://github.com/Tsuki/VapourSynth-XY-VSFilter but dunno how to make it work.
Do I have to use a x86 Vapoursynth?
thx
Selur
20th December 2016, 19:50
Assuming you use R34 or newer http://www.vapoursynth.com/doc/plugins/subtext.html should do the trick.
Are_
20th December 2016, 19:51
Maybe the included subs plug-in (http://www.vapoursynth.com/doc/plugins/subtext.html) will suffice you:
clip = core.sub.TextFile(clip, "/path/to/sub/file.ass")
Sm3n
20th December 2016, 19:59
Assuming you use R34 or newer http://www.vapoursynth.com/doc/plugins/subtext.html should do the trick.
Maybe the included subs plug-in (http://www.vapoursynth.com/doc/plugins/subtext.html) will suffice you:
clip = core.sub.TextFile(clip, "/path/to/sub/file.ass")
Definitely. :) Next time I'll check first the official site before searching then asking on the forum ^^'
cheers
Selur
22nd December 2016, 10:32
btw. is there a way to use .srt subtitle inside Vapoursynth, without having to convert the subtitles to .ass beforehand?
Mystery Keeper
22nd December 2016, 11:50
btw. is there a way to use .srt subtitle inside Vapoursynth, without having to convert the subtitles to .ass beforehand?
xy-VSFilter?
Selur
22nd December 2016, 11:54
will try https://github.com/Tsuki/VapourSynth-XY-VSFilter
Selur
22nd December 2016, 12:15
hmm,... does anyone have a compiled version of this filter for Windows? (also has anyone tested whether this filter can be compiled for Linux and Mac? (argh, can't probably use it inside Hybrid due to the decss part; still interested in a Windows binary though)
VSFilterMod works fine (https://github.com/HomeOfVapourSynthEvolution/VSFilterMod) !!
Sm3n
24th December 2016, 09:20
VSFilterMod works fine (https://github.com/HomeOfVapourSynthEvolution/VSFilterMod) !!
Did you compile it for windows?
Selur
24th December 2016, 09:37
Didn't try, used the latest release (https://github.com/HomeOfVapourSynthEvolution/VSFilterMod/releases).
hajj_3
24th December 2016, 23:16
python 3.6 is out btw.
Myrsloik
25th December 2016, 18:30
So what do people want me to support? For the first time ever it's now kinda possible for me to support both 3.5.x and 3.6.x but I'll have to compile twice as many modules and modify the installer a bit.
Opinions? Obviously only officially supporting the latest Python is generally the least amount of effort.
fAy01
25th December 2016, 21:32
only officially supporting the latest Python is generally the least amount of effort.
That's a better option because you'd have more time to add features to vs than compiling it :)
feisty2
26th December 2016, 14:55
http://i.imgur.com/evgZdoY.png
NEWS: Python is now supported in visual studio 2017
could code your modules or complex scripts with it if you want to
Pat357
26th December 2016, 17:01
What's the easiest way to mount a vpy-script in R35 ?
How can I use Pismo (the one in the installer) for this ?
Myrsloik
26th December 2016, 18:07
What's the easiest way to mount a vpy-script in R35 ?
How can I use Pismo (the one in the installer) for this ?
Run "avfs.exe scriptname.vpy". It can be found in the directory where VapourSynth was installed.
feisty2
3rd January 2017, 16:13
how to make a global plugin initializing list for all functions in your module:
class get_core:
def __init__(self):
self.core = vs.get_core()
self.xxx = self.core.xxx.xxx
self.yyy = self.core.yyy.yyy
def f1(src):
core = get_core()
clip = core.xxx(src)
del core
return clip
def f2(src):
core = get_core()
clip = core.yyy(src)
clip = core.xxx(clip)
del core
return clip
so no "xxx = core.xxx.xxx" in both f1() and f2()
Myrsloik
4th January 2017, 21:36
Here's a test build with python 3.6 support (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R36-test1.exe). There are no other notable changes. Should work, I guess.
Selur
5th January 2017, 20:57
would be nice if SubText would also support .srt subtitles (https://github.com/HomeOfVapourSynthEvolution/VSFilterMod seems to be Windows only),...
jackoneill
6th January 2017, 18:51
would be nice if SubText would also support .srt subtitles (https://github.com/HomeOfVapourSynthEvolution/VSFilterMod seems to be Windows only),...
But then someone would have to write Yet Another SRT Parser...
Mystery Keeper
6th January 2017, 23:32
We need one cross-platform all-formats subtitles renderer. With webvtt support.
Selur
6th January 2017, 23:35
and ttxt ...
Jindadil007
7th January 2017, 06:21
Hi...I installed Python 3.6.0 and it is working fine.
However when I try to install "VapourSynth-R35" it shows an error... "At least one version of the core library has to be installed"...
I am newbie to python... Pl. guide how to install core library.
Thanks:confused:
Mystery Keeper
7th January 2017, 06:28
Hi...I installed Python 3.6.0 and it is working fine.
However when I try to install "VapourSynth-R35" it shows an error... "At least one version of the core library has to be installed"...
I am newbie to python... Pl. guide how to install core library.
Thanks:confused:VapourSynth r35 explicitly requires Python 3.5. VapourSynth r36 test1 explicitly requires Python 3.6. It has a known regression though. Better wait till next update.
Jindadil007
7th January 2017, 06:38
VapourSynth r35 explicitly requires Python 3.5. VapourSynth r36 test1 explicitly requires Python 3.6. It has a known regression though. Better wait till next update.
Thanks...Would try to install Python 3.5:thanks:
Myrsloik
7th January 2017, 17:20
R36 test2 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R36-test2.exe)
Changes:
r36:
added misc filters to included vapoursynth plugins
fixed several edge cases when specifying color values for blankclip and addborders, inf and nan are now always rejected and floating point values can be any finite value
vspipe will now properly report floating point formats in y4m instead of incorrectly making them look like integer, for example C420ps and C420ph will be used to mark single and half precision respectively
avfs will now reject scripts that don't have an avs or vpy extension to avoid pointless error mounts
fixed blankclip handling of color for compat formats
added sample type to vspipe info output
improved a few installer error messages when python can't be found
now uses python 3.6 in windows
fixed potential crash when two clips are added together (Kamekameha)
Boulder
11th January 2017, 05:18
Does there exist a filter (64-bit) for tackling a weird telecine pattern?
I have some material which seems to have a pattern "pppccpppccpppccpppccpppccppppcc" where p is a non-combed frame and c is a combed frame. VIVTC cannot tackle this one because the pattern is not constant enough.
LigH
11th January 2017, 08:26
At least it seems to be regular... usually it's advisable to count the number of equivalent fields to name the pattern, and to look at them as a Bob() result to identify blends. And I would suspect blends for your case, it sounds like blended PAL speed-up rather than Telecine.
Maybe you can provide a short prominent sample?
Boulder
11th January 2017, 08:40
I didn't check very thoroughly, at first I thought the material just needed a regular IVTC and then noticed the odd jumps when there's the 4:2 pattern. DGIndexNV shows NTSC and no percentage for FILM so it's hard telecined. It would probably look really ugly when played back on a DVD player..
I'll get you a sample later today when I get back from work.
Mystery Keeper
11th January 2017, 08:59
VDecimate is lacking the N in M decimation. Only 1 in M. That is what needs to be improved.
Boulder
11th January 2017, 17:08
Here's a testclip.
https://drive.google.com/open?id=0BzeF_1syecQwY3VVaUt3YlZjQTg
I probably need to do the TFM and TDecimate magic in Avisynth, save to a lossless AVI and do the rest in Vapoursynth with that clip. Tough job, but possible to automate.
AzraelNewtype
12th January 2017, 00:15
You know you can load tivtc and use its filters in vapoursynth instead of using a separate pass, right?
Boulder
12th January 2017, 04:54
You know you can load tivtc and use its filters in vapoursynth instead of using a separate pass, right?
I didn't check but the old 64-bit build of TIVTC is probably built with Avisynth 2.5 headers and cannot be loaded in Vapoursynth.
Nevertheless, TIVTC is so fast that I already got the first season pre-processed :)
NailBomber
13th January 2017, 08:05
I have a problem with colors of output image.
I need to export video into PNG image sequence, but colors are off when compared to mpv playback and mpv screenshots.
very basic script:
'''
import vapoursynth as vs
core = vs.get_core()
clip = core.ffms2.Source( "video.mkv" )
clip.set_output()
'''
This gives wrong colors:
vspipe --y4m "script.vpy" - | ffmpeg -i - -f image2 -vcodec png "image-%%03d.png"
Also if I open script in VirtualDub it shows wrong colors as well.
Using video file directly produces correct colors:
ffmpeg -i "video.mkv" -start_number 0 -f image2 -vcodec png "image-%%03d.png"
Also using python script gives correct colors too:
'''
import cv2 as cv
import numpy as np
import mvsfunc as mvs
import vapoursynth as vs
core = vs.get_core()
clip = core.ffms2.Source("video.mkv")
clip = mvs.ToRGB( input=clip, depth=8, kernel='spline64' )
frame = clip.get_frame(0)
planes_count = frame.format.num_planes
v = cv.merge([np.array(frame.get_read_array(i), copy=False) for i in reversed(range(planes_count))])
cv.imwrite("image.png", v)
'''
Should I change something in the script or pass some argument to vspipe?
Sorry if I ask very basic stuff.
P.S. I noticed that ffmpeg produces some pixelation in frames while python script and mpv screenshot doesn't.
Anyone knows why is that?
--
If I add 'clip = mvs.ToRGB( input=clip, depth=8, kernel='spline64' )' before clip.set_output() then VirtualDub show correct colors, but ffmpeg will warn about invalid data.
sneaker_ger
13th January 2017, 12:32
ffmpeg and VirtualDub usually assume BT.601 colors with YUV input while HD video usually is BT.709. As you have found out converting to RGB in the script may fix this if the filter assumes BT.709 which mvs seems to do based on the resolution of the clip. Now you can't pipe RGB using -y4m because that's for YUV formats (unless there's some extension I'm missing). RGB needs raw video piping with manual settings resolution, fps, colorspace..
NailBomber
13th January 2017, 14:17
Thank you.
I got it working (without converting to RGB) in 2 ways.
sending as raw:
vspipe "video.vpy" - | ffmpeg -f rawvideo -pixel_format yuv420p -s:v 1268x720 -colorspace bt709 -i - -start_number 0 -f image2 -vcodec png "image-%%03d.png"
sending as y4m:
vspipe --y4m "video.vpy" - | ffmpeg -f yuv4mpegpipe -colorspace bt709 -i - -start_number 0 -f image2 -vcodec png "image-%%03d.png"
dipje
13th January 2017, 15:36
as an exercise: You're giving ffmpeg raw YUV data, and you are writing PNG files which are RGB, so you're asking ffmpeg to convert your YUV data to RGB. Since every codec or program can have different rules or behaviours for this stuff, it can help to tell ffmpeg explicitly what you want to be done and with which colormatrix parameters.
If you give the 'scale' filter to ffmpeg (-vf scale) you can supply parameters like in_color_matrix, in_range , source format, destination format, dither algorithm , etc.. It's a bit to figure out but it'll help you prevent unwanted colorcasts or strange stuff happening.
(All the reports in the wild of the 'ffmpeg prores' encoder given colorcast issues/ It's this, people feeding it with rgb and it converts the rgb to yuv with other colormatrix parameters then people 'expect'. Feed it with YUV data, no conversion needed, no colorcasts).
I just find it a lot easier to do the conversion to RGB inside of vapoursynth instead of ffmpeg. The new resizers or good old fmtconv are perfect and easy for getting precise conversion to RGB.
vspipe "video.vpy" - | ffmpeg -f rawvideo -s <<width>>x<<height>> -pix_fmt <<pixelformat>> -i - -f image2 -vcodec png "image-%03d.png"
If your material is 8bpp, and thus your Vapoursynth is outputting RGB24 (that means _planar_ RGB 8bpp in Vapoursynth terms) and your video is 25fps 1920x1080, you would get this:
vspipe "video.vpy" - | ffmpeg -f rawvideo -r 25 -s 1920x1080 -pix_fmt gbrp -i - -f image2 -vcodec png "image-%03d.png"
ffmpeg's pixel format 'gbrp' means 'gbr planar'. Yes, that's RGB planar with the R channel at the end instead of at the front. Vapoursynth automatically takes care of this channel swapping these days.
My Vapoursynth script is pretty straight forward (with the use of mvsfunc's ToRGB):
import vapoursynth as vs
import mvsfunc as mvs
core = vs.get_core()
c = core.ffms2.Source(source = video.mp4')
c = mvs.ToRGB(input = c, depth = 8, kernel = 'spline36')
c.set_output()
NailBomber
13th January 2017, 15:50
Thank you.
I tried sending RGB24 as raw before, but didn't know about channel swapping, so never tried gbrp and was getting garbage.
-
I noticed that pixelation problems disappeared when sending RGB raw.
So it must have been result of ffmpeg's YUV-RGB conversion.
So indeed it's better to do conversion in VapourSynth.
feisty2
14th January 2017, 12:24
I'm thinking about adding AVX(2) optimizations to my plugins, is the pointer returned from getReadPtr() already aligned to 32-byte boundary or I'm gonna have to copy the entire plane to an aligned memory address?
Myrsloik
14th January 2017, 12:29
I'm thinking about adding AVX(2) optimizations to my plugins, is the pointer returned from getReadPtr() already aligned to 32-byte boundary or I'm gonna have to copy the entire plane to an aligned memory address?
Yes, the pointer always has the maximum required alignment (32 byte in this case).
And NONONONOOOOOOOOOOOOOOOO, avx has quite good unaligned access so copying the planes to align would probably be slower 99% of the time.
feisty2
14th January 2017, 12:37
:cool::thanks:
feisty2
15th January 2017, 08:43
Is
std::memcpy(&dstp[y][WidthMod8], &srcp[y][WidthMod8], (width - WidthMod8) * sizeof(float));
for (auto x = 0; x < WidthMod8; x += 8)
_mm256_store_ps(&dstp[y][x], reinterpret_cast<const __m256 &>(srcp[y][x]));
any faster than
std::memcpy(dstp[y], srcp[y], width * sizeof(float));
?
Myrsloik
15th January 2017, 10:07
Is
std::memcpy(&dstp[y][WidthMod8], &srcp[y][WidthMod8], (width - WidthMod8) * sizeof(float));
for (auto x = 0; x < WidthMod8; x += 8)
_mm256_store_ps(&dstp[y][x], reinterpret_cast<const __m256 &>(srcp[y][x]));
any faster than
std::memcpy(dstp[y], srcp[y], width * sizeof(float));
?
Probably not. Modern compilers all have very optimized memcpy. Occasionally you'll see someone with a small benchmark of their own memcpy variant that looks faster. Usually by using instructions that bypass the cache which makes benchmarks look better but are slower in a proper application.
See this hilarious thread (http://forum.doom9.org/showthread.php?p=1737056#post1737056) on how to not implement your own memcpy.
Myrsloik
16th January 2017, 21:29
R36 test3 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R36-test3.exe)
Should be RC quality since I've focused on bug fixes. Will probably be released next week.
Changes:
added morpho filter to windows installer
fixed planestats bug that could sometimes affect non-mod8 calculation
added leak warning for functions
added __signature__ attribute to python function objects (stuxcrystal)
in python function objects now have name, signature and plugin attributes, plugin objects now have a namespace attribute correcpsonding to the namespace
added misc filters to included vapoursynth plugins
fixed several edge cases when specifying color values for blankclip and addborders, inf and nan are now always rejected and floating point values can be any finite value
vspipe will now properly report floating point formats in y4m instead of incorrectly making them look like integer, for example C420ps and C420ph will be used to mark single and half precision respectively
avfs will now reject scripts that don't have an avs or vpy extension to avoid pointless error mounts
fixed blankclip handling of color for compat formats
added sample type to vspipe info output
improved a few installer error messages when python can't be found
now uses python 3.6 in windows
fixed potential crash when two clips are added together (Kamekameha)
lansing
18th January 2017, 16:54
This instruction on the installer is kind of confusing. I was upgrading both Python and Vapoursynth, after Python upgrade, the Vapoursynth installer said nothing about upgrade, it said new install, but then on the installation process, we can see that it was uninstalling the old version first.
And on the 2nd pop up from the installer, it said something about choosing which python version to install onto. Since I have both 32bit and 64bit Python, I saw two options, but the selection is a radio button, I can't uncheck any one of them, and when I click on them, the selected one will be hightlighted, it makes me feel like I have chosen one over the other, it was confusing.
Myrsloik
18th January 2017, 16:56
This instruction on the installer is kind of confusing. I was upgrading both Python and Vapoursynth, after Python upgrade, the Vapoursynth installer said nothing about upgrade, it said new install, but then on the installation process, we can see that it was uninstalling the old version first.
And on the 2nd pop up from the installer, it said something about choosing which python version to install onto. Since I have both 32bit and 64bit Python, I saw two options, but the selection is a radio button, I can't uncheck any one of them, and when I click on them, the selected one will be hightlighted, it makes me feel like I have chosen one over the other, it was confusing.
You make the 32/64 bit selection when picking which vapoursynth components to install. Since you picked both 32 and 64 bit core library it lets you select both. There's also no such thing as multiple concurrent installs possible. Simply skipping the uninstall would over time leave lots of junk lying around with no other benefits. Use the portable version if you for some reason need to have multiple installations lying around.
lansing
18th January 2017, 17:07
You make the 32/64 bit selection when picking which vapoursynth components to install. Since you picked both 32 and 64 bit core library it lets you select both. There's also no such thing as multiple concurrent installs possible. Simply skipping the uninstall would over time leave lots of junk lying around with no other benefits. Use the portable version if you for some reason need to have multiple installations lying around.
I'm talking about the gui with the radio button selections, not the one with the checkbox.
And for the upgrade I mean there should be some mentions of "upgrading" instead of just regular install when it detected that I have an older version installed.
Myrsloik
21st January 2017, 13:02
Here's R36 RC1 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R36-RC1.exe). Test it well. Portable version here (https://dl.dropboxusercontent.com/u/73468194/VapourSynth64-Portable-R36-RC1.7z).
Changes:
r36:
updated zimg library
packed format output now has alpha set instead of being zeroed
added asynchronous getframe support to python (stuxcrystal)
fixed several mac compilation issues
frame.props can now also behave like a proper python dict (stuxcrystal)
added morpho filter to windows installer
fixed planestats bug that could sometimes affect non-mod8 calculation
added leak warning for functions
added __signature__ attribute to python function objects (stuxcrystal)
in python function objects now have name, signature and plugin attributes, plugin objects now have a namespace attribute corresponding to the namespace
added misc filters to included vapoursynth plugins
fixed several edge cases when specifying color values for blankclip and addborders, inf and nan are now always rejected and floating point values can be any finite value
vspipe will now properly report floating point formats in y4m instead of incorrectly making them look like integer, for example C420ps and C420ph will be used to mark single and half precision respectively
avfs will now reject scripts that don't have an avs or vpy extension to avoid pointless error mounts
fixed blankclip handling of color for compat formats
added sample type to vspipe info output
improved a few installer error messages when python can't be found
now uses python 3.6 in windows
fixed potential crash when two clips are added together (Kamekameha)
Myrsloik
23rd January 2017, 19:42
R36 released. The installer has one microscopic change. Same change list as in the previous post.
KingLir
24th January 2017, 10:57
R36 released. The installer has one microscopic change. Same change list as in the previous post.
Many Thanks!
On brew (macOS) vapoursynth 35_1 is till showing as the latest. How in charge of releasing it on brew ?
hydra3333
24th January 2017, 13:15
Thank you.
JoeyMonco
24th January 2017, 16:38
Many Thanks!
On brew (macOS) vapoursynth 35_1 is till showing as the latest. How in charge of releasing it on brew ?
http://brewformulas.org/Vapoursynth
l33tmeatwad
26th January 2017, 23:48
Looks like R36 causes all versions of VapourSynth Editor to have a blue shade on the preview window for OSX (although encodes via FFMPEG look normal). R35 seems to work just fine, were there any particular changes to VapourSynth that could be causing this issue?
StainlessS
28th January 2017, 20:58
I've just tried to install vapoursynth on Linux Mint Cinnamon 18.1 (Serena) x64,
This went OK
./autogen.sh
./configure
But this
make
produces this
steve@cord-cin3 ~/vapoursynth $ ls
aclocal.m4 depcomp libvivtc.la
autogen.sh doc ltmain.sh
autom4te.cache include Makefile
build instructions windows.txt installer Makefile.am
ChangeLog install-sh Makefile.in
compile libeedi3.la missing
config.guess libimwri.la msvc_project
config.log libmiscfilters.la ofl.txt
config.status libmorpho.la pc
config.sub libremovegrain.la sdk
configure libtool setup.py
configure.ac libvapoursynth.la src
COPYING.LGPLv2.1 libvapoursynth-script.la test
cython_build.bat libvinverse.la
steve@cord-cin3 ~/vapoursynth $ make
CYTHON src/cython/vapoursynth.c
Error compiling Cython file:
------------------------------------------------------------
...
def __init__(self):
raise Error('Class cannot be instantiated directly')
def __str__(self):
return ('Format Descriptor\n'
f'\tId: {self.id:d}\n'
^
------------------------------------------------------------
src/cython/vapoursynth.pyx:597:15: Expected ')', found 'f'
Makefile:1971: recipe for target 'src/cython/vapoursynth.c' failed
make: *** [src/cython/vapoursynth.c] Error 1
any ideas what to do ? (linux/vapoursynth newbie)
Myrsloik
28th January 2017, 23:49
Use pip to update cython to thr latest version
StainlessS
29th January 2017, 01:11
Thanks for your answer M, tried to update cython using pip, but was using version 2.7 pip, so out of desperation tried pip3, which worked OK.
OK
cord-cin3 vapoursynth # ./autogen.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac,
libtoolize: and rerunning libtoolize and aclocal.
libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
autoreconf: running: /usr/bin/autoconf --force
autoreconf: configure.ac: not using Autoheader
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:9: installing './compile'
configure.ac:6: installing './missing'
Makefile.am: installing './depcomp'
autoreconf: Leaving directory `.'
OK
cord-cin3 vapoursynth # ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for ZIMG... yes
checking for yasm... yasm
checking for library containing dlopen... -ldl
checking for a Python interpreter with version >= 3... python3
checking for python3... /usr/bin/python3
checking for python3 version... 3.5
checking for python3 platform... linux
checking for python3 script directory... ${prefix}/lib/python3.5/site-packages
checking for python3 extension module directory... ${exec_prefix}/lib/python3.5/site-packages
checking for PYTHON3... yes
checking for cython3... cython3
checking for LIBASS... yes
checking for FFMPEG... no
checking for IMAGEMAGICK... yes
checking whether imagemagick is usable... yes
checking for TESSERACT... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating pc/vapoursynth.pc
config.status: creating pc/vapoursynth-script.pc
config.status: creating Makefile
config.status: executing depfiles commands
config.status: executing libtool commands
FAIL
cord-cin3 vapoursynth # make
CYTHON src/cython/vapoursynth.c
Error compiling Cython file:
------------------------------------------------------------
...
def __init__(self):
raise Error('Class cannot be instantiated directly')
def __str__(self):
return ('Format Descriptor\n'
f'\tId: {self.id:d}\n'
^
------------------------------------------------------------
src/cython/vapoursynth.pyx:597:15: Expected ')', found 'f'
Makefile:1971: recipe for target 'src/cython/vapoursynth.c' failed
make: *** [src/cython/vapoursynth.c] Error 1
cord-cin3 vapoursynth # ^C
cord-cin3 vapoursynth #
Are_
29th January 2017, 01:51
It would be nice if configure checked for a specific version of cython and screamed like if there was no tomorrow in case the minimum requirement was not met. He said he updated it, but we still don't know if this really went OK.
StainlessS
29th January 2017, 02:27
It would be nice if configure checked for a specific version of cython and screamed like if there was no tomorrow in case the minimum requirement was not met. He said he updated it, but we still don't know if this really went OK.
cord-cin3 vapoursynth # pip3 install -U pip
Requirement already up-to-date: pip in /usr/local/lib/python3.5/dist-packages
cord-cin3 vapoursynth # pip3 install cython
Requirement already satisfied: cython in /usr/lib/python3/dist-packages
cord-cin3 vapoursynth # ^C
cord-cin3 vapoursynth #
/usr/lib/python3/dist-packages
contains only folders pip, and pip-9.0.1.dist.info
EDIT: The /usr/lib/python3.5 folder contains this lot
steve@cord-cin3 /usr/lib/python3.5 $ ls
abc.py html selectors.py
aifc.py http shelve.py
antigravity.py idlelib shlex.py
argparse.py imaplib.py shutil.py
ast.py imghdr.py signal.py
asynchat.py importlib _sitebuiltins.py
asyncio imp.py sitecustomize.py
asyncore.py inspect.py site.py
base64.py io.py smtpd.py
bdb.py ipaddress.py smtplib.py
binhex.py json sndhdr.py
bisect.py keyword.py socket.py
_bootlocale.py lib2to3 socketserver.py
bz2.py lib-dynload sqlite3
calendar.py LICENSE.txt sre_compile.py
cgi.py linecache.py sre_constants.py
cgitb.py locale.py sre_parse.py
chunk.py logging ssl.py
cmd.py lzma.py statistics.py
codecs.py macpath.py stat.py
codeop.py macurl2path.py stringprep.py
code.py mailbox.py string.py
collections mailcap.py _strptime.py
_collections_abc.py _markupbase.py struct.py
colorsys.py mimetypes.py subprocess.py
_compat_pickle.py modulefinder.py sunau.py
compileall.py multiprocessing symbol.py
_compression.py netrc.py symtable.py
concurrent nntplib.py _sysconfigdata.py
config-3.5m-x86_64-linux-gnu ntpath.py sysconfig.py
configparser.py nturl2path.py tabnanny.py
contextlib.py numbers.py tarfile.py
copy.py opcode.py telnetlib.py
copyreg.py operator.py tempfile.py
cProfile.py optparse.py test
crypt.py os.py textwrap.py
csv.py _osx_support.py this.py
ctypes pathlib.py _threading_local.py
curses pdb.py threading.py
datetime.py __phello__.foo.py timeit.py
dbm pickle.py tkinter
decimal.py pickletools.py tokenize.py
difflib.py pipes.py token.py
dis.py pkgutil.py traceback.py
distutils platform.py tracemalloc.py
doctest.py plat-x86_64-linux-gnu trace.py
dummy_threading.py plistlib.py tty.py
_dummy_thread.py poplib.py turtle.py
email posixpath.py types.py
encodings pprint.py typing.py
enum.py profile.py unittest
filecmp.py pstats.py urllib
fileinput.py pty.py uuid.py
fnmatch.py __pycache__ uu.py
formatter.py pyclbr.py venv
fractions.py py_compile.py warnings.py
ftplib.py _pydecimal.py wave.py
functools.py pydoc_data weakref.py
__future__.py pydoc.py _weakrefset.py
genericpath.py _pyio.py webbrowser.py
getopt.py queue.py wsgiref
getpass.py quopri.py xdrlib.py
gettext.py random.py xml
glob.py reprlib.py xmlrpc
gzip.py re.py zipapp.py
hashlib.py rlcompleter.py zipfile.py
heapq.py runpy.py
hmac.py sched.py
steve@cord-cin3 /usr/lib/python3.5 $
Are_
29th January 2017, 02:53
I still don't know witch version of cython do you have. What about the output of:
cython -V
If you already had cython installed the command should include -U
pip3 install cython -U
If that doesn't help uninstall and install again. Vapoursynth needs cython >=0.24.0
StainlessS
29th January 2017, 03:17
pip3 install cython -U
That seems to have nailed it.
cord-cin3 vapoursynth # pip3 install -U pip
Requirement already up-to-date: pip in /usr/local/lib/python3.5/dist-packages
cord-cin3 vapoursynth # pip3 install cython
Requirement already satisfied: cython in /usr/lib/python3/dist-packages
cord-cin3 vapoursynth # cython -V
The program 'cython' is currently not installed. You can install it by typing:
apt install cython
cord-cin3 vapoursynth # ^C
cord-cin3 vapoursynth # pip3 install cython -U
Collecting cython
Downloading Cython-0.25.2-cp35-cp35m-manylinux1_x86_64.whl (7.0MB)
100% |████████████████████████████████| 7.0MB 133kB/s
Installing collected packages: cython
Found existing installation: Cython 0.23.4
DEPRECATION: Uninstalling a distutils installed project (cython) has been deprecated and will be removed in a future version.
This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling Cython-0.23.4:
Successfully uninstalled Cython-0.23.4
Successfully installed cython-0.25.2
'make' and 'make install' seem to have completed OK, now to see if I can get it to do something :)
Thanks very much guys.
feisty2
4th February 2017, 15:44
new module:
Plum https://forum.doom9.org/showthread.php?t=173775
Sm3n
8th February 2017, 15:10
Hi,
I wanted to install HAvsFunc but screwing a bit I choose to reinstall & update VS and here is the following error:
./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for ZIMG... yes
checking for yasm... yasm
checking for library containing dlopen... -ldl
checking for a Python interpreter with version >= 3... python3
checking for python3... /usr/bin/python3
checking for python3 version... 3.4
checking for python3 platform... linux
checking for python3 script directory... ${prefix}/lib/python3.4/site-packages
checking for python3 extension module directory... ${exec_prefix}/lib/python3.4/site-packages
checking for PYTHON3... yes
checking for cython3... cython3
checking for LIBASS... yes
checking for FFMPEG... yes
checking for IMAGEMAGICK... yes
checking whether imagemagick is usable... yes
checking for TESSERACT... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating pc/vapoursynth.pc
config.status: creating pc/vapoursynth-script.pc
config.status: creating Makefile
config.status: executing depfiles commands
config.status: executing libtool commands
root@sd-40375 ~/vapoursynth # make -j12
CXXLD libvapoursynth.la
CXXLD libsubtext.la
CCLD vapoursynth.la
/usr/bin/ld: /usr/local/lib/libavcodec.a(hevc_cabac.o): relocation R_X86_64_PC32 against symbol `ff_h264_cabac_tables' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:978: recipe for target 'libsubtext.la' failed
make: *** [libsubtext.la] Error 1
libass-dev is installed. Any idea? VS and VSE run smoothly before.
Thx
sl1pkn07
8th February 2017, 15:22
the problem is in you ffmpeg. is builded without -fPIC
/usr/bin/ld: /usr/local/lib/libavcodec.a(hevc_cabac.o): relocation R_X86_64_PC32 against symbol `ff_h264_cabac_tables' can not be used when making a shared object; recompile with -fPIC
try contact with your distro ffmpeg package provided or build yourself with -fpic activated (--enable-pic configure option)
Sm3n
8th February 2017, 15:27
the problem is in you ffmpeg. is builded without -fPIC
/usr/bin/ld: /usr/local/lib/libavcodec.a(hevc_cabac.o): relocation R_X86_64_PC32 against symbol `ff_h264_cabac_tables' can not be used when making a shared object; recompile with -fPIC
try contact with your distro ffmpeg package provided or build yourself with -fpic activated (--enable-pic configure option)
I'll try that.
Cheers
JoeyMonco
8th February 2017, 17:40
Or you just simply compile ffmpeg as a shared library not as a static library. Just pass --enable-shared to configure.
The error is telling you that you are trying to use a static library to make a shared object.
Sm3n
8th February 2017, 17:43
Or you just simply compile ffmpeg as a shared library not as a static library. Just pass --enable-shared to configure.
The error is telling you that you are trying to use a static library to make a shared object.
Here is my ffmpeg configure command and I'm not making a shared object:
./configure --enable-libmp3lame --enable-libxvid --enable-libvorbis --enable-gpl --enable-libtheora --enable-zlib --disable-shared --enable-static --enable-libx264 --enable-nonfree --enable-version3 --enable-libschroedinger --enable-avfilter --enable-libspeex --enable-libopenjpeg --enable-libgsm --enable-postproc --enable-pthreads --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-ffplay --prefix=/usr/local --enable-runtime-cpudetect --enable-bzlib --enable-libdc1394 --enable-libass --enable-libfdk_aac --extra-cflags="-fPIC" --enable-libfreetype --enable-pic && make clean && make -j 12 && mkdir /usr/local/share/ffmpeg && checkinstall
Enabling pic didn't change a thing:
/usr/bin/ld: /usr/local/lib/libavcodec.a(hevc_cabac.o): relocation R_X86_64_PC32 against symbol `ff_h264_cabac_tables' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:978: recipe for target 'libsubtext.la' failed
make: *** [libsubtext.la] Error 1
make: *** Waiting for unfinished jobs....
JoeyMonco
8th February 2017, 17:46
Here is my ffmpeg configure command and I'm not making a shared object:
snip
Did you not read the error from ld about using a .a file when making a shared object? As I said, compile ffmpeg as a shared library not as static.
Enabling pic didn't change a thing:
/usr/bin/ld: /usr/local/lib/libavcodec.a(hevc_cabac.o): relocation R_X86_64_PC32 against symbol `ff_h264_cabac_tables' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:978: recipe for target 'libsubtext.la' failed
make: *** [libsubtext.la] Error 1
make: *** Waiting for unfinished jobs....
Of course it didn't as that recompile message in the error is misleading. The issue is your ffmpeg is being compiled as a static library whereas ld expects to be a shared library. -fPIC is not going to solve that issue.
Sm3n
8th February 2017, 18:13
OK, now I get it. thank you guys!
It's been installed. Now VSE won't load library...
jackoneill
9th February 2017, 12:23
Did you not read the error from ld about using a .a file when making a shared object? As I said, compile ffmpeg as a shared library not as static.
Of course it didn't as that recompile message in the error is misleading. The issue is your ffmpeg is being compiled as a static library whereas ld expects to be a shared library. -fPIC is not going to solve that issue.
Nope. Compiling shared libraries (ffms2) with static ffmpeg has worked just fine in the past, provided that --enable-pic was passed to ffmpeg's configure.
Sm3n: Are you sure checkinstall is overwriting the existing files?
JoeyMonco
9th February 2017, 18:36
Nope. Compiling shared libraries (ffms2) with static ffmpeg has worked just fine in the past, provided that --enable-pic was passed to ffmpeg's configure.
Oh okay. Whenever I encountered that error I always just saw the solution to be the --enable-shared. :o
WolframRhodium
11th February 2017, 16:09
What is the preferred way to reference the "core" in external module after this commit (https://github.com/vapoursynth/vapoursynth/commit/c990893126debf7ccce1c4fc6df0f81770a6c7a9)?
Myrsloik
11th February 2017, 16:11
What is the preferred way to reference the "core" in external module after this commit (https://github.com/vapoursynth/vapoursynth/compare/1a99d6a837...c990893126)?
Almost all the quirks are gone so just put:
from vapoursynth import core
at the top and do core.what.Ever() when you want do things.
WolframRhodium
11th February 2017, 16:16
Almost all the quirks are gone so just put:
from vapoursynth import core
at the top and do core.what.Ever() when you want do things.
I mean, should I put it inside the function of the module?
Myrsloik
11th February 2017, 16:17
I mean, should I put it inside the function of the module?
What does that mean?
WolframRhodium
11th February 2017, 16:20
What does that mean?
method 1:
xxx.py:
from vapoursynth import core
def a_function(clip):
...
return clip
method 2:
xxx.py:
def a_funcion(clip):
from vapoursynth import core
...
return clip
which is preferred?
Myrsloik
11th February 2017, 16:21
method 1:
xxx.py:
from vapoursynth import core
def a_function(clip):
...
return clip
method 2:
xxx.py:
def a_funcion(clip):
from vapoursynth import core
...
return clip
which is preferred?
Method 1
WolframRhodium
11th February 2017, 16:24
Method 1
got it, thanks
Selur
15th February 2017, 11:25
What could be the cause of:
Failed to evaluate the script:
Python exception: Failed to load C:/Program Files/Hybrid/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll. GetLastError() returned 126.
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1491, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:26905)
File "", line 16, in <module>
File "src\cython\vapoursynth.pyx", line 1383, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:25212)
vapoursynth.Error: Failed to load C:/Program Files/Hybrid/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll. GetLastError() returned 126.
copied my portable Vapoursytnh folders to another machine,..
Cu Selur
Myrsloik
15th February 2017, 11:32
Error code 126 usually means it can't load a required dll. So knlmeanscl probably depends on some runtime/library that isn't installed.
Selur
15th February 2017, 11:36
okay thanks, will look into it :)
update: That helped! needed to load the opencl.dll since it wasn't installed on the system. :)
KingLir
23rd February 2017, 00:28
Ask and ye shall receive:
TNLMeans (http://www.mediafire.com/download/rnv4hqp6edz4x66/VapourSynth-TNLMeans_r30.7z)
I only tested the x64 versions of each...
Thanks. Anyone have an idea how to fix the build for macOS ? I am guessing VFR-maniac didn't get a notification from GitHub about the issue opened a few months ago:
https://github.com/VFR-maniac/VapourSynth-TNLMeans/issues/3
Are_
23rd February 2017, 00:48
Maybe -stdlib=libstdc++ may help?
KingLir
23rd February 2017, 01:13
Maybe -stdlib=libstdc++ may help?
Thanks but "make -stdlib=libstdc++" just creates empty .o files and dylib file
Are_
23rd February 2017, 01:21
That's an option for the compiler, edit the makefile or pass it as an env variable to make.
KingLir
23rd February 2017, 01:41
That's an option for the compiler, edit the makefile or pass it as an env variable to make.
oh, it's seems it made some progress. Now getting:
./TNLMeans.h:36:10: fatal error: 'thread' file not found
#include <thread>
1 error generated.
EDIT: fixed:
https://github.com/VFR-maniac/VapourSynth-TNLMeans/issues/3#issuecomment-282040376
Selur
3rd March 2017, 09:39
Using VapourSynth R36 64bit portable I got a problem using vspipe and I don't see the cause for it:
Looking at my script:
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'G:/Hybrid/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/vsfilters/Support/dctfilter.dll")
core.std.LoadPlugin(path="G:/Hybrid/vsfilters/DeblockFilter/Deblock/Deblock.dll")
core.std.LoadPlugin(path="G:/Hybrid/vsfilters/Support/fmtconv.dll")
core.avs.LoadPlugin(path="G:/Hybrid/vsfilters/SourceFilter/DGDecNV/DGDecodeNV.dll")
# Import scripts
import havsfunc as havsfunc
clip = core.avs.DGSource("H:/Temp/09_20_35_7410.dgi")
# adjusting color matrix from 709 to 470bg
clip = core.resize.Bicubic(clip, matrix_in_s="709", matrix_s="470bg", range_in=0, range=0)
# Deblocking using Deblock_QED
clip = havsfunc.Deblock_QED(clip)
# resizing to 704x358
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=704, h=358, interlaced=False, interlacedd=False)
# Output
clip.set_output()
through vsedit, I get:
Script was successfully evaluated. Output video info:
Frames: 183999 | Time: 2:07:54.292 | Size: 704x358 | FPS: 24000/1001 = 23.976 | Format: YUV420P16
and the preview looks fine.
But when I call:
"G:\Hybrid\VAPOUR~1\vspipe.exe" "H:\Temp\encodingTempSynthSkript_09_20_35_7410.vpy" - --y4m
I get:
Script evaluation failed:
Python exception: Unexpected behavior. Contact author.
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1712, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:34991)
File "H:\Temp\encodingTempSynthSkript_09_20_35_7410.vpy", line 17, in <module>
clip = core.avs.DGSource("H:/Temp/09_20_35_7410.dgi")
File "src\cython\vapoursynth.pyx", line 1604, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:33131)
vapoursynth.Error: Unexpected behavior. Contact author.
Seems to be a bug in DGDecNV 5053, using DGDecNV 5052, problem doesn't occur.
-> will contact DG
Cu Selur
Selur
4th March 2017, 07:38
@Stehen R. Savage: Thanks for the hint. I know. :) Since the script is generated, keeping them separated seemed to be the easier way.
I normally run all color changes first, then some filters, then the resizer, then some other filters after the resize.
Does it make much of a difference in terms of speed? (I could probably write some code to optimize my generated scripts in case it does.)
-----
Seems to be a bug in DGDecNV 5053, using DGDecNV 5052, problem doesn't occur.
-> will contact DG
(Thanks to DG) that problem is fixed with the latest binary update of DGDecNV.
-----
Another question: Is there something similar to AVSMeter for Avisynth (a VPYMeter) ? A small tool/script to measure speed and memory consumption of Vapoursynth scripts?
Cu Selur
ChaosKing
4th March 2017, 08:35
The Vapoursynth Editor has a build in benchmarking option with memory consumtion (Core framebuffer).
Selur
4th March 2017, 09:00
oh,... wasn't aware of that thanks!
Boulder
4th March 2017, 09:47
I noticed that vspipe uses a lot of memory at the beginning of an encode process, then slowly lowers the usage until it's in the normal range. I'm talking about going from 3 GB to 800-900 MB.
Myrsloik
4th March 2017, 10:27
I noticed that vspipe uses a lot of memory at the beginning of an encode process, then slowly lowers the usage until it's in the normal range. I'm talking about going from 3 GB to 800-900 MB.
That's because it figures out how big the caches have ro be after a while. This isn't avisynth...
Selur
4th March 2017, 17:34
The core resizer is pipelined, so combining multiple operations into one call avoids extra VS caches and memory copies.
Sounds like in an average script with multiple filters it probably doesn't really matter. :)
In fact, restoration filters like deblock/dering should probably operate on the original image.
Don't think that color matrix changes should have an impact on deblocking/deringing filters, since it shouldn't change the macroblocks positioning like cropping would.
Selur
7th March 2017, 05:04
Small question when I have to clips (left, right) I want to StackHorizontal, how can I do something like this in Vapoursynth?
if(left.color_space != right.color_space){
left = convertToColorspace(left, right.color_space);
}
Thanks!
Mystery Keeper
7th March 2017, 05:24
Small question when I have to clips (left, right) I want to StackHorizontal, how can I do something like this in Vapoursynth?
if(left.color_space != right.color_space){
left = convertToColorspace(left, right.color_space);
}
Thanks!left = core.resize.Spline36(left, format=right.format.id)
diff = core.std.StackHorizontal([left, right])
Selur
7th March 2017, 05:26
Thanks :)
Myrsloik
8th March 2017, 19:51
R37 RC1 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R37-RC1.exe)
I just want to fix one final bug in avfs that causes random crashes for avisynth peasants before the final release. It's very safe to use since this time it's all bug fixes.
Changes:
fixed blankclip and addborders sometimes rejecting valid floating point color values (jackoneill)
vdecimate no longer stores the metrics for all frames, thus saving a lot of memory for long clips (jackoneill)
changed get_read* functions in python so their memory no longer incorrectly is writable (Kamekameha)
added rational number fps property to clips in python (Kamekameha)
mostly worked around an issue where python would replace the sigint handler
fixed bug that could sometimes cause false memory leak warnings when freeing core
fixed possible corruption on frames without subtitles in subtext (jackoneill)
added a proxy object to avoid referencing the wrong core in scripts (stuxcrystal)
hydra3333
9th March 2017, 12:09
Just a thought.
Has anyone noted the nvidia-GPU accelerated filters for deinterlace / knlmeans / lsf over at DG's site ?
Reported phenomenal speeds as compared to equivalent cpu based filters.
http://rationalqm.us/board/viewtopic.php?f=8&t=506
http://rationalqm.us/board/viewtopic.php?f=8&t=558
hydra3333
10th March 2017, 13:45
Per this post http://rationalqm.us/board/viewtopic.php?f=8&t=506&p=6250#p6248 about the 2 new filters DGDenoise DGSharpen which use the GPU for seriously sped up filtering, I get now these messages all the time:
Avisynth Compat: requested frame xxx not prefetched, using slow method
and then this
Core freed but 645120 bytes still allocated in framebuffers
A quick peek at this code https://github.com/vapoursynth/vapoursynth/blob/master/src/avisynth/avisynth_compat.cpp seems to suggest to an uninitiated person that it could be updated to take into account DGDenoise and DGSharpen ? If so could that please be done ? Or, advice on what else should be done.
I and presumably some others would like to benefit from gpu accelerated filters yielding eye-wateringly fast speeds :)
Thanks.
Myrsloik
10th March 2017, 14:05
Per this post http://rationalqm.us/board/viewtopic.php?f=8&t=506&p=6250#p6248 about the 2 new filters DGDenoise DGSharpen which use the GPU for seriously sped up filtering, I get now these messages all the time:
and then this
A quick peek at this code https://github.com/vapoursynth/vapoursynth/blob/master/src/avisynth/avisynth_compat.cpp seems to suggest to an uninitiated person that it could be updated to take into account DGDenoise and DGSharpen ? If so could that please be done ? Or, advice on what else should be done.
I and presumably some others would like to benefit from gpu accelerated filters yielding eye-wateringly fast speeds :)
Thanks.
I need the filter names and which frames they need as input to produce one frame of output. It's that simple.
hydra3333
10th March 2017, 14:38
I need the filter names and which frames they need as input to produce one frame of output. It's that simple.
All good. Their names are DGDenoise and DGSharpen and they both use only the current frame. I suppose DGSource doesn't need mentioning.
Thanks !
Cary Knoop
10th March 2017, 16:49
All good. Their names are DGDenoise and DGSharpen and they both use only the current frame.
I personally would not bother with a GPU denoiser only using the current frame.
TheFluff
12th March 2017, 00:29
Per this post http://rationalqm.us/board/viewtopic.php?f=8&t=506&p=6250#p6248 about the 2 new filters DGDenoise DGSharpen which use the GPU for seriously sped up filtering, I get now these messages all the time:
and then this
A quick peek at this code https://github.com/vapoursynth/vapoursynth/blob/master/src/avisynth/avisynth_compat.cpp seems to suggest to an uninitiated person that it could be updated to take into account DGDenoise and DGSharpen ? If so could that please be done ? Or, advice on what else should be done.
I and presumably some others would like to benefit from gpu accelerated filters yielding eye-wateringly fast speeds :)
Thanks.
For the record, the "slow" method that you're getting warned about simply replicates what (single threaded) Avisynth does. Execution is completely serial and synchronous. Say that you request frame 3 from a temporal filter that requires one frame before the requested frame and one frame after the requested frame to produce output. With the slow (Avisynth) method, you call GetFrame(3), then the filter requests frame 2 from the upstream filter, waits for it to return, requests frame 3, waits for that to return, requests frame 4, waits for that to return, does its processing, and then returns a frame. The filter can tell Avisynth which frames would be useful to cache, but that's the extent of it. It's awful, but that's software from 2001 for you.
When VS loads Avisynth filters via the fake Avisynth environment, the filters that have been whitelisted (together with what frames they are expected to require to produce an output frame) are actually parallelized to a certain degree. Only one thread will call the filter's (Avisynth) GetFrame function at a time, so the actual processing is still single-threaded, but since VS knows in advance what frames the filter is going to request from the upstream filter if you request frame n, those frames are pre-fetched (in parallel, if the upstream filter supports it) before the filter's GetFrame(n) is ever called and any GetFrame requests from within the filter can return immediately. Even spatial only filters benefit (they still require one frame from the upstream filter, and that frame can be prefetched). Whitelisted filters also play nicer with parallelized downstream filters, since they can request many frames in parallel from the Avisynth filter wrapper, which then requests many frames in parallel from the upstream filters.
In other words: in single threaded, original Avisynth, only one filter can do work at a time. Every other filter spends all its time waiting for processing getting done somewhere else. When a single threaded Avisynth filter is used in VS, in an ideal world it can sit in its own thread and do processing as fast it can, never waiting on input (because the input is being processed in many other threads in parallel), while filters that do further processing on its output aren't bottlenecked on waiting for the Avisynth filter's input, and potentially not even on the Avisynth filter itself.
Selur
12th March 2017, 07:41
Small question: Is there something like Restore24 for Vapoursynth?
ChaosKing
12th March 2017, 12:06
yes, there is srestore: https://forum.doom9.org/showthread.php?t=166582
feisty2
15th March 2017, 10:21
@Myrsloik
is the global core allowed again from r37 and on?
is it ok to code the module like
import vapoursynth as vs
xxx = vs.core.yyy.xxx
def f(src):
return xxx(src)
?
Myrsloik
15th March 2017, 12:08
@Myrsloik
is the global core allowed again from r37 and on?
is it ok to code the module like
import vapoursynth as vs
xxx = vs.core.yyy.xxx
def f(src):
return xxx(src)
?
Sure is, that's completely equivalent from python's perspective. Why you want to prefix everything with 'vs.' is a mystery though...
feisty2
15th March 2017, 12:26
Sure is, that's completely equivalent from python's perspective. Why you want to prefix everything with 'vs.' is a mystery though...
I don't want to prefix everything with "vs", but I simply can't go with the from vapoursynth import core way cuz I need other stuff like "vs.VideoNode" or "vs.GRAY" and things like that..
Are_
15th March 2017, 12:38
Yeah, I also found the same problem, I could not pass stuff like "vs.YUV444P16" or whatever to these functions, I think it's not convenient at all. Also its bad practice in python to do imports inside functions.
feisty2
15th March 2017, 12:47
Also its bad practice in python to do imports inside functions.
you should import the core with a global import statement, not within functions
Are_
15th March 2017, 13:03
Mmmh... OK, I saw it somewhere used like that and I was thinking this was the new way of doing it.
feisty2
15th March 2017, 13:18
@Myrsloik
I think the global core is not working as expected in modules
so a test script like
from vapoursynth import core
BlankClip = core.std.BlankClip
def GenBlank(src):
return BlankClip(src)
ref = BlankClip()
clp = GenBlank(ref)
clp.set_output()
works without any problem, but if I separate it into a test module and a script like
#blah.py
from vapoursynth import core
BlankClip = core.std.BlankClip
def GenBlank(src):
return BlankClip(src)
#test script
from vapoursynth import core
import blah
BlankClip = core.std.BlankClip
ref = BlankClip()
clp = blah.GenBlank(ref)
clp.set_output()
I get the following error:
Failed to evaluate the script:
Python exception: BlankClip: nodes foreign to this core passed as input, improper api usage detected
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1821, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:36464)
File "", line 7, in <module>
File "C:\Program Files\Python36\lib\site-packages\blah.py", line 6, in GenBlank
return BlankClip(src)
File "src\cython\vapoursynth.pyx", line 1713, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:34604)
vapoursynth.Error: BlankClip: nodes foreign to this core passed as input, improper api usage detected
Myrsloik
15th March 2017, 13:26
@Myrsloik
I think the global core is not working as expected in modules
so a test script like
from vapoursynth import core
BlankClip = core.std.BlankClip
def GenBlank(src):
return BlankClip(src)
ref = BlankClip()
clp = GenBlank(ref)
clp.set_output()
works without any problem, but if I separate it into a test module and a script like
#blah.py
from vapoursynth import core
BlankClip = core.std.BlankClip
def GenBlank(src):
return BlankClip(src)
#test script
from vapoursynth import core
import blah
BlankClip = core.std.BlankClip
ref = BlankClip()
clp = blah.GenBlank(ref)
clp.set_output()
I get the following error:
The improvement was only about core references, now you're storing function references (which are also per core). That's a bad habit. Don't be clever.
feisty2
15th March 2017, 14:16
The improvement was only about core references, now you're storing function references (which are also per core). That's a bad habit. Don't be clever.
I just wanna simplify (remove the extra namespaces) the function calling process... like, I personally prefer "BlankClip" over "core.std.BlankClip"
I think this
from vapoursynth import core
class c:
def __init__(self):
self.BlankClip = core.std.BlankClip
def GenBlank(src):
obj = c()
clip = obj.BlankClip(src)
del obj
return clip
is gonna work, at least now I can shrink 2 namespaces down to 1.
Myrsloik
17th March 2017, 19:45
Here's R37 RC2 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R37-RC2.exe). It fixes avfs crashes with avisynth and not much else. It's also compiled with a combination of vs2017 and clang to make things interesting. Will be released if nobody dies from testing it.
sneaker_ger
18th March 2017, 22:29
R37 RC2: error about missing libgcc_s_seh-1.dll
Myrsloik
18th March 2017, 22:45
R37 RC2: error about missing libgcc_s_seh-1.dll
When you do what exactly? only a few of the included plugins are compiled with gcc and never need extra dlls. Could it be caused by an autoloaded plugin?
sneaker_ger
18th March 2017, 23:03
Yes, it seems to be caused by core64\plugins\libsubtext.dll. Once I delete that the error message is gone.
import vapoursynth as vs
core = vs.get_core()
ret = core.std.BlankClip()
ret.set_output()
vspipe --info script.vpy -
It works normally despite the error message, though.
No error message with libsubtext.dll from R36 copied into R37 RC2.
Mystery Keeper
19th March 2017, 07:44
I get that error too.
Myrsloik
19th March 2017, 10:57
Yes, it seems to be caused by core64\plugins\libsubtext.dll. Once I delete that the error message is gone.
import vapoursynth as vs
core = vs.get_core()
ret = core.std.BlankClip()
ret.set_output()
vspipe --info script.vpy -
It works normally despite the error message, though.
No error message with libsubtext.dll from R36 copied into R37 RC2.
Sigh, I'll have to spank jackoneill for miscompiling the fixed version. And I found one more place where the useless avisynth 2.6 api could cause crashes in avfs. Expect RC3 soon...
Myrsloik
19th March 2017, 13:57
R37 RC3 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R37-RC3.exe)
Fixes the missing dll stuff with libsubtext, I'd appreciate if someone can verify that it works properly too. Also fixes one more avfs issue. Probably the last RC.
sneaker_ger
19th March 2017, 14:17
Can confirm: no error with R37 RC3.
Mystery Keeper
19th March 2017, 15:00
Same. No error with R37 RC3.
Myrsloik
20th March 2017, 12:32
R37 is released. The Avisynth API sucks. Sky still blue.
Myrsloik
20th March 2017, 18:54
The R37 binaries have now been updated. The released ones were unfortunately miscompiled which caused a pile of issues.
stax76
20th March 2017, 20:14
Is it correct that VC++ 2017 uses the same filename (msvcp140.dll) as VC++ 2015 runtime?
Myrsloik
20th March 2017, 20:20
Yes, the vs2017 runtime replaces the vs2015 one
Myrsloik
21st March 2017, 13:30
I just fixed an issue with the portable version. Previously it included vs2017 runtime dlls that only work on win8 and newer. Now it's fixed and win7 is once again properly supported. You only have to re-download if it failed to launch before.
All the fun of switching compilers... The current release requires VS2015, VS2017 AND clang to compile. Hopefully Python will add support for VS2017 too so it's reduced to only two compilers for the next release.
hydra3333
22nd March 2017, 11:51
All good. Their names are DGDenoise and DGSharpen and they both use only the current frame. I suppose DGSource doesn't need mentioning.
Thank you for adding them to R37.
https://github.com/vapoursynth/vapoursynth/blob/master/src/avisynth/avisynth_compat.cpp
myrsloik Impertinently add DGSharpen and DGWhatever to prefetch list :)
hydra3333
22nd March 2017, 21:15
Per this post http://rationalqm.us/board/viewtopic.php?f=4&t=463&sid=c75bd90411392cb95d229e81c3b59573&p=6380#p6380 DG has added 2 new avisynth gpu accelerated filters,
Added fast CUDA filters DGTelecide and DGDecimate
and will be adding more new gpu accelerated filters in the near future, eg DGDeblock http://rationalqm.us/board/viewforum.php?f=14
Everyone loves to have quality good and extremely fast filters ... So now wondering 2 things :-
1. can we please add these to Vapoursynth i.e. https://github.com/vapoursynth/vapoursynth/blob/master/src/avisynth/avisynth_compat.cpp ?
2. How can we add new filters quickly from time to time without having to wait for new releases of Vapoursynth ?
It was suggested that maybe have a user-editable config file so that we can add our own filter definitions from time to time pending new releases of Vapoursynth ?
Such an approach would be really handy for other new and updated filters too.
Selur
22nd March 2017, 21:22
How can we add new filters quickly from time to time without having to wait for new releases of Vapoursynth ?
Manual loading, like when you load from a location that isn't the default plugins folder, should work. Shouldn't it?
hydra3333
22nd March 2017, 21:32
Manual loading, like when you load from a location that isn't the default plugins folder, should work. Shouldn't it?
Yes manual loading should work fine. Modifying that file isn't about loading it, it's apparently about Vapoursynth knowing how many frames a filter will fetch in both directions for parallelism reasons :) or something like that.
Myrsloik
22nd March 2017, 21:39
Per this post http://rationalqm.us/board/viewtopic.php?f=4&t=463&sid=c75bd90411392cb95d229e81c3b59573&p=6380#p6380 DG has added 2 new avisynth gpu accelerated filters,
and will be adding more new gpu accelerated filters in the near future, eg DGDeblock http://rationalqm.us/board/viewforum.php?f=14
Everyone loves to have quality good and extremely fast filters ... So now wondering 2 things :-
1. can we please add these to Vapoursynth i.e. https://github.com/vapoursynth/vapoursynth/blob/master/src/avisynth/avisynth_compat.cpp ?
2. How can we add new filters quickly from time to time without having to wait for new releases of Vapoursynth ?
It was suggested that maybe have a user-editable config file so that we can add our own filter definitions from time to time pending new releases of Vapoursynth ?
Such an approach would be really handy for other new and updated filters too.
1. Sure, I'll add them.
2. You don't, write native stuff. Or recompile only avscompat.dll on your own. All you need is vs2017 community which is free.
hydra3333
23rd March 2017, 03:34
1. Sure, I'll add them.
2. You don't, write native stuff. Or recompile only avscompat.dll on your own. All you need is vs2017 community which is free.
Beaut, thanks.
OK "vs2017 community" to recompile only a "portable" avscompat.dll on my own ... now I'm off to look up how to do that for x64 :) and then plonk a replacement AvsCompat.dll under
Vapoursynth\vapoursynth64\coreplugins
Very definitely looking forward to an expanded set of amazingly fast GPU accelerated filters :)
Imagine, if you would, a gpu based QTGMC or equivalent (well, one can always live in hope).
Exciting times !
Pat357
28th March 2017, 00:21
After I got the info about fmtconv being no longer updated, I started looking at ZIMG (again!)
Do we still need the ZIMG (libzimg) plugin with the current VS37 or is this completely included in VS ?
I know the build-in resizers are based on the Zimg lib., but maybe for some other things we still need the whole lib.
What is the name-space to access the Zimg lib functions directly ?
Anyway, without my (outdated) plugin loaded, I don't see the Z name-space in the function list.
Also the same question about libimwri.dll. Is this plugin still needed ?
TheFluff
28th March 2017, 00:25
zimg is bundled with VS. core.resize.whatever just calls zimg directly - there are no VS-specific resizers that are based on zimg. There is no more functionality in zimg than what's in core.resize, as far as I know.
Pat357
28th March 2017, 18:46
Thanks, so the Zimg lib plugin is no longer required or even supported.
What about the ImageMagick Writer-Reader ? In the VS documentation it says "in the source tree".
I guess this is also compiled in VS and we don't need a separate plugin for it ? correct ?
Myrsloik
28th March 2017, 18:47
Thanks, so the Zimg lib plugin is no longer required or even supported.
What about the ImageMagick Writer-Reader ? In the VS documentation it says "in the source tree".
I guess this is also compiled in VS and we don't need a separate plugin for it ? correct ?
You still need a separate plugin on windows due to it being huge. And not working as well as I'd like.
Pat357
28th March 2017, 22:55
Any URL to download the current version from libimwri.dll (ImageMagick Writer-Reader for Windows) ?
I found my version somewhere it the tread about it dd 08/06/2016.
It would be a good idea to add an url for libimwri.dll to your "documentation" from VS homepage, just as you did for all other plugins.
Izuchi
3rd April 2017, 14:34
I'd like some assistance regarding how to do fade in/outs. I tried following jackoneill's example (posted 3 years ago) but no luck.
fade_input = # your source here
blank = core.std.BlankClip(clip=fade_input, length=1, color=[255, 128, 128]) # assumes you're working with 8 bit YUV
fade_frames = []
for i in range(fade_input.num_frames):
fade_frames.append(core.std.Merge(clips=[fade_input[i], blank], weight=i/(fade_input.num_frames-1)))
fade_output = core.std.Splice(clips=fade_frames)
While I'm at it, is it possible to implement fade in/out as an in-built function rather than a script?
Myrsloik
3rd April 2017, 14:57
I'd like some assistance regarding how to do fade in/outs. I tried following jackoneill's example (posted 3 years ago) but no luck.
While I'm at it, is it possible to implement fade in/out as an in-built function rather than a script?
"no luck" means what exactly?
Izuchi
3rd April 2017, 15:24
"no luck" means what exactly?
Nevermind, I just found out that the reason why it wasn't working was because the arguments for Merge had changed since jackoneill's initial post three years ago. Everything's now working as it should.
Selur
5th April 2017, 18:43
using:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Loading F:\TestClips&Co\Test-AC3-5.1.avi using LWLibavSource
clip = core.lsmas.LWLibavSource(source="F:/TESTCL~1/TEST-A~1.AVI", format="YUV420P8", cache=0)
# Loading F:\TestClips&Co\Subtitles\ass subtitle\test.ssa using SubText
clip = core.sub.TextFile(clip=clip, file="F:/TestClips&Co/Subtitles/ass subtitle/test.ssa")
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, matrix_s="470bg")
# Output
clip.set_output()
I get:
Error getting the frame number 0:
Resize error 3074: no path between colorspaces
I'm clearly missing something. I thought TextFile would return RGB24 and converting to YUV444P16 should work,..
Selur
5th April 2017, 18:51
Got it,... adding:
clip = core.resize.Point(clip, matrix_in_s="470bg")
before the TextFile call fixes the issue.
Myrsloik
5th April 2017, 18:56
using:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Loading F:\TestClips&Co\Test-AC3-5.1.avi using LWLibavSource
clip = core.lsmas.LWLibavSource(source="F:/TESTCL~1/TEST-A~1.AVI", format="YUV420P8", cache=0)
# Loading F:\TestClips&Co\Subtitles\ass subtitle\test.ssa using SubText
clip = core.sub.TextFile(clip=clip, file="F:/TestClips&Co/Subtitles/ass subtitle/test.ssa")
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, matrix_s="470bg")
# Output
clip.set_output()
I get:
I'm clearly missing something. I thought TextFile would return RGB24 and converting to YUV444P16 should work,..
Can you post the FrameProps output from after LWLibavSource and TextFile?
Selur
5th April 2017, 19:11
Googling, I stumbled over:
IMPORTANT: When using VapourSynth-Viewer you will receive "Resize error 3074: no path between colorspaces" when a YUV video is imported that has an "Unknown" color matrix. Read the "Color Matrix" section for examples of how to manually set a color matrix for a video source.
source: http://www.l33tmeatwad.com/vapoursynth101/video-information
Can you post the FrameProps output from after LWLibavSource and TextFile?
adding 'clip = core.text.FrameProps(clip)' before or after always shows:
Frame properties:
_ChromaLocation: 0
_DurationDen: 25
_DurationNum: 1
_FieldBased: 0
_Matrix:2
_PicType: I
_Primaries: 2
_SARDen: 1
_SARNum: 1
_Transfer: 2
Myrsloik
5th April 2017, 19:14
Googling, I stumbled over:
source: http://www.l33tmeatwad.com/vapoursynth101/video-information
adding 'clip = core.text.FrameProps(clip)' before or after always shows:
Frame properties:
_ChromaLocation: 0
_DurationDen: 25
_DurationNum: 1
_FieldBased: 0
_Matrix:2
_PicType: I
_Primaries: 2
_SARDen: 1
_SARNum: 1
_Transfer: 2
Yes, Matrix:2=unknown. You need to use matrix_in_s as well (or skip matrix_s)
Selur
5th April 2017, 19:19
Matrix:2=unknown
That explains it.
-> Would be nice if the FrameProps filter could use normal strings instead of numbers to indicate the matrix.
Alternatively the documentation should include a mapping between the numbers and the matrices. ;)
Myrsloik
5th April 2017, 19:40
That explains it.
-> Would be nice if the FrameProps filter could use normal strings instead of numbers to indicate the matrix.
Alternatively the documentation should include a mapping between the numbers and the matrices. ;)
I'll probably add that in the next version. Not a bad idea for debugging
sneaker_ger
5th April 2017, 20:06
While we're at it: sub.TextFile() will display "MaskedMerge: Input frames mus have the same range" if supplied with a full range clip to blend. Can get a bit complicated with these error messages not showing the line number.
Selur
6th April 2017, 04:12
Thanks, wouldn't have guessed from the description. :)
stax76
15th April 2017, 15:03
Did anybody find a way to render srt subtitles?
Selur
15th April 2017, 15:16
Last time I checked VSFilterMod works fine with srt subtitles (https://github.com/HomeOfVapourSynthEvolution/VSFilterMod).
stax76
17th April 2017, 12:27
Last time I checked VSFilterMod works fine with srt subtitles (https://github.com/HomeOfVapourSynthEvolution/VSFilterMod).
Great, I added support for it. Single dll supporting both avs and vs make it easier for me. Is there a x64 filter for sup/pgs for avs or vs?
sneaker_ger
17th April 2017, 12:32
VapourSynth comes with sub.ImageFile().
http://www.vapoursynth.com/doc/plugins/subtext.html
For AviSynth there is SupTitle() (https://forum.doom9.org/showthread.php?t=148167) but it is not developed anymore.
I wonder about vsfilter (or any of its forks). It supports PGS over DirectShow but I haven't seen it supporting loading such files using the AviSynth plugin.
Selur
17th April 2017, 13:03
I agree with sneaker, Subtext of Vapoursynth works fine.
SupTitle works fine here for Avisynth only downside is the dependency on .Net 4.
stax76
17th April 2017, 13:14
VapourSynth comes with sub.ImageFile().
http://www.vapoursynth.com/doc/plugins/subtext.html
Great, next staxrip test build support it.
With one sample I get a crash, another sample works fine.
Exception thrown at 0x00000000699C5708 (libsubtext.dll) in StaxRip.exe: 0xC0000005: Access violation writing location 0xFFFFFFFFFFFFFFFC. occurred
I tested staxrip, mpc-be and virtualdubmod, all three x64, all three crash.
MPC and VLC have no problem playing the mkv file rendering the subtitle.
import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin(r"D:\Projekte\VS\VB\StaxRip\bin\Apps\Plugins\both\ffms2\ffms2.dll")
clip = core.ffms2.Source(r"D:\Video\Samples\MKV\PGS.mkv")
clip = core.sub.ImageFile(clip, file = r"D:\Video\Samples\MKV\PGS_temp\PGS.sup")
clip.set_output()
http://www.mediafire.com/file/q0i9hee44c1ds99/1080p__DTS-MA__PGS.mkv
http://www.mediafire.com/file/a91v28aqa2ugmoc/1080p__DTS-MA__PGS_ID3_English.sup
For AviSynth there is SupTitle() (https://forum.doom9.org/showthread.php?t=148167) but it is not developed anymore.
I wonder about vsfilter (or any of its forks). It supports PGS over DirectShow but I haven't seen it supporting loading such files using the AviSynth plugin.
I had tried to use it but something was wrong, I don't remember what it was.
Myrsloik
17th April 2017, 14:35
Try R38-test1 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R38-test1.exe)
r38:
updated zimg
added new constants to clipinfo
fixed several subtext corruption and crash bugs (jackoneill)
added y410 output to avfs and vsvfw
added constants for 12 and 14 bit yuv formats
fixed a one pixel offset error only happening in vertical convolution with a 3 element vector
switched to vs2017 and clang in windows projects
stax76
17th April 2017, 14:54
works nicely :thanks:
l33tmeatwad
19th April 2017, 14:28
So I've been looking through old revisions to see exactly when VapourSynth and VapourSynth Editor stopped playing nice together on OSX and I was able to find the start of the problem. Current versions (VapourSynth r36 & r37) make the preview of VapourSynth editor show up in a shade of blue, however it appears that the first revision after r35, commit 296952b on Oct 21, 2016, makes the preview show up as a shade of yellow.
Selur
19th April 2017, 17:33
Is there an alternative to Interframe/SVP for Vapoursynth (like a SalFPS3 port or something similar) ?
Also stumbled over:
clip = core.std.AssumeFPS(clip, fpsnum=30000, fpsden=1001)
sup = core.mv.Super(clip, pel=2, hpad=0, vpad=0)
bvec = core.mv.Analyse(sup, blksize=16, isb=True, chroma=True, search=3, searchparam=1)
fvec = core.mv.Analyse(sup, blksize=16, isb=False, chroma=True, search=3, searchparam=1)
clip = core.mv.FlowFPS(clip, sup, bvec, fvec, num=60, den=1, mask=2)
#clip = core.mv.BlockFPS(clip, sup, bvec, fvec, num=60, den=1, mask=2)
Problem is I got a clip where there's a fence in the background and I get lots of ugly artifacts in it and I can't any of the algorithms to keep the fence intact. (script is meant for reencoding not live interpolation, so speed doesn't matter that much)
Cu Selur
Ps.: created a separate thread for this issue (https://forum.doom9.org/showthread.php?p=1804460)
Myrsloik
24th April 2017, 19:21
R38-test2 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R38-test2.exe)
r38:
updated to zimg v2.5.1
increased the number of allowed constants in h and v convolution modes to 25
added new constants to clipinfo
fixed several subtext corruption and crash bugs (jackoneill)
added y410 output to avfs and vsvfw
added constants for 12 and 14 bit yuv formats
fixed a one pixel offset error only happening in vertical convolution with a 3 element vector
switched to vs2017 in windows projects
dipje
24th April 2017, 20:08
On the Davinci Resolve site there is a list of supported formats (https://documents.blackmagicdesign.com/DaVinciResolve/20160408-ebf601/DaVinci_Resolve_12.5_Supported_Codec_List.pdf).
I see AVI uncompress RGB 10bit in that list, both saving and reading (under Windows and Mac).
They don't list a FOURCC, but I'm guessing that must be r210? Is it reason enough to try to add RGB30 to the avfs and VfW interfaces in that packing? (*hopeful smile*).
I'm _not_ an active Davinci Resolve user, but the free version is a beast of a video editing and colorgrading application these days, and if it reads 10bit RGB through avfs that would open up the door to feed Vapoursynth scripts into Resolve with something more than 4:2:2 while still having something of deep colour.
I know AVFS supports RGB48 by packing it into b64a which works like butter in After Effects and I use very often, but Resolve doesn't list 16bit RGB in AVI anywhere (not a surprise).
And since your'e on the edge of a release anyway... (*hopeful smile again*)
Myrsloik
24th April 2017, 21:18
On the Davinci Resolve site there is a list of supported formats (https://documents.blackmagicdesign.com/DaVinciResolve/20160408-ebf601/DaVinci_Resolve_12.5_Supported_Codec_List.pdf).
I see AVI uncompress RGB 10bit in that list, both saving and reading (under Windows and Mac).
They don't list a FOURCC, but I'm guessing that must be r210? Is it reason enough to try to add RGB30 to the avfs and VfW interfaces in that packing? (*hopeful smile*).
I'm _not_ an active Davinci Resolve user, but the free version is a beast of a video editing and colorgrading application these days, and if it reads 10bit RGB through avfs that would open up the door to feed Vapoursynth scripts into Resolve with something more than 4:2:2 while still having something of deep colour.
I know AVFS supports RGB48 by packing it into b64a which works like butter in After Effects and I use very often, but Resolve doesn't list 16bit RGB in AVI anywhere (not a surprise).
And since your'e on the edge of a release anyway... (*hopeful smile again*)
I don't mind adding exotic formats as long as someone can verify that they work. Will you do the testing?
dipje
25th April 2017, 09:05
Of course, least i can do.
Vdfiltermod also supports r210 I guess? (Not sure ).
That way I can test if it works in one but not the other or something like that.
Myrsloik
25th April 2017, 11:10
Of course, least i can do.
Vdfiltermod also supports r210 I guess? (Not sure ).
That way I can test if it works in one but not the other or something like that.
R38-test3 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R38-test3.exe)
Only change is untested r210 support. Vdub filtermod doesn't recognize it so go find something that can open it.
shekh
25th April 2017, 12:08
Maybe mount r210 as virtual avi, ffmpeg should open it.
dipje
25th April 2017, 13:27
Well, first test. Mounting a RGB30 Vapoursynth script with avfs actually creates an virtual .avi file now, and VDFilterMod opens it. Lists r210 as codec but also shows rgb48le as the pixel format so it seems to open it with the ffmpeg layer and seems to upscale it to 16bit directly... but it opens and looks ok (no channel shuffling or upside-down stuff or anything).
** Tested a bit more, vdfiltermod seems to indeed reject 'r210' when opening the .vpy directly (tries to find a VfW decoder for it apparently. So it doesn't have a VfW r210 decoder on board).
but mounting the .vpy as avi and opening that works fine but it switches to the ffmpeg input driver for the .avi (so no r210 in VfW, but there is a r210 decoder in ffmpeg as sehkh mentioned).
dipje
25th April 2017, 13:39
Ha! Working fine in Davinci Resolve 14 public beta. Scrubbing is actually quite fast and OK (with a simple lsmash read MTS file, fmtconv spline36 resample to 4:4:4, matrix convert YUV to RGB and change bitdepth / dither to 10bit). Just did a simple test-clip with 100 frames, but it opens fine straight away, place it on a timeline, render the timeline to dnxhd 444 10bit (as test) all works OK.
Joachim Buambeki
28th April 2017, 02:56
Ha! Working fine in Davinci Resolve 14 public beta.
Wait, what?
Does this mean there is an OFX plugin that enables users to run Vapoursynth filters inside Resolve?
If yes, where can I get it and how do I make it work?
I can do testing in Resolve Studio under OSX if someone can guide me through the initial setup.
dipje
28th April 2017, 09:41
No, it means you can frameserver the output of a RGB 10bit Vapoursynth script directly into Resolve.
If you actually want to work on it 'live' is another question, but quick grading and fixes and using Resolve's export module to save it into a format of your choosing is possible.
Jamaika
28th April 2017, 09:58
Short question: What colormatrix can be used in the R210 codec? Can I use HDR?
I once installed free the R210 Blackmagic codecs and I had the illusion that without the BlackMagic graphics card I can't support correct the codecs.
dipje
28th April 2017, 10:24
It's RGB.. the way I see it there is no 'colormatrix' then, that's only for YUV files. Maybe an RGB colorprofile / ICC-profile but that is something you should override in whatever application you use to read the file, I'm pretty sure AVI can't store ICC profiles for RGB data somewhere :).
Jamaika
28th April 2017, 11:27
It's RGB.. the way I see it there is no 'colormatrix' then, that's only for YUV files.
I don't believe it is RGB. Image with FFmpeg:
Video AVI RGB24:
http://i63.tinypic.com/24zhi87.png
Video AVI R210:
http://i63.tinypic.com/minbex.png
dipje
28th April 2017, 13:54
R210 is RGB 10bit. https://wiki.multimedia.cx/index.php/R210. 10 bits R, 10 bits G, 10 bits B, 2 bits padding.
There can still be a thing such as 'broadcast safe levels' and full range (like I said, RGB can have things as color profiles, but that has nothing to do with the codec, more with the what your program interprets the RGB values as), even in RGB. Doesn't change the fact that R210 is a RGB packing method.. that's the whole thing I asked.. 'Can you pack vs.RGB30 as R210 in the VfW interface'.
Anyway, I don't install any Blackmagic codecs anyway. Don't see why anyone would. Maybe you can configure the codec (or the encoder that created the clip) to use full range or not. In Davinci Resolve you can click the clip properties in your Media Bin to change the interpretation of the levels.
Jamaika
28th April 2017, 14:11
In Davinci Resolve you can click the clip properties in your Media Bin to change the interpretation of the levels.
Thanks for the answer. I can't change the interpretation of the levels in Sony Vegas 14 or VirtualDub. So theme about the R210 codec I throw in the trash. For me it is the sRGB is equal to only bt709.
Joachim Buambeki
28th April 2017, 23:22
No, it means you can frameserver the output of a RGB 10bit Vapoursynth script directly into Resolve.
If you actually want to work on it 'live' is another question, but quick grading and fixes and using Resolve's export module to save it into a format of your choosing is possible.
Ok, got it, thanks.
When you say 10bit, this means a ProRes444 file (which is 12bit) is piped in reduced quality into Resolve - is there a way to feed it to Resolve in a way no quality is lost (meaning in 16bit, 32bit or whatever Resolve internally uses)?
I asked for an OFX plugin a (short) while ago (https://forum.doom9.org/showthread.php?p=1652788&highlight=resolve#post1652788) but it seems Myrsloik missed my second post. I still believe such a plugin (if technically possible) that runs VS code would be great to lift VS more into the professional realm and I assume many professionals would be very happy to this in their toolkit. If communicated right, I am sure some of them will be willing to donate to make this happen.
TIA!
dipje
29th April 2017, 08:04
Replying in pm as I think we're moving away from vapoursynth stuff
Myrsloik
29th April 2017, 10:53
Ok, got it, thanks.
When you say 10bit, this means a ProRes444 file (which is 12bit) is piped in reduced quality into Resolve - is there a way to feed it to Resolve in a way no quality is lost (meaning in 16bit, 32bit or whatever Resolve internally uses)?
I asked for an OFX plugin a (short) while ago (https://forum.doom9.org/showthread.php?p=1652788&highlight=resolve#post1652788) but it seems Myrsloik missed my second post. I still believe such a plugin (if technically possible) that runs VS code would be great to lift VS more into the professional realm and I assume many professionals would be very happy to this in their toolkit. If communicated right, I am sure some of them will be willing to donate to make this happen.
TIA!
Sigh, enterprise apis... That mess looks like it'd take at least a month to understand. How you even imagine the integration to work well is also a mystery.
using portable R37 64bit with:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="G:/Hybrid/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Loading F:\TestClips&Co\test.avi using LWLibavSource
clip = core.lsmas.LWLibavSource(source="F:/TESTCL~1/test.avi", format="YUV420P8", cache=0)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg")
# making sure input color range is set to TV (16-235) scale.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
original = clip
# dualView True
# vsPreview True
# cropping the video to 600x312
clip = core.std.CropRel(clip=clip, left=40, right=0, top=40, bottom=0)
# cropping the video to 600x312
original = core.std.CropRel(clip=original, left=40, right=0, top=40, bottom=0)
# clip resizing to 960x500
#clip = core.fmtc.resample(clip=clip, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
# original resizing to 960x500
#original = core.fmtc.resample(clip=original, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
original = core.sub.Subtitle(clip=original, text="Original")
clip= core.sub.Subtitle(clip=clip, text="Filtered")
stacked = core.std.StackHorizontal([original,clip])
# Output
stacked.set_output()
and
VSPipe.exe --y4m h:\Temp\tempPreviewVapoursynthFile11_03_52_922.vpy - | g:\Hybrid\mplayer.exe -
vspipe crashes for me and I don't see why.
Removing:
# clip resizing to 960x500
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
# original resizing to 960x500
original = core.fmtc.resample(clip=original, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
from the script and I get no crash.
=> Does anyone see what I do wrong? (using 'clip.set_output()' or 'original.set_output()' the script doesn't crash either)
Leaving out the cropping doesn't change anything, so this seems to be related to fmtc.
Using:
# clip resizing to 960x500
clip = core.resize.Spline16(clip, width=960, height=500)
# original resizing to 960x500
original = core.resize.Spline16(original, width=960, height=500)
instead of:
# clip resizing to 960x500
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
# original resizing to 960x500
original = core.fmtc.resample(clip=original, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
also fixes the problem.
=> seems like there is a problem with fmtc when used multiple times inside a script. (I'm using fmtconv r20 from https://github.com/EleonoreMizo/fmtconv/releases)
I use fmtc a lot of times in most scripts, no problem there :). Proves that no two scripts are ever the same :P
sneaker_ger
1st May 2017, 12:21
=> seems like there is a problem with fmtc when used multiple times inside a script.
How did you arrive at that conclusion?
When I use:
# clip resizing to 960x500
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
# original resizing to 960x500
original = core.fmtc.resample(clip=original, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
stacked = core.std.StackHorizontal([original,clip])
# Output
stacked.set_output()
the problem occurs.
When I use:
# clip resizing to 960x500
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
# original resizing to 960x500
original = core.fmtc.resample(clip=original, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
stacked = core.std.StackHorizontal([original,clip])
# Output
original.set_output()
or
# clip resizing to 960x500
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
# original resizing to 960x500
original = core.fmtc.resample(clip=original, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
stacked = core.std.StackHorizontal([original,clip])
# Output
clip.set_output()
or just
stacked = core.std.StackHorizontal([original,clip])
the problem doesn't occur.
So it seemed to me that the problem only occurred when I used two fmtc calls, like I did with:
# clip resizing to 960x500
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
# original resizing to 960x500
original = core.fmtc.resample(clip=original, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
If you got another explanation for it please share. :)
Can someone aside from me reproduce the issue?
(just to be sure this isn't somehow related to my setup)
Minimal example would be:
clip = core.lsmas.LWLibavSource(source="F:/TESTCL~1/TEST-A~1.AVI", format="YUV420P8", cache=0) # source and source filter don't matter, tried different sources and source filters
original = clip # copying current clip state to original
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=960, h=720, interlaced=False, interlacedd=False) # resizing clip
original = core.fmtc.resample(clip=original, kernel="spline16", w=960, h=720, interlaced=False, interlacedd=False) # resizing clip
stacked = core.std.StackHorizontal([original,clip]) # stacking
stacked.set_output() # return
Cu Selur
sneaker_ger
1st May 2017, 14:29
No crash here. (R37 x64 on Windows 7, i5-2500K, fmtconv r20)
sneaker_ger
1st May 2017, 14:42
I just got crashes immediately after upgrading to R38 test2. Then it worked after a few tries. :confused:
/edit:
Then crashes again. Kinda random. No idea what's going on. Just doing vspipe - script.vpy > NUL
Still using R37 so that isn't it. But since it works for you it might be something with my setup. (R37 64bit, on Win 10 pro, Ryzen 7 1800x, fmtconv r20)
What's the resolution of your avi file?
640x352 (this is one of my test samples which I have converted hundreds of times; https://drive.google.com/drive/folders/0B_WxUS1XGCPASUZibG5XZkRfeTg -> test.avi)
Does it still crash if you simply use core.std.BlankClip(width=1920, height=1080, format=vs.YUV420P8) as the source clip?
Yes
Does it still crash if you specify cpuopt=0 in both fmtc.resample()?
Yes
----
downloaded:
https://www.python.org/ftp/python/3.6.1/python-3.6.1-embed-amd64.zip
and
https://github.com/vapoursynth/vapoursynth/releases/download/R37/VapourSynth64-Portable-R37.7z
extracted both into one folder
called:
VSPipe.exe c:\Users\Selur\Desktop\Test.vpy - | ffplay.exe -
vspipe still crashing.
copied the files to my laptop, got the same crash. :( (Both run Win10 latest updates; laptop is an i7, main system is a Ryzen 7 1800x)
---
replacing:
original = core.fmtc.resample(clip=original, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
with
original = clip
and thus not using fmtc two files also 'fixes' the issue. :(
RAM usage of vspip is ~870MB upon the crash.
Cu Selur
Copied the whole thing into a Win 8.1 64bit VM and there the script worked as it should. No problem.
-> HolyWu what OS are you on? Could this be a problem thanks to Windows 10 Creators Update?
replacing:
clip = core.lsmas.LWLibavSource(source="F:/TESTCL~1/test.avi", format="YUV420P8", cache=0)
original = clip
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
original = core.fmtc.resample(clip=original, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
with:
clip = core.lsmas.LWLibavSource(source="F:/TESTCL~1/test.avi", format="YUV420P8", cache=0)
original = core.lsmas.LWLibavSource(source="F:/TESTCL~1/test.avi", format="YUV420P8", cache=0)
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
original = core.fmtc.resample(clip=original, kernel="spline16", w=960, h=500, interlaced=False, interlacedd=False)
doesn't help either,...
Since the core resizer only covers Bicubic/Point/Lanczos/Spline16/Spline36, but I sometimes like gauss more I normally stick with fmtconv. (I also like to have the option to use the other resizers offered by fmtconv.)
Strange thing that I get the crash each time (on both my i7 and my Ryzen system) and you only very seldom and random.
Tested it. Still crashing here. :(
Correction: New version does fix the crash for me too. :D
(somehow overlooked that Win10 asked whether the file should be overwritten and tested the old version again before. :))
Cu Selur
Pat357
2nd May 2017, 22:31
Thanks to all who contributed to finding and solving my crash problem with fmtconv. I could not use something like mawen1250's "nnedi3_resample.py" script because of the frequent crashes.
This script is also used in HAvsFunc.
For somewhat around 6 months I have been pulling my hair because of the frequent/random crashes with such scripts.
I've always thougt it must be my system because no-one else seemed to have this problem -;)
With the recompiled version, all crashes all gone !!
I've tried to recompile fmtc myself on MINGW64/MSYS2, but I got an error in Interlocked.hpp :
config.status: creating Makefile
config.status: executing depfiles commands
config.status: executing libtool commands
CXX ../../src/main.lo
CXX ../../src/fmtc/Bitdepth.lo
In file included from ./../../src/conc/Interlocked.h:132:0,
from ./../../src/conc/AtomicPtr.hpp:27,
from ./../../src/conc/AtomicPtr.h:117,
from ./../../src/conc/CellPool.h:30,
from ./../../src/conc/ObjPool.h:44,
from ../../src/fmtc/Bitdepth.h:30,
from ../../src/main.cpp:18:
./../../src/conc/Interlocked.hpp: In static member function 'static void conc::Interlocked::cas(conc::Interlocked::Data128&, volatile Data128&, const Data128&, const Data128&)':
./../../src/conc/Interlocked.hpp:349:2: error: '::InterlockedCompareExchange128' has not been declared
::InterlockedCompareExchange128 (
^~
In file included from ./../../src/conc/Interlocked.h:132:0,
from ./../../src/conc/AtomicPtr.hpp:27,
from ./../../src/conc/AtomicPtr.h:117,
from ./../../src/conc/CellPool.h:30,
from ./../../src/conc/ObjPool.h:44,
from ./../../src/fmtc/Bitdepth.h:30,
from ../../src/fmtc/Bitdepth.cpp:28:
./../../src/conc/Interlocked.hpp: In static member function 'static void conc::Interlocked::cas(conc::Interlocked::Data128&, volatile Data128&, const Data128&, const Data128&)':
./../../src/conc/Interlocked.hpp:349:2: error: '::InterlockedCompareExchange128' has not been declared
::InterlockedCompareExchange128 (
^~
./../../src/conc/Interlocked.hpp:351:4: error: 'excg_hi' was not declared in this scope
excg_hi,
^~~~~~~
./../../src/conc/Interlocked.hpp:351:4: error: 'excg_hi' was not declared in this scope
excg_hi,
^~~~~~~
./../../src/conc/Interlocked.hpp:352:4: error: 'excg_lo' was not declared in this scope
excg_lo,
^~~~~~~
./../../src/conc/Interlocked.hpp:352:4: error: 'excg_lo' was not declared in this scope
excg_lo,
^~~~~~~
I used :
cd build/unix
./autogen.sh
./configure --prefix=/local64 --{build,host,target}=x86_64-w64-mingw32
make -j4
Anyone an idea to fix this ?
jackoneill
3rd May 2017, 11:21
Probably delete https://github.com/EleonoreMizo/fmtconv/blob/394a360eace1a26d8c43c8e68a772e0018bab612/src/conc/Interlocked.hpp#L349-L354
and replace with https://github.com/EleonoreMizo/fmtconv/blob/394a360eace1a26d8c43c8e68a772e0018bab612/src/conc/Interlocked.hpp#L360
Also open an issue.
Pat357
3rd May 2017, 16:12
Thanks a lot !
Yup, that was the first stopper...
Now I got :
CXX ../../src/fmtcl/TransOpErimm.lo
CXX ../../src/fmtcl/TransOpFilmStream.lo
CXX ../../src/fmtcl/TransOpLinPow.lo
CXX ../../src/fmtcl/TransOpLogC.lo
CXX ../../src/fmtcl/TransOpLogTrunc.lo
CXX ../../src/fmtcl/TransOpPow.lo
CXX ../../src/fmtcl/TransOpSLog.lo
CXX ../../src/fmtcl/TransOpSLog3.lo
CXX ../../src/fmtcl/VoidAndCluster.lo
CXX ../../src/fstb/CpuId.lo
CXX ../../src/fstb/fnc.lo
{standard input}: Assembler messages:
{standard input}:46: Error: unsupported instruction `mov'
{standard input}:96: Error: unsupported instruction `mov'
{standard input}:113: Error: unsupported instruction `mov'
{standard input}:125: Error: unsupported instruction `mov'
{standard input}:161: Error: unsupported instruction `mov'
make: *** [Makefile:1084: ../../src/fstb/CpuId.lo] Error 1
make: *** Waiting for unfinished jobs..
Further ideas ? (probably has to do with '' around the mov instruction)
jackoneill
3rd May 2017, 16:47
Maybe this works: https://dpaste.de/sVR3
Pat357
3rd May 2017, 20:30
Yep, compiling is now without errors.
But : the generated .DLL is unfortunately not working :
- as long as I use "VSPIPE -i ", everything seems to be ok. No errors and the clip properties are correct (I'm using fmtc for scaling & bitdepth conversion).
- if I try to feed the stream to ffplay, mplayer or MPV, it looks like no frames are produced. FFplay sits there but no errors or no window for playing is opened.
- VSPIPE -p behaviours the same as the players : no errors and the progress counter doesn't even start. No crashes neither.
Did you ever compile it yourself ?
jackoneill
3rd May 2017, 20:48
Yep, compiling is now without errors.
But : the generated .DLL is unfortunately not working :
- as long as I use "VSPIPE -i ", everything seems to be ok. No errors and the clip properties are correct (I'm using fmtc for scaling).
- if I try to feed the stream to ffplay, mplayer or MPV, it looks like no frames are produced. FFplay sits there but no errors or no window for playing is opened.
- VSPIPE -p behaviours the same as the players : no errors and the progress counter doesn't even start. No crashes neither.
Did you ever compile it yourself ?
I did, but only in Linux.
It sounds like there is a deadlock. Do you have avstp.dll someplace where it might be found, like in System32 or the same folder as libfmtconv.dll?
Pat357
3rd May 2017, 21:05
I did, but only in Linux.
It sounds like there is a deadlock. Do you have avstp.dll someplace where it might be found, like in System32 or the same folder as libfmtconv.dll?
No avstp.dll anywhere in my path or in VS-plugin directories.
Would it also work in VS ?
I used it before in AVS but I found increasing #threads in Set's AVS 2.6 MT more stable then this plug-in.
jackoneill
4th May 2017, 15:49
No avstp.dll anywhere in my path or in VS-plugin directories.
Would it also work in VS ?
I used it before in AVS but I found increasing #threads in Set's AVS 2.6 MT more stable then this plug-in.
Maybe it would work. I think the code for it is there, at least. And you really should open a new issue or two at https://github.com/EleonoreMizo/fmtconv/issues.
Pat357
4th May 2017, 17:20
Maybe it would work. I think the code for it is there, at least. And you really should open a new issue or two at https://github.com/EleonoreMizo/fmtconv/issues.
I'll open 3 (2 + found another today) issues, but since development slowed down or even stopped, there is no hurry doing so; I'll do it tomorrow or the day after.
clip = core.std.BlankClip(width=1920, height=1080, fpsnum=24000 ,fpsden=1001, color=[255,128,128], format=vs.YUV420P8)
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=960, h=720, interlaced=False, interlacedd=False, cpuopt=0)
clip=core.resize.Point(clip=clip, format=vs.YUV420P8)
clip.set_output()
This will return a green clip if cpuopt=0 and a white clip if cpuopt=1 or anything but 0.
If I add this right before the fmtc line :
clip=core.resize.Point(clip=clip, format=vs.YUV420P16)
you get a white clip in both cases. It seems if cpuopt=0, the 8bit data is not converted to 16 bit first, maybe it's even the way it's supposed to work and you need 16b (using fmtc.bitdepth) before using fmtc.resample !
BTW, how do I create a Blank or colored clip with >8 bits data ?
I've tried
clip = core.std.BlankClip(width=1920, height=1080, fpsnum=24000 ,fpsden=1001, color=[255,128,128], format=vs.YUV420P16)
clip = core.std.BlankClip(width=1920, height=1080, fpsnum=24000 ,fpsden=1001, color=[1,0.5,0.5], format=vs.YUV420P16)
the documentation points to using float, like I did in the second case..like Luma is ~0-1 U and V are ~ -0.5-+0.5
I hope it is not implemented in a way that you need to double the values for each extra bit >8 .... This would be confusing and non-practical.
Myrsloik
4th May 2017, 17:21
I'll open 3 (2 + found another today) issues, but since development slowed down or even stopped, there is no hurry doing so; I'll do it tomorrow or the day after.
clip = core.std.BlankClip(width=1920, height=1080, fpsnum=24000 ,fpsden=1001, color=[255,128,128], format=vs.YUV420P8)
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=960, h=720, interlaced=False, interlacedd=False, cpuopt=0)
clip=core.resize.Point(clip=clip, format=vs.YUV420P8)
clip.set_output()
This will return a green clip if cpuopt=0 and a white clip if cpuopt=1 or anything but 0.
If I add this right before the fmtc line :
clip=core.resize.Point(clip=clip, format=vs.YUV420P16)
you get a white clip in both cases. It seems if cpuopt=0, the 8bit data is not converted to 16 bit first, maybe it's even the way it's supposed to work and you need 16b (using fmtc.bitdepth) before using fmtc.resample !
BTW, how do I create a Blank or colored clip with >8 bits data ?
I've tried
clip = core.std.BlankClip(width=1920, height=1080, fpsnum=24000 ,fpsden=1001, color=[255,128,128], format=vs.YUV420P16)
clip = core.std.BlankClip(width=1920, height=1080, fpsnum=24000 ,fpsden=1001, color=[1,0.5,0.5], format=vs.YUV420P16)
the documentation points to using float, like I did in the second case..like Luma is ~0-1 U and V are ~ -0.5-+0.5
I hope it is not implemented in a way that you need to double the values for each extra bit >8 .... This would be confusing and non-practical.
It uses the supplied value directly. Floats are rounded to int for int formats. It's implemented that way so you can easily have exact values for testing.
Something else where I'm thinking "let's just ask, who knows....":
Is there a way to _separate_ high frequency content from the mid to low frequency content?
Commercial noise-reduction programs/plugins have (sometimes.. a lot?) a preview-mode where they display the luminance channel at the same time, 3 times: high freq, mid freq, low freq. It helps (me at least) a lot in dialing in noise reduction or sharpening plugins by better seeing what is happening in certain areas. Is it possible to do this splitting so I can tweak around with it in Vapoursynth Editor to take a look at just the high-freq or low-freq stuff. Splitting the luminance and chroma channels is easy enough.
Also, on a related note, can someone give me a small example how I would go about to blending two clips with a certain opacity? Like, I want the original image, but overlay 30% of a cleaned-image on top of that. Can that be done with the generic Vapoursynth stuff?
Myrsloik
5th May 2017, 13:37
Something else where I'm thinking "let's just ask, who knows....":
Is there a way to _separate_ high frequency content from the mid to low frequency content?
Commercial noise-reduction programs/plugins have (sometimes.. a lot?) a preview-mode where they display the luminance channel at the same time, 3 times: high freq, mid freq, low freq. It helps (me at least) a lot in dialing in noise reduction or sharpening plugins by better seeing what is happening in certain areas. Is it possible to do this splitting so I can tweak around with it in Vapoursynth Editor to take a look at just the high-freq or low-freq stuff. Splitting the luminance and chroma channels is easy enough.
Also, on a related note, can someone give me a small example how I would go about to blending two clips with a certain opacity? Like, I want the original image, but overlay 30% of a cleaned-image on top of that. Can that be done with the generic Vapoursynth stuff?
misc.AverageFrames([clipa, clipb], [10, 3], scale=1/10) (or scale=1/13 depending on how you want it)
For the frequency stuff you can simply use normal convolutions if you don't need speed or something spectacular. [-1 -1 -1 -1 8 -1 -1 -1 -1] <- highpass filter, make it all ones and you have a lowpass filter.
Or describe more exactly what you want.
I guess a highpass and/or lowpass is what I want yeah.. maybe some Levels tweaking to get the stuff visible but that is something 'done to taste'.
Only way for me to describe it better is by a screenshot: https://snag.gy/ym2UzE.jpg. But highpass / lowpass can help a lot already.
Found docs of AverageFrames in the github. Not on your site yet :P.
Hmm.. 'scale must be a positive number' as an error message, I get whenever I have a scale of less than 0.5. scale = 1/10 or cale = 1/13 both give less than 0.5 :).
Can I just keep 'scale = 1.0' and then change the weights around between 0.0 and 1.0... as long as both of my weights are a total of 1.0?
weight a = 0.0, weight b = 1.0 means get only 'clip b'.
weight a = 1.0, weight b = 0.0 means get only 'clip a'.
weight a = 0.5, weight b = 0.5 means get perfect blend between the two.
So then I can start shifting the weights to '0.4 and 0.6' or '0.7 and 0.3' depending on how much I want of which clip.. am I right in thinking like this?
edit: Took a look at the source of AverageFrames.
It seems 'weights' are integers and 'scale' as well, while the documentation lists them both as floats.
Also, the docs say that after multiplying by the weights + summing, the results is multiplied by the scale. Looking at the source it seems it's divided by the scale (which would make the integers much better to understand and work with :P).
So weight a = 70, weight b = 30, scale = 100 seems to give me 'a little bit of b' what I'm looking for.
Myrsloik
5th May 2017, 15:07
Found docs of AverageFrames in the github. Not on your site yet :P.
Hmm.. 'scale must be a positive number' as an error message, I get whenever I have a scale of less than 0.5. scale = 1/10 or cale = 1/13 both give less than 0.5 :).
Can I just keep 'scale = 1.0' and then change the weights around between 0.0 and 1.0... as long as both of my weights are a total of 1.0?
weight a = 0.0, weight b = 1.0 means get only 'clip b'.
weight a = 1.0, weight b = 0.0 means get only 'clip a'.
weight a = 0.5, weight b = 0.5 means get perfect blend between the two.
So then I can start shifting the weights to '0.4 and 0.6' or '0.7 and 0.3' depending on how much I want of which clip.. am I right in thinking like this?
No, you can't. Integer weights for integer clips. Floats get rounded.
Ooops, scale should be 10 or 13. It's the integer to divide by. I should double check this stuff and fix the documentation...
Joachim Buambeki
5th May 2017, 15:37
I can't comment on how to do frequency separation in VS but I can vouch for it to be extremely useful for (very) high resolution video denoising and am wondering why this hasn't been implemented in any noise removal scripts (or has it)?
I just use it to finetune the settings. I split my yuv into 3 separate channels, then one by one I use this convolution trick to really show the fine detail noise. Things like compression artifacts, blockiness, lines, etc.. In playing with the convolution stuff (and to enhance it's effect a bit or make it better to view) I switched to the 5x5 convolution and then play with the divisor value (values >= 0 <= 1.0) to get something that highlights the artifacts.
Then I place knlmeanscl before it and tweak the strength parameter there till the artifacts are gone. I do that separately for all 3 channels (although most of the time my U + V channels end up being pretty close / the same). I merge the 3 clips back into a single YUV clip and view it. If I think it looks 'too strongly denoised' I use the averageframeS() thing to blend it with the original till I get something that doesn't loose (too much) detail.
Deband everything slightly with f3kdb to 10bits / 12bits (depending on the project) which will add some dithering noise back in but I lost a lot of banding and compression artifacts of 'weaker codecs'. Render the stuff to a DPX sequence or something else used by colour programs and the clip can go into grading.
I guess a highpass and/or lowpass is what I want yeah.. maybe some Levels tweaking to get the stuff visible but that is something 'done to taste'.
Only way for me to describe it better is by a screenshot: https://snag.gy/ym2UzE.jpg. But highpass / lowpass can help a lot already.
It seems the same Frequency separation described in this article for gimp
https://pixls.us/articles/skin-retouching-with-wavelet-decompose/
We need "grain extract" and "grain merge"
https://docs.gimp.org/2.9/en/gimp-concepts-layer-modes.html
grain_extract=core.std.Expr(clips=[lower layer,upper layer], expr=[" x y - 128 + "])
grain_merge=core.std.Expr(clips=[lower layer,upper layer], expr=[" x y + 128 - "])
c
low_frequency=core.std.Convolution(c,matrix=[1, 1, 1, 1, 1, 1, 1, 1, 1])
high_frequency=core.std.Expr(clips=[c,low_frequency], expr=[" x y - 128 + "])
f=core.std.Expr(clips=[low_frequency,high_frequency], expr=[" x y + 128 - "])
Joachim Buambeki
5th May 2017, 19:59
What would be an approximation of the mid frequency? According to my experience, you can be increasingly more aggressive with the (temporal) denoising, the lower your frequency is (with the odd exceptions).
@Age, Thanks for the input!
I tweaked it a bit though. Well.. I'm working in 16bit so the '128' in your example I changed to 32768. And the simple 3x3 convolution I replaced with a 5x5 gaussian blur kernel.
After splitting the image into 'hfreq' and 'lfreq' this way, I split 'hfreq' into separate y, u and v. I apply KNLMeansCL do on of the planes, afterwards I boost the contrast quite a bit (on the hfreq ones at least) by using std.Limiter / std.Levels. This way I can really see the high-freq filth in the image. I increase KNLMeansCL's strength bit by bit until it look good. I repeat the process for the u and v planes, which normally can do with less strength on knlmeanscl. I combine the y, u and v clips back into 'hfreq', then to the exact same with the lfreq clip (split into y,u,v, tweak knlmeans with a contrast boost, turn off the contrast boost and combine them back into one 'lfreq' clip). I actually finalized on less strength and less of a search window on the low frequency content (Since I'm more working on compression artifacts and banding issues and such, not the noise of the image itself).
Then use your last 'f' line to combine my lfreq and hfreq back into a single clip, use ContraSharpening against the original, f3kdb with slight settings to dither down to 10bit and presto.
WolframRhodium
6th May 2017, 06:30
If you are using something like
Expr([clipa, clipb], ['x y + 128 -'])
why don't you simply use MergeDiff:
MergeDiff(clipa, clipb)
?
On the same note, why note change
high_frequency=core.std.Expr(clips=[c,low_frequency], expr=[" x y - 128 + "])
into
high_frequency = core.std.MakeDiff(c, low_frequency)
Is std.Expr faster or something?
On the same note, is there a reason to use the whole misc.AverageFrames thing instead of core.std.Merge if I only have two clips?
Yes it's the same as
lfreq=core.std.Convolution(c,matrix=[1, 1, 1, 1, 1, 1, 1, 1, 1])
hfreq=core.std.MakeDiff(clipa=c, clipb=lfreq)
c=core.std.MergeDiff(clipa=lfreq,clipb=hfreq)
:-)
jackoneill
6th May 2017, 11:18
Is std.Expr faster or something?
For 8 bit input Expr should be slower than MakeDiff and MergeDiff. Expr always calculates everything with 32 bit floats. MakeDiff and MergeDiff have code optimised specifically for 8 bit input.
For other bit depths, Expr could be faster than MakeDiff and MergeDiff, because it processes four pixels at a time.
I think I would use std.Expr a lot more if I could wrap my head around the notation :).
@Age, Thanks for the input!
I tweaked it a bit though. Well.. I'm working in 16bit so the '128' in your example I changed to 32768. And the simple 3x3 convolution I replaced with a 5x5 gaussian blur kernel.
After splitting the image into 'hfreq' and 'lfreq' this way, I split 'hfreq' into separate y, u and v. I apply KNLMeansCL do on of the planes, afterwards I boost the contrast quite a bit (on the hfreq ones at least) by using std.Limiter / std.Levels. This way I can really see the high-freq filth in the image. I increase KNLMeansCL's strength bit by bit until it look good. I repeat the process for the u and v planes, which normally can do with less strength on knlmeanscl. I combine the y, u and v clips back into 'hfreq', then to the exact same with the lfreq clip (split into y,u,v, tweak knlmeans with a contrast boost, turn off the contrast boost and combine them back into one 'lfreq' clip). I actually finalized on less strength and less of a search window on the low frequency content (Since I'm more working on compression artifacts and banding issues and such, not the noise of the image itself).
Then use your last 'f' line to combine my lfreq and hfreq back into a single clip, use ContraSharpening against the original, f3kdb with slight settings to dither down to 10bit and presto.
You can first split the image in grayscale and color in the same way but i don't now if it is better than yuv
#input is rgb48
c=clip
r=core.std.ShufflePlanes(clips=c, planes=[0], colorfamily=vs.GRAY)
g=core.std.ShufflePlanes(clips=c, planes=[0], colorfamily=vs.GRAY)
b=core.std.ShufflePlanes(clips=c, planes=[0], colorfamily=vs.GRAY)
gray=core.std.Expr(clips=[r,g,b], expr=[" x y + z + 3 / "])
#gray=denoise or frequency separation
gray=core.std.ShufflePlanes(clips=c, planes=[0,0,0], colorfamily=vs.RGB)
color=core.std.Expr(clips=[c,gray], expr=[" x y - 32896 + "])
#color=denoise or frequency separation
c=core.std.Expr(clips=[gray,color], expr=[" x y + 32896 - "])
gray
http://i.imgur.com/WSli60E.jpg
color
http://i.imgur.com/6MnrusC.jpg
recombine
http://i.imgur.com/eyhgBHb.jpg
you there do 'grayscale' by taking the average of rgb.
Since I'm almost always starting from YUV videos, I think I have something closer to 'luminance' any time than the average of RGB, which I don't call true luminance data, but quick-n-dirty grayscale.
And I actually do tweak the u and v channels separately. On of my older camera's produces way more chroma noise in the reds/greens for instance.
Mystery Keeper
6th May 2017, 15:54
On of my older camera's produces way more chroma noise in the reds/greens for instance.Thats strange. Camera matrices tend to have two green sensors per pixel, so usually they produce more red and blue noise and less green.
it's video mode, so it depends more on whatever the engine in the camera is doing, not what the actual photo cells measure :). The older sony engines just don't dare to touch any reds in noise reduction , maybe to leave some color in the skins or to prevent waxy looking faces or something. In the end they don't remove any red chroma noise at all it seems. In the shadows (if the shot is high iso) it can be pretty ugly, specially with the older AVCHD +/ 24mbps encoders in those files.
Aanyway, if the file is YUV in and I encode yuv-out I prefer to keep it yuv all the way if I can.
I'll have a try splitting it through RGB though, I believe Topaz Denoise 6 plugin does something like that (you can preview luma and you can preview 'color', and there you get a blue/red mixture without any green. Kinda weird, but helps in tweaking chroma noise.. other trick I know of is setting really high luma-only noise reduction to make the chroma noise stand out). Although I don't think I'll use it often it's nice to experiment and add it to the back of tricks.
In a related note, I don't think KNLMeansCL can run on two planes at once? I believe it's either Y, YUV or RGB, but I can't let it run on 'UV' in once pass. So maybe doing the gray/color thing in RGB means I can get away with one KNLMeansc all for gray and one for color, while otherwise it'll be 3 calls for Y, U and V. It all depends on how much slower the RGB-pass is for the 'color' clip vs two separate calls on a grayscale clip (u and v processed separately)
hydra3333
7th May 2017, 02:15
Hello. Re new very fast CUDA based filters :-
1. Sure, I'll add them.
2. You don't, write native stuff. Or recompile only avscompat.dll on your own. All you need is vs2017 community which is free.
Thanks!
Adding to post https://forum.doom9.org/showthread.php?p=1801677#post1801677 seeking to update the filter list into Vapoursynth so that VS can successfully seek and return the right number of frames forward/back, I gather that this is the latest list
filter name, frames (forward and back, or current frame) they need as input to produce one frame of output
DGSource(): current only
DGDenoise(): current only
DGSharpen(): current only
DGTelecide(): always previous + current
DGDecimate(): up to (cycle size + 2) number of previous + current
DGBob(): always previous + current + next (or, n-2,n-1,n,n+1,n+2 for double framerate ?)
( DGbob is a new gpu accelerated deinterlacer based on yadifmod2 http://rationalqm.us/board/viewtopic.php?f=14&t=559&start=180#p6701 )
A question, if I got it wrong (eg say dgbob was = current frame only) does it matter if previous,current,next is specified ?
Also, given
DGDecimate(clip c, int cycle, int device, bool show)
DGDecimate() is a fast stand-alone CUDA filter that implements 1-in-M frame decimation. The input clip must be in the YV12 format.
cycle: int value (default: 5)
Decimation cycle size M. For every set of M frames, the frame that differs least from its preceding frame is removed.
what are the "right" numbers to specify for DGDecimate ? an arbitrary 10 + 10 ?
hydra3333
7th May 2017, 07:53
It has been suggested that a script at run time cannot tell the Vapoursynth core at its compile time what the cycle size is going to be, and if Vapoursynth always assumes some maximum it is going to over-request frames.
I suppose an arbitrary large default number of frames may have to do for DGDecimate and it will need to over-request frames.
May I make an incremental improvement suggestion for a future release ?
Not sure if this would be possible or not ... wouldn't it be nice if values were configurable at script startup from a vapoursynth-provided .ini text file of defaults in the vapoursynth folder (with a default .ini file provided with vapoursynth) ... and then a new vapoursynth function available to over-ride at run-time with parameters along the lines of itll_needs_frames("function_name", number_before, number after).
Into the future, one may imagine all sorts of fantastic new filters popping up which may need more than current-frame and indeed may need an arbitrary number of past and future frames. There's some talk of a gpu accelerated QTGMC equivalent (thus fast by comparison to cpu based QTGMC) ... wouldn't that be amazing ?
hydra3333
7th May 2017, 08:14
2. You don't, write native stuff. Or recompile only avscompat.dll on your own. All you need is vs2017 community which is free.
Beaut, thanks.
OK "vs2017 community" to recompile only a "portable" avscompat.dll on my own ... now I'm off to look up how to do that for x64 :) and then plonk a replacement AvsCompat.dll under
Vapoursynth\vapoursynth64\coreplugins
OK, I did download an install vs2017 ... and didn't like what it did to my PC, it wouldn't hibernate any more and there appeared to be lots of new bloat junk running in the background - so I rolled back to a system image taken just before the vs2017 install. I wonder if I can find an old win8 licensed VM and try it in there. Having said that, wouldn't it seem preferable to have some functionality per the suggestion above :) ?
Myrsloik
7th May 2017, 08:19
No, lrn2vm
hydra3333
7th May 2017, 08:55
No, lrn2vm
I suppose it is time to dredge up some 40 year old coding skills and take a look.
Now, where's that paper tape reader and the newfangled golf ball printer ?
vcmohan
7th May 2017, 13:45
Something else where I'm thinking "let's just ask, who knows....":
Is there a way to _separate_ high frequency content from the mid to low frequency content?
I just got this post in my mail alerts. Looks that much water has flown since.
However if interested have a look of my plugin vcfreq which has functions to filter various freq bands.
I just got this post in my mail alerts. Looks that much water has flown since.
However if interested have a look of my plugin vcfreq which has functions to filter various freq bands.
I knew of that one, sort of, but always rejected it from reading the manual. And now I'm thinking the same: It doesn't look to separate a clip into different clips and then able to merge them together again, right?
It seems more to be able to do a whole lot of predefined filters on separate frequencies, or to nudge out some peaks on a 'FFT Diagram' (don't know the real word for it).
If I want to separate the frequencies into 3 clips + a leftover clip, do some random stuff to it with other plugins then combine them back.. I don't see how vcfreq can do that or I'm completely missing the point somewhere.
BTW, I'm pretty happy now with what I do got. I'm using the gaussian blur filter from the bilateral plugin, and I go a few times through the process of 'blur away some fine detail with small radius gblur, compare original image to blurred, extract differences to frequency clip, then repeat the process with the blurred image and a bigger radius gblur, etc...'. That way I get a few clips with increasingly more 'detail' in it and at the end one image which is sort of the 'base' image. Filter on certain detail-levels only with knlmeanscl / smdegrain / f3kdb then merge them back together
TheFluff
7th May 2017, 14:46
May I make an incremental improvement suggestion for a future release ?
Not sure if this would be possible or not ... wouldn't it be nice if values were configurable at script startup from a vapoursynth-provided .ini text file of defaults in the vapoursynth folder (with a default .ini file provided with vapoursynth) ... and then a new vapoursynth function available to over-ride at run-time with parameters along the lines of itll_needs_frames("function_name", number_before, number after).
No, please stop. The actual VS plugin API supports plugins requesting arbitrary frames asynchronously on a per-frame basis. If you want your plugin to behave nicer under the VS plugin API, write an actual VS interface for it instead of adding these braindamaged hacks. It's pretty trivial, or at least it should be (disregarding typical Avisynth plugin code quality).
The entire AVS plugin compatibility layer is already bad enough - I suspect it's mostly there to prove a point, but one that sadly seems to have flown over the head of the intended recipients (I think it was supposed to point out to the Avisynth developers that their policy of piling hack on hack on top of their ancient plugin API for compatibility reasons instead of adding a new one better suited to modern reality was fundamentally mistaken and unnecessary, but now the hacked up but not quite compatible garbage is so well established that they can't break compatibility with that either). Is there something in Avisynth itself that drives people to software architectural madness, or what?
hydra3333
7th May 2017, 15:45
No, please stop. The actual VS plugin API supports plugins requesting arbitrary frames asynchronously on a per-frame basis. If you want your plugin to behave nicer under the VS plugin API, write an actual VS interface for it instead of adding these braindamaged hacks. It's pretty trivial, or at least it should be (disregarding typical Avisynth plugin code quality).
I'm sorry, sometimes we don't get to modify others' code even if it were available and then there's the gaps in underpinning knowledge about how to do it :)
I was just trying to suggest how to make VS handy and simple to use from an end-users perspective (that'd be me), given that great new plugins pop up all the time and not every home scripter (that'd be me) knows how to recompile DLLs.
Joachim Buambeki
7th May 2017, 15:53
However if interested have a look of my plugin vcfreq which has functions to filter various freq bands.Incidentally, I just stumbled over your plugin yesterday while searching for ways to separate the frequencies.
Could you please give us an example script that separates the planes into high, mid and low frequencies (with the corresponding parameters/radii), denoises them and merges them back together?
Would you use different radii for HD vs ≥4K footage? If not, how about very low und ultra low frequencies for very high resolution? Commercial software denoises them as well (if I had to guess I'd assume it is a lowpass with a high three digit radius but it is hard to tell).
Also, if you use something like MDegrain, do you have to calculate vectors for each separated plane or can you use the vectors from the unseparated plane for each MDegrain call to save CPU cycles?
Thanks!
AzraelNewtype
7th May 2017, 23:31
No, please stop. The actual VS plugin API supports plugins requesting arbitrary frames asynchronously on a per-frame basis. If you want your plugin to behave nicer under the VS plugin API, write an actual VS interface for it instead of adding these braindamaged hacks. It's pretty trivial, or at least it should be (disregarding typical Avisynth plugin code quality).
The entire AVS plugin compatibility layer is already bad enough - I suspect it's mostly there to prove a point, but one that sadly seems to have flown over the head of the intended recipients (I think it was supposed to point out to the Avisynth developers that their policy of piling hack on hack on top of their ancient plugin API for compatibility reasons instead of adding a new one better suited to modern reality was fundamentally mistaken and unnecessary, but now the hacked up but not quite compatible garbage is so well established that they can't break compatibility with that either). Is there something in Avisynth itself that drives people to software architectural madness, or what?
This is about a series of n2 plugins, and n2 has declared Holy War against VapourSynth because he didn't want to invoke a function to reduce rational fps. Your outrage is understandable, but impossible in this instance.
TheFluff
8th May 2017, 18:06
I'm sorry, sometimes we don't get to modify others' code even if it were available and then there's the gaps in underpinning knowledge about how to do it :)
I was just trying to suggest how to make VS handy and simple to use from an end-users perspective (that'd be me), given that great new plugins pop up all the time and not every home scripter (that'd be me) knows how to recompile DLLs.
I went and checked the discussion on neuron2's forum and I think at least one of you is missing the point. You wrote:
In order to add to thread https://forum.doom9.org/showthread.php? ... ost1801677 seeking to update the filter list into Vapoursynth so that VS can successfully seek and return the right number of frames forward/back, is this correct (in particular dgbob which I'm not sure is temporal) ?
The prefetch list for Avisynth filters has nothing to do with seeking. VS will work perfectly fine even without the prefetch info. All providing the prefetch info does is to make the VS threadpool arrange so that by the time it calls getFrame(n) on the wrapped Avisynth filter, all frames that that filter will request once getFrame(n) is called have already been fetched from the upstream filter. That's why it's called prefetch. If you don't have prefetch info, all that happens is that VS reverts to standard Avisynth behavior and the thread blocks while waiting on the upstream filter(s) to produce input for the wrapped Avisynth filter.
Providing the prefetch info just makes the Avisynth filter behave better than it does in (single-threaded) Avisynth since upstream filters can be run in parallel. Without it, performance is (almost) exactly like Avisynth.
N2 then wrote:
Isn't something seriously wrong with Vapoursynth if this has to be hard-coded in the core? DGDecimate() at script run time cannot tell the Vapoursynth core at its compile time what the cycle size is going to be, and if Vapoursynth always assumes some maximum it is going to over-request frames.
And, well, yes, of course it's seriously wrong. It's just a dumb hack that only exists in the Avisynth wrapper to work around the fact that Avisynth's frame requests are synchronous and blocking. The actual VS plugin interface doesn't work like that, instead plugins request what frames they want asynchronously (as I've previously explained at some length (https://forum.doom9.org/showthread.php?t=174437)) and they can decide on a per-frame basis which frames they need at runtime.
If you want to load legacy plugins with no source the Avisynth wrapper may be an acceptable solution, but for new(-ish) plugins in active development I really don't think it's reasonable to demand that VS fix the concurrency bottlenecks caused by Avisynth's refusal to adopt a reasonable plugin interface that actually supports multithreading. There really isn't much to the VS interface, the data structures are quite similar to Avisynth's and supporting both interfaces in a single plugin really isn't that hard.
e:
Here's another stupidity with the VS prefetch nonsense. DGBob (and yadifmod2 and probably others) can specify either single-rate or double-rate deinterlacing by a parameter. The PREFETCH parameters would need to be different for these two and I don't see how to set that at VS compile time.
The hardcoded prefetch stuff actually does support adjusting the prefetch range based on one or more parameters to the filter and that's one of the reasons it'd be annoying to put it in an .ini file, so, well. See for example https://github.com/vapoursynth/vapoursynth/blob/master/src/avisynth/avisynth_compat.cpp#L248
hydra3333
9th May 2017, 15:14
OK and thanks for clarifying.
I went and checked the discussion on neuron2's forum and I think at least one of you is missing the point. OK, no doubt that'd be me.
If you don't have prefetch info, all that happens is that VS reverts to standard Avisynth behavior and the thread blocks while waiting on the upstream filter(s) to produce input for the wrapped Avisynth filter.
Providing the prefetch info just makes the Avisynth filter behave better than it does in (single-threaded) Avisynth since upstream filters can be run in parallel. Without it, performance is (almost) exactly like Avisynth.
Unless I misunderstood again, from an end-user perspective specifying useful prefetch values maximizes the probability of increased performance, which is a desirable outcome in a playing field where one can experience *few* fps processing from time to time.
If you want to load legacy plugins with no source the Avisynth wrapper may be an acceptable solution, but for new(-ish) plugins in active development I really don't think it's reasonable to demand that VS fix the concurrency bottlenecks caused by Avisynth's refusal to adopt a reasonable plugin interface that actually supports multithreading. There really isn't much to the VS interface, the data structures are quite similar to Avisynth's and supporting both interfaces in a single plugin really isn't that hard.Yes ... although Authors are free do do as they wish with the (sometimes semi commercial) art they create, and sometimes the code won't be publicly available.
The hardcoded prefetch stuff actually does support adjusting the prefetch range based on one or more parameters to the filter and that's one of the reasons it'd be annoying to put it in an .ini file, so, well. See for example https://github.com/vapoursynth/vapoursynth/blob/master/src/avisynth/avisynth_compat.cpp#L248OK, thank you, nice. Yes, that's in code which is not effectively changeable by end users unless I am mistaken. In a range of future cases though (separate from this instance) it seems possible to conjecture with near certainty that "filter" code changes may not occur for different reasons ... and the next best thing may be for end-users to have some flexibility (Vapoursynth would likely have design objectives of being better and faster, after all) by, if possible, either/or/and (i) create a way for end-users to help themselves, eg an .ini file (ii) create a script interface to set it at runtime independently of the filter.
I accept that the suggestions are being viewed with significant disfavour, but it was still worth the risk of a belt by asking.
Myrsloik
9th May 2017, 15:32
...
Yes ... although Authors are free do do as they wish with the (sometimes semi commercial) art they create, and sometimes the code won't be publicly available.
...
Don't you mean donationware? (that you have to donate to access but totally isn't commercial)
I'm also free to ignore all bullshit. HAHAHAHAHAHA
hydra3333
9th May 2017, 15:46
And so you are indeed free without hindrance to deal with matters how you please, kind sir.
Yes, I did indeed mean donationware as well as other variations including closed source.
Oh well.
Myrsloik
10th May 2017, 19:45
R38 RC1 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R38-RC1.exe)
Go test it. BoxBlur: arguments"clip:clip;planes:int[]:opt;hradius:int:opt;hpasses:int:opt;vradius:int:opt;vpasses:int:opt;" h/v is for horizontal/vertical of course, passes is how many times the blur should be applied
r38:
updated to zimg v2.5.1
added boxblur filter
various fixes to averageframes
averageframes can now use up to 31 weights
increased the number of allowed constants in h and v convolution modes to 25
added new constants to clipinfo
fixed several subtext corruption and crash bugs (jackoneill)
added y410 and r210 output to avfs and vsvfw
added constants for 12 and 14 bit yuv formats
fixed a one pixel offset error only happening in vertical convolution with a 3 element vector
switched to vs2017 in windows projects
hydra3333
12th May 2017, 12:51
Seeking advice.
The visual studio integration is broken. (I think that comment is about VSYASM integration into Visual Studio 2017)
I am attempting to try to build a part of Vapoursynth using Visual Studio Community 2017 per advice in this thread, and started to look at getting dependencies together one by one.
The https://github.com/vapoursynth/vapoursynth GIT file "build instructions windows.txt" says this
Default install paths are assumed in all projects and scripts, be prepared to adjust many things if you changed them
Needs Visual Studio 2017 and vsyasm (yasm for use with VS2010)
Visual Studio 2015 Update 3 is also (unfortunately) required to compile the python module
The proper paths to put things in are:
<some random exe path>
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations
It also needs both 32 and 64 bit Python 3.6 series with recent cython, sphinx and sphinx-intl installed
Inno setup is needed to create the installer
7-zip is needed to compress the portable version
Clone VapourSynth
Clone zimg v2.5 branch into the VapourSynth dir (https://github.com/sekrit-twc/zimg)
Clone avs+ mt branch into the VapourSynth dir (https://github.com/AviSynth/AviSynthPlus)
FIX LLVM STUFF IN THE ZIMG PROJECT
Compile 32 and 64 bit release using the VapourSynth solution
Run cython_build.bat to compile the Python modules
In order to build the installer you need to download
and place isxdl.dll in "installer\scripts\isxdl".
It can be downloaded from:
http://www.codeproject.com/Articles/20868/NET-Framework-Installer-for-InnoSetup
There are also a few plugins that aren't included
which are easier to simply retrieve from an existing
VapourSynth installation.
Note that the Avisynth side of AVFS won't work properly in debug builds (memory allocation and exceptions across module boundaries trolololol)
Likewise AviSource can only be compiled as a release build (or debug versions of functions that aren't present are referenced)
Just checking, I read somewhere that there's updates to YASM git https://github.com/vapoursynth/vapoursynth which are required for it to work, but which aren't in the 1.3.0 release ?
Anyway, tried to build VSYASM using VS2017 and its build process crashes. Tweaked it a bit along these lines and jagged an error free build.
To build VSYASM with Visual Studio 2017 Community,
for use with Visual Studio 2017 Community,
in building parts of Vapoursynth.
Tested in a VM under Windows 8.1
Clue: parts of the build proces "fail to build", so
- ensure file/folder permissions are not read-only
- ensure "everyone" has full control of the folder tree
- edit a couple of .bat files which crash but don't really
- add compilation flag /FS to every project in the solution
1. Install VS2017 and every c++ bit that comes with it. Install everything.
2. Don't bother installing python just for this, it only gets in the way, but you'll need it later.
3. download YASM from GIT which does actually have all of the REQUIRED latest changes after 1.3.0 was released
- from https://github.com/yasm/yasm
- save the .zip which will be yasm-master.zip
- then extract it to a folder
4. change properties on the top folder .\yasm-master to not be read-only any more
5. change security permissions on the top folder .\yasm-master so "everyone" has full control
6. Locate file in the root called YASM-VERSION-GEN.BAT
6.1 Add this line as a new line 3
GOTO :notfound
6.2 Locate the line under label :output which says
if "%_ver_%" == "%_oldver_%" exit /b
and add REM in front of it so it becomes an inactive line
7. Locate file .\yasm-master\Mkfiles\vc15\genperf\run.bat
Add this as a new line 3
goto try21
Under the label :update locate and REM out this line
rem del tf
7. Open the solution in VS1017: .\vsyasm\yasm-master\Mkfiles\vc15\yasm.sln
7.1 One at a time, FOR EVERY PROJECT in the solution
- right-click and choose "Properties"
- Expand "Configuration Properties"
- Expand "C/C++"
- Click on "Command Line" and notice "Additional Options" textbox on the right
- Add /FS to the "Additional Options" textbox
8. in the top of VS for this solution, select
"Release"
"x64"
9. Right-click on the solution then choose "Rebuild Solution" then watch it build
10. See the text ========== Rebuild All: 11 succeeded, 0 failed, 0 skipped ==========
11. Open the folder .vsyasm\yasm-master\Mkfiles\vc15\x64\Release
and copy all of the .exe files to a temporary folder somewhere handy eg under your desktop
this whould include the file "vsyasm.exe"
12. Locate these three files
vsyasm.props
vsyasm.targets
vsyasm.xml
in folder .\yasm-master\Mkfiles\vc15 and copy them to the same temporary folder as the .exe files above.
13. Under Visual Studio 2017, the VC\bin folders mentioned below
are really bad to find and can be subversion-dependent
which is a real pain of Microsoft to have done.
So evey time you login ...
to tell Visual Studio where to find vsyasm.exe, the environment
variable YASMPATH can be set to the absolute path of the
directory in which vsyasm.exe is located
(this path should include the final backslash). eg
set YASMPATH=C:\Users\u\Desktop\vsyasm\yasm-master\exe\
To set the environment variable
- right click on this pc, choose System Properties, click the button Environment Variables
Under System Variables Click New then add the new variable described above pointing to your .exe folder
Use one of 14. OR.... 15.
14. Add the path for VS2017 to find the stuff. In VS2017 use menu
Tools
Options
Projects & Solutions
VC++ Project Settings
then notice on the right "Build Customizations Search path"
Paste in the full folder path (excluding the final slash) containing the .xml files etc above, and save it
15. pop the 3 files in this folder
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations
Now we've enabled YASM for use in compiling Vapoursynth. Hopefully.
Am I wasting my time or will vsyasm now integrate into vs2017 ? How to others do it ?
Re this
Visual Studio 2015 Update 3 is also (unfortunately) required to compile the python module
Does that mean I need to find and install vs2015 as well ?
edit 1: for other uninitiated newbies like me coming across this, for other dependencies like cython, sphinx and sphinx-intl this seemed to not crash:
1. install 64 bit python (3.6 in this case) as I only need 64bit stuff
2. start an Admin CMD dos box (or it can't copy files into protected folders) then use the pip command to install the packages, which apparently gets installed with python:
3. pip install cython
4. pip install sphinx-intl
#4 seems to also locate and install sphinx
edit 2: I got this error building avscompat LINK : fatal error LNK1181: cannot open input file 'gdi32.lib' which is apparently a known error per http://stackoverflow.com/questions/33599723/fatal-error-lnk1104-cannot-open-file-gdi32-lib
If anyone has this problem on Visual Studio 2017, it is an issue with the Windows 10 Creators Update.
A workaround is to select the
"Windows 10 SDK (10.0.15063.0) for Desktop C++ x86 and x64"
under the "Desktop development with C++" workload in the Visual Studio Installer.
edit 3: Last comment, for newbies.
1. For vapoursynth to build, the avs+ mt branch placed in the root of vapoursynth folder tree must be called "AviSynthPlus"
2. and the zimg v2.5 branch placed in the root of vapoursynth folder tree must be called "zimg".
Myrsloik
12th May 2017, 12:55
You only need vs2017, nothing else. You only need to compile the avscompat subproject. Ignore the rest. And vsyasm is derp
hydra3333
13th May 2017, 04:01
Thank you for this:
https://github.com/vapoursynth/vapoursynth/commit/c6c7efd1cd18529ae33a96ff1a42b1aa51409a10
If I read the code right, for DGBOB and DGDecimate it also does dynamic setting based on parameters provided to those plugins and serves as a template for doing such for future plugins whenever I need to rebuild avscompat. Beaut !
SOURCE(DGSource)
+ PREFETCHR0(DGDenoise)
+ PREFETCHR0(DGSharpen)
+ temp = int64ToIntS(vsapi->propGetInt(in, "mode", 0, &err));
+ PREFETCH(DGBob, (temp > 0) ? 2 : 1, 1, -2, 2) // close enough?
+ PREFETCH(DGTelecide, 1, 1, -2, 10) // also not good
+ temp = int64ToIntS(vsapi->propGetInt(in, "cycle", 0, &err));
+ PREFETCH(DGDecimate, temp - 1, temp, -(temp + 3), temp + 3) // probably suboptimal
Cheers !
I had to lookup derp ... and now will be using the noun at work to denote a fair portion of what I hear.
edit 1: I'll ask a question and minor suggestion over at the GIT about "(temp > 0) ? 2 :"
edit 2: Thanks. I ended up going with this for readability, and added the new standalone gpu based nvidia purevideo deinterlacer as well.
// DGBob yadif based deinterlacer http://rationalqm.us/board/viewtopic.php?f=0&t=463&p=6712&hilit=dgbob#p6712
// http://rationalqm.us/board/viewtopic.php?f=14&t=559&p=6732&hilit=dgbob#p6732
temp = int64ToIntS(vsapi->propGetInt(in, "mode", 0, &err));
//PREFETCH(DGBob, (temp > 0) ? 2 : 1, 1, -2, 2) // close enough?
// I dont think so. DG said always previous + current + next ... fudge it a bit for doublerate, what the heck
switch (temp) {
case 0:
PREFETCH(DGBob, 1, 1, -1, 1); break; // single framerate deinterlacing -1,current,+1
case 1:
PREFETCH(DGBob, 1, 1, -2, 2); break; // double framerate deinterlacing -2,current,+2 although I reckon hydra3333 got it wrong and its actually -1,current,+1 ... -2,2 can't hurt too badly I guess
case 2:
PREFETCH(DGBob, 1, 1, -2, 2); break; // double framerate deinterlacing to single rate (makes slow motion) -2,current,+2 although I reckon hydra3333 got it wrong and its actually -1,current,+1 ... -2,2 can't hurt too badly I guess
}
// not sure what to do about PVBob nvidia PureVideo based deinterlacer http://rationalqm.us/board/viewtopic.php?f=14&t=559&start=240#p6786 ... act like DGBob for the time being
temp = int64ToIntS(vsapi->propGetInt(in, "mode", 0, &err));
switch (temp) {
case 0:
PREFETCH(PVBob, 1, 1, -1, 1); break; // single framerate deinterlacing -1,current,+1
case 1:
PREFETCH(PVBob, 1, 1, -2, 2); break; // double framerate deinterlacing -2,current,+2 although I reckon hydra3333 got it wrong and its actually -1,current,+1 ... -2,2 can't hurt too badly I guess
case 2:
PREFETCH(PVBob, 1, 1, -2, 2); break; // double framerate deinterlacing to single rate (makes slow motion) -2,current,+2 although I reckon hydra3333 got it wrong and its actually -1,current,+1 ... -2,2 can't hurt too badly I guess
}
feisty2
20th May 2017, 09:17
I'm thinking of another way around to make pointers returned by getReadPtr/getWritePtr 2D without using alloca()
like the following,,, (overload "[]")
#include <iostream>
#include <cstdlib>
template<typename T>
struct FramePointer final {
T *Pointer = nullptr;
decltype(0ull) Width = 0;
FramePointer(T *Pointer, unsigned long long Width) {
this->Pointer = Pointer;
this->Width = Width;
}
FramePointer(FramePointer &&) = default;
FramePointer(const FramePointer &) = default;
auto operator=(FramePointer &&)->FramePointer & = default;
auto operator=(const FramePointer &)->FramePointer & = default;
~FramePointer() = default;
auto operator[](unsigned long long Row) {
return Pointer + Row * Width;
}
};
auto main()->int {
auto Width = 1920ull, Height = 1080ull;
auto RawFramePointer = new double[Width * Height];
auto ActualPointer = FramePointer<double>{ RawFramePointer, Width };
ActualPointer[2][34] = 2.718;
std::cout << RawFramePointer[2 * Width + 34] << std::endl;
delete[] RawFramePointer;
system("pause");
}
do you think it's any way better than the previous "alloca" approach?
jackoneill
20th May 2017, 12:03
The question is: better for what purpose?
Readability? No, especially with your style of C++.
Not using a bunch of stack space for no reason? Yes.
feisty2
20th May 2017, 12:21
Readability? No, especially with your style of C++.
what? why? I think the readability of my c++ style is nice! I'm just making it like "python with pointers" as much as possible..
maybe ur just not that used to the new c++ standards..?
edit:
anyways, I just added support for constant pointers as well since getReadPtr returns const uint8 *
#include <iostream>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
constexpr auto operator""_size(unsigned long long Value) {
return static_cast<std::size_t>(Value);
}
template<typename T>
struct FramePointer final {
T *Pointer = nullptr;
decltype(0_size) Width = 0;
FramePointer(const void *Pointer, std::size_t Width) {
auto Evil = const_cast<void *>(Pointer);
this->Pointer = reinterpret_cast<T *>(Evil);
this->Width = Width;
}
FramePointer(FramePointer &&) = default;
FramePointer(const FramePointer &) = default;
auto operator=(FramePointer &&)->FramePointer & = default;
auto operator=(const FramePointer &)->FramePointer & = default;
~FramePointer() = default;
auto operator[](std::ptrdiff_t Row) {
return Pointer + Row * Width;
}
auto operator[](std::ptrdiff_t Row) const {
return const_cast<const T *>(Pointer + Row * Width);
}
};
auto main()->int {
auto Width = 1920_size, Height = 1080_size;
auto RawFramePointer = new double[Width * Height];
auto getReadPtr = [&]() {
auto Evil = reinterpret_cast<std::uint8_t *>(RawFramePointer);
return const_cast<const std::uint8_t *>(Evil);
};
auto getWritePtr = [&]() {
return reinterpret_cast<std::uint8_t *>(RawFramePointer);
};
auto ActualPointer = FramePointer<double>{ getWritePtr(), Width };
const auto ConstantPointer = FramePointer<double>{ getReadPtr(), Width };
ActualPointer[2][34] = 2.718;
//ConstantPointer[2][34] = 3.142; ERROR!
std::cout << ConstantPointer[2][34] << std::endl;
delete[] RawFramePointer;
system("pause");
}
jackoneill
20th May 2017, 13:44
what? why? I think the readability of my c++ style is nice! I'm just making it like "python with pointers" as much as possible..
maybe ur just not that used to the new c++ standards..?
But C++, old or new, is not Python with pointers.
Let's take this line:
auto operator=(FramePointer &&)->FramePointer & = default;
I hate to invoke tradition, but there are literally decades' worth of C/C++ code that is not written like this. This is not what programmers expect to see, hence it takes a bit more effort to read. There is also no reason to do this. What is the point of "auto" in such a context? You write "auto" so you don't have to write the name of the actual type. Maybe the name is very long, maybe it has many capital letters. Whatever the case, maybe "auto" is easier to write. But then you go ahead and write the name of the type anyway, in addition to "auto". It makes no sense to use "auto" here.
decltype(0ull) Width = 0;
And what's the reason for not writing the type name here? "unsigned long long" too long? There are shorter alternatives: "size_t", "ptrdiff_t", "uint64_t".
feisty2
20th May 2017, 14:06
But C++, old or new, is not Python with pointers.
Let's take this line:
auto operator=(FramePointer &&)->FramePointer & = default;
I hate to invoke tradition, but there are literally decades' worth of C/C++ code that is not written like this. This is not what programmers expect to see, hence it takes a bit more effort to read. There is also no reason to do this. What is the point of "auto" in such a context? You write "auto" so you don't have to write the name of the actual type. Maybe the name is very long, maybe it has many capital letters. Whatever the case, maybe "auto" is easier to write. But then you go ahead and write the name of the type anyway, in addition to "auto". It makes no sense to use "auto" here.
because you no longer have to specify the return type for most functions and function-like stuff (lambdas or whatever) since c++14 but there're a few exceptions like "main()" or the default assignment operator or virtual functions, to unify the coding style throughout the entire program, I decided to start all functions, exception or not, with "auto", and if it's one of those exceptions that you HAVE TO specify the return type, I'll make it a trailing return type so it would fit the unified coding style, and trailing return types are not that rare actually, it's extremely common in languages like swift and... stuff
feisty2
20th May 2017, 14:25
decltype(0ull) Width = 0;
And what's the reason for not writing the type name here? "unsigned long long" too long? There are shorter alternatives: "size_t", "ptrdiff_t", "uint64_t".
again for the same reason here, I still couldn't understand why "auto" is not allowed for non-static class members (I mean auto is allowed even for template parameters since c++17) and until "auto" is allowed there someday, maybe, "decltype" is the closest thing to "auto" and it's the only choice I got if I want the unified coding style,,, maybe a bit of macro will do the magic and "allow 'auto' for non-static class members"
I'm not using any "decltype" stuff in the function parameter list cuz I want function overloads to be explicit and clear, but I don't give a fuck about the types of members in a class.
Does that also work with a lot less swearing? Don't make it look like a Tourette project, please... :o
videoh
20th May 2017, 21:06
Does that also work with a lot less swearing? Don't make it look like a Tourette project, please... :o Plus 1.
Myrsloik
22nd May 2017, 15:40
please check again if it works with the latest gcc now,,, and pick -std=c++17 instead of c++14, I'm using the c++17 syntax and c++14 might fail if some structured bindings and stuff wanna get in the party
Get your own thread.
VS_Fan
24th May 2017, 03:12
I was trying BoxBlur as a way to prepare the input for mv.DepanAnalyse. I tried different values for hradius, wihout any evident problem.
But any value for vradius will crash vseditor and vspipe, after showing the message: “Attempted to read key 'clip' from a map with error set: Transpose: Clip must have same subsampling in both dimensions”.
That made me try changing chroma subsampling to 420 and 444 without any success.
Also: After a successful BoxBlur with hradius > 0, there seems to be a change in the chroma subsampling: using std.Transpose immediately after, will raise the error: “vapoursynth.Error: Transpose: Clip must have same subsampling in both dimensions”, but without crashing. If I reset the chroma subsampling (fmtc.resample(css="420")) after BoxBlur and before std.Transpose, there will be no error.
Myrsloik
29th May 2017, 12:47
I was trying BoxBlur as a way to prepare the input for mv.DepanAnalyse. I tried different values for hradius, wihout any evident problem.
But any value for vradius will crash vseditor and vspipe, after showing the message: “Attempted to read key 'clip' from a map with error set: Transpose: Clip must have same subsampling in both dimensions”.
That made me try changing chroma subsampling to 420 and 444 without any success.
Also: After a successful BoxBlur with hradius > 0, there seems to be a change in the chroma subsampling: using std.Transpose immediately after, will raise the error: “vapoursynth.Error: Transpose: Clip must have same subsampling in both dimensions”, but without crashing. If I reset the chroma subsampling (fmtc.resample(css="420")) after BoxBlur and before std.Transpose, there will be no error.
Here's R38-RC2 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R38-RC2.exe). It should fix this issue. This build will be released unless serious regressions are found.
Boulder
31st May 2017, 16:53
Is there a possibility to enhance VDecimate so that it would support dropping more than one frame per cycle? I once again have a silly Blu-ray which needs some special decimation as the cycle is lengthy and the decimation pattern is not 100% constant. The override file only drops the first marked frame inside the cycle.
Myrsloik
31st May 2017, 16:59
Is there a possibility to enhance VDecimate so that it would support dropping more than one frame per cycle? I once again have a silly Blu-ray which needs some special decimation as the cycle is lengthy and the decimation pattern is not 100% constant. The override file only drops the first marked frame inside the cycle.
Do you mean M in N decimation or something even weirder? How long is the cycle? What's the pattern? Can I have a small sample in case I'm inspired?
Boulder
31st May 2017, 17:17
The cycle is veeery long I'm afraid, looks like it's tens of frames with 5 normal frames followed by 1 dupe, then 6 normal frames followed by 1 dupe and then the cycle restarts. As this is a concert video, there are a lot of cuts to confuse you. I wonder if mode 2 from TIVTC would actually suit this one better.. This issue is probably caused by the "shot at 25 fps, then butchered to 29.97 fps" approach.
Anyway, here's a sample which contains one cycle: https://drive.google.com/open?id=0BzeF_1syecQwbzh0cWJVSnRpOGM
Myrsloik
31st May 2017, 17:32
The cycle is veeery long I'm afraid, looks like it's tens of frames with 5 normal frames followed by 1 dupe, then 6 normal frames followed by 1 dupe and then the cycle restarts. As this is a concert video, there are a lot of cuts to confuse you. I wonder if mode 2 from TIVTC would actually suit this one better.. This issue is probably caused by the "shot at 25 fps, then butchered to 29.97 fps" approach.
Anyway, here's a sample which contains one cycle: https://drive.google.com/open?id=0BzeF_1syecQwbzh0cWJVSnRpOGM
A two pass solution is probably what you really need then. I'm not sure how else to get good results in a video like that. Definitely not a priority for me right now.
videoh
31st May 2017, 18:31
TDecimate() handles long cycles, up to the number of frames in the video! DGDecodeNV has a DGDecimate() function implemented with CUDA that supports N-in-M with cycles of up to 40 frames.
Myrsloik
31st May 2017, 18:44
I'm wondering about why VS_FRAME_POOL is only defined under VS_TARGET_OS_WINDOWS in vscore.h. Why can't non-windows systems make use of the frame pool?
This has to do with how memory allocation works in different operating systems. If you benchmark it on linux it is just as fast (or possibly even faster) without it defined. That's why it isn't defined.
It was added because on windows memory allocation generally works like this:
For small allocations a very fast sub-allocator is used. You get awesome speedz!
For larger allocations it basically just passes on the call to VirtualAlloc. VirtualAlloc is slow as fuck. It has to zero all allocated memory for security reasons and a pile of other fun stuff (if I'm not mistaken).
The small allocation size limit is around a few MB, or more exactly between 1080p and 4k. This makes VS exceptionally slow at processing higher resolutions. The pool is simply there as a workaround to remove most of the negative performance effects in windows (it's still a lazy implementation with a global mutex). Before this solution I used tcmalloc which handles it even better.
Myrsloik
5th June 2017, 21:45
R38 is released.
The usual post (http://www.vapoursynth.com/2017/06/r38-boxblur-is-best-blur/)
lansing
8th June 2017, 16:07
What is the Virtualdub filter plugin on the priority list now?
There's a new Virtualdub version that supports more colorspace/higher bit depth input and output now:
https://forum.doom9.org/showthread.php?t=172021
Myrsloik
8th June 2017, 16:22
What is the Virtualdub filter plugin on the priority list now?
There's a new Virtualdub version that supports more colorspace/higher bit depth input and output now:
https://forum.doom9.org/showthread.php?t=172021
I don't understand the question. You want vdub plugin support? I've already added several additional output formats that vdub filtermod can use.
lansing
8th June 2017, 16:34
I don't understand the question. You want vdub plugin support? I've already added several additional output formats that vdub filtermod can use.
I'm talking about a Vapoursynth plugin that can load in Virtualdub filters.
I have a few vd filters that I wanted to load into the script. I was hesitant to use them before because it requires colorspace conversion in between on the original VD.
lansing
11th June 2017, 06:46
I don't know if this is a bug, when I pass a 32 bit video script to the encoder, I'll get this error even though I set the encoder to 10 bit output. I have to change the bit depth in the script to 16 or less in order to not crash.
The Vapoursynth process terminated abnormally. This means Vapoursynth or one of your Vapoursynth-Plugin's just crashed.
feisty2
24th June 2017, 10:13
@Myrsloik
can you add Plum (https://forum.doom9.org/showthread.php?t=173775) to the plugin list?
it's now complete.
Myrsloik
24th June 2017, 18:04
@Myrsloik
can you add Plum (https://forum.doom9.org/showthread.php?t=173775) to the plugin list?
it's now complete.
Will do
stax76
4th July 2017, 12:47
It's a issue for me that ffmpeg and mpv don't support vapoursynth under windows. How is avisynth support implemented in mpv/ffmpeg/x264, do all tools get avisynth support via libavformat and how is it implemented, directly or via vfw or DiectShow? I will definitely at least make a feature request, the more people request it the better the chances that it will happen.
I believe x264 (and ffmpeg probably too) uses the AviSynth API, not VfW. And certainly not DirectShow, which would need a VfW wrapper...
TheFluff
4th July 2017, 15:07
Yes, both x264 and libavformat interact with the Avisynth API directly. mpv uses the VS API to implement realtime playback filtering with VS but I dunno if it supports VS input that way.
It's a issue for me that ffmpeg and mpv don't support vapoursynth under windows. How is avisynth support implemented in mpv/ffmpeg/x264, do all tools get avisynth support via libavformat and how is it implemented, directly or via vfw or DiectShow? I will definitely at least make a feature request, the more people request it the better the chances that it will happen.
What exactly is an issue? Do you need seeking?
stax76
4th July 2017, 16:11
I mostly want to improve staxrip, if there is no native vapoursynth support then you have to use a batch file with piping and then you cannot use unicode or ascii above 137 in Windows 7 because this is broken in Windows 7. For Englisch speaking countries it's not a issue but for my country and many others it is, there are other issues like usability. I need a player for staxrip that can read avs/vpy and can take a delay and audio/subtitle stream ID via command line and is High DPI ware, such a player don't exist yet, I'm now working on it.
TheFluff
4th July 2017, 16:33
I'm somewhat skeptical of that claim but I'll take your word for it. However, I can think of at least three ways to work around that issue just off the top of my head and there are surely more - in fact, I have no idea why you're even involving a batch file. Some random ideas:
- Powershell script file instead of .bat file, if you insist on doing it in an awkward way
- CreateProcessW cmd.exe /c "your command here" (or, again, PowerShell)
- Create a named pipe, then CreateProcessW twice (once for vspipe, once for the consumer application)
stax76
4th July 2017, 16:47
I can try with powershell since I already use powershell for extensibility, staxrip is hosting the powershell engine for that but for powershell.exe as host scripts might only work if the user changes security settings, by default script execution is disabled. There might be ways, probably there are but Windows 7 isn't top priority for me I have to admit, I'm focused at the playback issue atm.
edit:
about the text encoding issue in Win 7, I'm not the first to notice, here is a thread at stackoverflow:
https://stackoverflow.com/questions/388490/unicode-characters-in-windows-command-line-how
TheFluff
4th July 2017, 16:58
That's about trying to use UTF-8, as far as I can tell, and that's not bound to work out well on Windows. I assume you've tried UTF-16 too, but I have no idea why that wouldn't work and it's extremely weird if it doesn't. vspipe.exe at least expects a UTF-16 command line on Windows, just like everything else. I'm not at my Windows box at the moment or I'd just try it.
stax76
4th July 2017, 21:28
I'm always getting a crash:
Problemsignatur:
Problemereignisname: BEX64
Anwendungsname: StaxRip.exe
Anwendungsversion: 1.5.1.8
Anwendungszeitstempel: 595bf0e3
Fehlermodulname: StackHash_1dc2
Fehlermodulversion: 0.0.0.0
Fehlermodulzeitstempel: 00000000
Ausnahmeoffset: 0000000000000000
Ausnahmecode: c0000005
Ausnahmedaten: 0000000000000008
Betriebsystemversion: 6.1.7601.2.1.0.768.3
Gebietsschema-ID: 1031
Zusatzinformation 1: 1dc2
Zusatzinformation 2: 1dc22fb1de37d348f27e54dbb5278e7d
Zusatzinformation 3: cbc5
Zusatzinformation 4: cbc5ec6970b2af35927ad67117ca57e2
https://answers.microsoft.com/en-us/windows/forum/windows_7-performance/can-anyone-help-me-to-solve-the-appcrash-problem/6c2bfd74-5eb4-4c5f-92c6-90818086d964
This happens on Win 7 inside vmware, it's my test system only used for testing staxrip on win 7, it has nothing installed except things needed to run staxrip so avisynth, vapoursynth, python, vc++ runtimes and .NET, newest version of all this software. I can't tell when it started because I test vs on win 7 only occasionally.
jackoneill
5th July 2017, 12:49
I'm always getting a crash:
Problemsignatur:
Problemereignisname: BEX64
Anwendungsname: StaxRip.exe
Anwendungsversion: 1.5.1.8
Anwendungszeitstempel: 595bf0e3
Fehlermodulname: StackHash_1dc2
Fehlermodulversion: 0.0.0.0
Fehlermodulzeitstempel: 00000000
Ausnahmeoffset: 0000000000000000
Ausnahmecode: c0000005
Ausnahmedaten: 0000000000000008
Betriebsystemversion: 6.1.7601.2.1.0.768.3
Gebietsschema-ID: 1031
Zusatzinformation 1: 1dc2
Zusatzinformation 2: 1dc22fb1de37d348f27e54dbb5278e7d
Zusatzinformation 3: cbc5
Zusatzinformation 4: cbc5ec6970b2af35927ad67117ca57e2
https://answers.microsoft.com/en-us/windows/forum/windows_7-performance/can-anyone-help-me-to-solve-the-appcrash-problem/6c2bfd74-5eb4-4c5f-92c6-90818086d964
This happens on Win 7 inside vmware, it's my test system only used for testing staxrip on win 7, it has nothing installed except things needed to run staxrip so avisynth, vapoursynth, python, vc++ runtimes and .NET, newest version of all this software. I can't tell when it started because I test vs on win 7 only occasionally.
Hi. This is the VapourSynth support forum. Please report crashes in StaxRip.exe at the StaxRip.exe support forum.
@jackoneill:
In case you did not know - stax76 is the author of StaxRip, and he is trying to integrate VapourSynth support into StaxRip. And fails due to reasons he is unable to discover.
Myrsloik
5th July 2017, 12:58
@jackoneill:
In case you did not know - stax76 is the author of StaxRip, and he is trying to integrate VapourSynth support into StaxRip. And fails due to reasons he is unable to discover.
No wonder he can't discover the cause when no debugger was used to gather information...
stax76
5th July 2017, 13:03
@jackoneill
Do you have a idea how many times native modules have crashed staxrip in the past? I had a huge fight (which I regret) with DG because of this and paid a avisynth dev to fix asm code in order to have qtgmc running in staxrip. I'll figure this out shortly.
Myrsloik
5th July 2017, 13:06
@jackoneill
Do you have a idea how many times native modules have crashed staxrip in the past? I had a huge fight (which I regret) with DG because of this and paid a avisynth dev to fix asm code in order to have qtgmc running in staxrip. I'll figure this out shortly.
Having a huge fight with DG is easy. Just disagree on any trivial topic and that happens. The failure to include a stack trace ensures that none of us can do anything except troll all day long, but that's fine.
videoh
5th July 2017, 16:30
Do you have a idea how many times native modules have crashed staxrip in the past? I had a huge fight (which I regret) with DG because of this and paid a avisynth dev to fix asm code in order to have qtgmc running in staxrip. Is this the huge fight you are talking about?
http://rationalqm.us/board/viewtopic.php?f=8&t=490
That is the only topic you have participated in at the DG forum that I can find.
All I see there is DG trying his best to help debug some issues, which turned out to be caused by an antivirus and a bad Avisynth version. Yes, there was also a problem of DG not supporting more than 32 audio streams in an MKV, but DG fixed it for you right away. I don't see any fighting. Also, you are a Distinguished Member at DG's forum and you and DG have always worked well together.
stax76
5th July 2017, 19:10
I'm not looking back, he's done a lot for me unless MPC devs which is zero I believe but that's fine too.
videoh
5th July 2017, 20:45
he's done a lot for me unless MPC devs which is zero I believe Can you clarify that? DG has always worked closely with 3rd-party app authors: staxrip, megui, bd rebuilder, etc. What's the story about MPC? And where is this huge fight you mentioned?
stax76
5th July 2017, 21:24
Like I said DG always helped me and I'm sure he did the same for the other authors and the community. Story about MPC is frustration growing since a decade, maybe they helped me in the past but I cannot remember, doesn't matter, there are many other players that deserve recognition and I can also code something myself. I'm a total idiot that I struggled 10 years with MediaMonkey's poor high DPI support until I finally migrated to MusicBee, since then I'm trying to test and learn more new and alternative apps I might have overlooked instead of continuing with old habits forever. Sorry for being OT again and for the poor initial bug report and always not doing enough for Win 7, with an idea from TheFluff I've sorted a long standing text encoding issue out on Win 7 in my next built and I'll be definitively looking into the issue with VS, maybe one day hello_hello and Manolito will migrate to Win 7 and everybody will be happy.
videoh
5th July 2017, 21:50
I hear you, buddy. Theory and practice -- never the twain shall meet.
manolito
6th July 2017, 00:13
maybe one day hello_hello and Manolito will migrate to Win 7 and everybody will be happy.
In case you didn't know, I do use Win7 on my laptop simply because my old WinXP desktop does not handle HD movies. And because I do use both OS in parallel all the time, I think that I am qualified to judge them, and I still prefer WinXP by a huge margin...
BTW even on my Win7 computer I use StaxRip 1.1.9.0. I did try the current 64-bit incarnations of StaxRip, but they were unusable for me simply because I absolutely need some old 32-bit plugins for my workflow (like some VDub plugins). This old version of StaxRip has some rough edges for sure, I try to keep most helper software up to date, still I could use some help sometimes. But I really do not dare to bother you with questions about this old version, mostly for fear of being chastized... :devil:
Alright, totally OT for this thread, I apologize...
Cheers
manolito
stax76
6th July 2017, 11:52
@videoh
Never heard that saying before, last TV shows (The Americans!!! and The 100) I watched in original audio so there is small hope that my english improves.
@manolito
I know about four regulars that they talk about XP a lot but not in detail. Two of my principles in regard of staxrip development are listen to users and move forward, if there are enough people asking for a 32-bit built I'll do it, technically it's not a big thing I believe, it's just against the move forward principle which gives me time to work on things like VapourSynth and AV1 support.
@Myrsloik
I've tried to open a script with VD which also crashes, do you need anything else, any tips what to try next? If nobody has a better idea I'll install Visual Studio next.
https://pastebin.com/wysNw2W7
https://postimg.org/image/m9i3vcvfp
Myrsloik
6th July 2017, 18:30
Use visual studio already. I've never managed to get useful information from the vdub stuff.
stax76
7th July 2017, 15:25
Oh man, Visual Studio setup was freezing, I noticed then a sign in the tray telling about updates, after installing 185 important updates it runs fine, this system had auto update never enabled and I totally forgot about it, I'm using it only for testing staxrip's Win 7 and 96 DPI compatibility. I'm sorry guys.
george84
10th July 2017, 13:40
Does anybody know how to replace the external avisynth filter zoom as described in https://forum.doom9.org/showthread.php?t=49429
?
lansing
7th August 2017, 20:50
I'm trying to append two clips with different resolution, but I'm getting nothing shown in the Vapoursynth editor preview, but there's no error message
clip = core.std.Splice([clip, clip2], mismatch=1)
Also how do I use the mismatch function in the operator method?
clip + clip2
blaze077
7th August 2017, 21:35
Make sure zoom's not on fixed ratio in VSEdit.
lansing
7th August 2017, 22:32
Make sure zoom's not on fixed ratio in VSEdit.
Thanks my first problem was solved
lansing
8th August 2017, 08:20
Where do I find the list of properties of a frame? For example, I want to get the frame number of a frame. There nothing written in the documentation about this.
blaze077
8th August 2017, 08:51
It's all there in the documentation:
FrameNum (http://www.vapoursynth.com/doc/functions/framenum.html) | FrameProps (http://www.vapoursynth.com/doc/functions/frameprops.html) | SetFrameProp (http://www.vapoursynth.com/doc/functions/setframeprop.html)
A frame's properties can be accessed by using the get_frame function along with the props attribute. Like so:
src.get_frame(num).props.someFrameProperty = someValue
Reference (http://www.vapoursynth.com/doc/pythonreference.html#classes-and-functions).
lansing
8th August 2017, 09:27
It's all there in the documentation:
FrameNum (http://www.vapoursynth.com/doc/functions/framenum.html) | FrameProps (http://www.vapoursynth.com/doc/functions/frameprops.html) | SetFrameProp (http://www.vapoursynth.com/doc/functions/setframeprop.html)
A frame's properties can be accessed by using the get_frame function along with the props attribute. Like so:
src.get_frame(num).props.someFrameProperty = someValue
Reference (http://www.vapoursynth.com/doc/pythonreference.html#classes-and-functions).
That still doesn't tell me the list of properties of a frame. The problem I have is that I didn't even know the name. In my example, how do I know the name to call frame number? Is it ".props.frame_number" or ".props.frame_num", or is it "props.framenum"? The reference sure doesn't have them.
TheFluff
8th August 2017, 09:34
http://www.vapoursynth.com/doc/apireference.html#reserved-frame-properties
I'm not sure if there's a standard for anything else. The props are just a key-value map that can contain anything though so just iterate over the keys and all secrets will be revealed to you. Maybe.
lansing
8th August 2017, 22:35
http://www.vapoursynth.com/doc/apireference.html#reserved-frame-properties
I'm not sure if there's a standard for anything else. The props are just a key-value map that can contain anything though so just iterate over the keys and all secrets will be revealed to you. Maybe.
Thanks, I didn't know that they were listed on that page, I was looking all over the python reference and function reference page.
lansing
11th August 2017, 17:24
Hi I have another question, is there a function that can delete a series of ranges of frames? For example, I wanted to delete frame 1-10, 100-200 and 500-600 of a clip.
Myrsloik
11th August 2017, 17:26
Hi I have another question, is there a function that can delete a series of ranges of frames? For example, I wanted to delete frame 1-10, 100-200 and 500-600 of a clip.
Sure is. Trim and splice.
lansing
12th August 2017, 09:39
DeleteFrames (http://www.vapoursynth.com/doc/functions/deleteframes.html) should be easier to use.
Can you give an example?
tuanden0
12th August 2017, 15:28
I'm new to vapoursynth, Can someone help me?
I need to change this line in Aviysnth with aWarpSharp filter to Vapoursynth with aWarpSharp2.
I haven't used aWarpSharp2 filter with Avisynth yet :(
aWarpSharp(depth=12, thresh=0.2, cm=1)
WolframRhodium
12th August 2017, 18:52
I'm new to vapoursynth, Can someone help me?
I need to change this line in Aviysnth with aWarpSharp filter to Vapoursynth with aWarpSharp2.
I haven't used aWarpSharp2 filter with Avisynth yet :(
According to pinterf's code (https://github.com/pinterf/aWarpSharp/blob/master/src/aWarpSharp.cpp#L1699)
aWarpSharp(depth=12, thresh=0.2, cm=1)
in Avisynth is (almost) equivalent to
aWarpSharp2(depth=12, thresh=51, chroma=4)
So in VapourSynth, I think it should be
last = core.warp.AWarpSharp2(last, depth=12, thresh=51, chroma=0)
ChaosKing
12th August 2017, 18:55
I'm new to vapoursynth, Can someone help me?
I need to change this line in Aviysnth with aWarpSharp filter to Vapoursynth with aWarpSharp2.
I haven't used aWarpSharp2 filter with Avisynth yet :(
From aWarpSharp2 readme (avisynth)
Original aWarpSharp compatibility:
Mapping from original aWarpSharp parameters:
thresh = thresh*256
blur = blurlevel
depth = depth*blurlevel/2
chroma = 0->2, 1->4, 2->3
aWarpSharp(depth=12, thresh=0.2, cm=1)
You should change thresh to 51 or 52 in awarpsharp2
WolframRhodium
12th August 2017, 19:00
Can you give an example?
I'll use following code in this case:
frame_list = list(range(1, 10+1)) + list(range(100, 200+1)) + list(range(500, 600+1))
last = core.std.DeleteFrames(last, frame_list)
lansing
12th August 2017, 21:05
I'll use following code in this case:
frame_list = list(range(1, 10+1)) + list(range(100, 200+1)) + list(range(500, 600+1))
last = core.std.DeleteFrames(last, frame_list)
Thanks, this is what I'm looking for.
tuanden0
13th August 2017, 03:15
@WolframRhodium, @ChaosKing
Thank You very much :)
hydra3333
13th August 2017, 04:25
R38 is released.
The usual post (http://www.vapoursynth.com/2017/06/r38-boxblur-is-best-blur/)
Thank you for your great work !
I also appreciate your enabling people to compile their own bits (in my case avisynth_compat.cpp). Beaut !
lansing
13th August 2017, 09:45
How do I overlay text on the frame, like showing frame number of every frame? I can only think of this, but it's certainly a wrong way to do it because it ate up all my ram until the program crashed on longer videos.
for i in range (len(clip)):
if (i==0):
sub_clip = core.sub.Subtitle(clip[i], text=str(i))
else:
sub_clip += core.sub.Subtitle(clip[i], text=str(i))
AzraelNewtype
13th August 2017, 10:19
clip = core.text.FrameNum(clip)
You really might want to actually read the docs.
lansing
13th August 2017, 13:41
clip = core.text.FrameNum(clip)
You really might want to actually read the docs.
Thanks. I did read the documents many many times, I thought this function is to print the frame number out to the console, like "print(x)". And there's no sample codes showing what it does.
TheFluff
13th August 2017, 13:59
The use of the word "print" in the docs is a bit confusing, yes. It should probably clarify that it refers to printing on the video frame.
Either way though, requesting all frames in the input clip in Python and splicing one frame at a time is an extremely awkward way of doing things in VS. If you ever find yourself writing a loop that requests frames in Python, you're probably doing things wrong. Yes, iterating over a sequence is intuitive for most programmers, but in the VS world, you need to stop thinking imperative programming and start thinking functional. What you want to write is a composition of functions that does what you want, handling one or at most a few frames at a time, and leave invoking that function chain up to the client application (usually vspipe). Or in other words, start attaching callbacks to things. One more idiomatic way of reimplementing the equivalent of what core.text.FrameNum does yourself is by using FrameEval (example stolen from the docs and slightly modified):
import vapoursynth as vs
import functools
core = vs.get_core()
base_clip = core.std.BlankClip(format=vs.YUV420P8, length=1000, color=[255, 128, 128])
def PrintFrameNumber(n, clip):
return core.sub.Subtitle(clip, text=str(n))
number_clip = core.std.FrameEval(base_clip, functools.partial(PrintFrameNumber, clip=base_clip))
You might be thinking that this is just doing the same thing that you did. The difference is that here, the subtitling is done when a frame is actually requested, not when the Python script is compiled, and it can be parallelized by the VS thread pool to subtitle many frames at once.
lansing
14th August 2017, 01:25
Thanks for the explanation, that's really clear. I practiced with a few simple function, but I got the error "BuildSCClip() missing 1 required positional argument: 'f'", what does it mean?
update: I figured out the last problem. And for this one, why didn't it return a delete even clip back to me?
import vapoursynth as vs
import functools
core = vs.get_core(accept_lowercase=True)
source = abc.avi
def DeleteEven(n, clip):
if n % 2 ==0:
return core.std.DeleteFrames(clip, n)
return clip
odd = core.std.FrameEval(source, functools.partial(DeleteEven, clip=source))
odd.set_output()
tuanden0
14th August 2017, 06:17
Can someone give me an example of using TCanny to create a mask and apply it to keep detail in dark area?
I tried it myself but the output turn on black and mask :(
Here's my output:
http://i.imgur.com/yBgilc4.png
TheFluff
14th August 2017, 22:25
Thanks for the explanation, that's really clear. I practiced with a few simple function, but I got the error "BuildSCClip() missing 1 required positional argument: 'f'", what does it mean?
update: I figured out the last problem. And for this one, why didn't it return a delete even clip back to me?
import vapoursynth as vs
import functools
core = vs.get_core(accept_lowercase=True)
source = abc.avi
def DeleteEven(n, clip):
if n % 2 ==0:
return core.std.DeleteFrames(clip, n)
return clip
odd = core.std.FrameEval(source, functools.partial(DeleteEven, clip=source))
odd.set_output()
Well, I dunno. Aside from DeleteFrames taking a list of ints, not a single int (I think) that kinda looks like it should work (maybe; I'm a bit unsure of what'll happen on the last frame of the clip). I don't think "source = abc.avi" is what's actually in your script though. What does happen when you try to run it?
lansing
14th August 2017, 22:55
Well, I dunno. Aside from DeleteFrames taking a list of ints, not a single int (I think) that kinda looks like it should work (maybe; I'm a bit unsure of what'll happen on the last frame of the clip). I don't think "source = abc.avi" is what's actually in your script though. What does happen when you try to run it?
There's no error, it skips the first return and just do the second return, which give me back the source clip.
TheFluff
14th August 2017, 23:28
Are you sure about that? I suspect the problem might be that calling deleteframes there doesn't do what you think it does. It won't change the length of the clip returned by frameeval, I'm pretty darn sure. What I'd expect it to do is to replace even numbered frames with the following frame.
lansing
14th August 2017, 23:55
Are you sure about that? I suspect the problem might be that calling deleteframes there doesn't do what you think it does. It won't change the length of the clip returned by frameeval, I'm pretty darn sure. What I'd expect it to do is to replace even numbered frames with the following frame.
Oh yes it did replace the even number frame with the odd one.
So I can't delete frames with arbitrary functions using FrameEval?
Myrsloik
15th August 2017, 01:55
Oh yes it did replace the even number frame with the odd one.
So I can't delete frames with arbitrary functions using FrameEval?
If you're clever you can reorder things. Note that frameeval takes a clip argument that's only used to set the output format and length. Adjist the total number of frames there.
Probably what you wanted to do. Halve the framecount and you're done.
def DeleteEven(n, clip):
return clip[n // 2]
Can also be expressed as clip[::2] without resorting to frameeval at all.
TheFluff
15th August 2017, 11:48
Oh yes it did replace the even number frame with the odd one.
So I can't delete frames with arbitrary functions using FrameEval?
You can't change the length of the clip, no. When you use FrameEval, the frame number requested from the clip you return from the evaluator function doesn't change. When the client application requests (say) frame 4, and your evaluator function gets n = 4 as an argument and returns a clip that's the same as the original but with frame 4 deleted, FrameEval requests frame 4 from that clip, but since you deleted the original frame 4, the frame now numbered 4 in that clip is number 5 in the original clip. That's why even numbered frames get replaced with the following even one.
The thing Myrsloik did relies on the fact that requesting a frame beyond the end of a clip just returns the last frame, so you get back a clip with the same length as the original, but every frame after the halfway point is just the same as the last.
Selur
16th August 2017, 18:54
Is there something like ffmpegs shuffleframes (https://www.ffmpeg.org/ffmpeg-all.html#toc-shuffleframes) in Vapoursynth? (A filter which allows so swap and drop frames by a given pattern?)
Myrsloik
16th August 2017, 18:56
Is there something like ffmpegs shuffleframes (https://www.ffmpeg.org/ffmpeg-all.html#toc-shuffleframes) in Vapoursynth? (A filter which allows so swap and drop frames by a given pattern?)
See frameeval. Especially the most recent posts. A simple callback and you can apply any remapping.
sneaker_ger
16th August 2017, 19:00
Isn't it easier with SelectEvery?
Myrsloik
16th August 2017, 19:03
Isn't it easier with SelectEvery?
If your pattern can be expressed with it. Yes. But it gets kinda iffy for 1000+ frame cycles and can't do stuff like drop all prime number frames.
Selur
16th August 2017, 19:05
SelectEvery could do the dropping, but not the shuffling, or am I misunderstanding the filter?
Myrsloik
16th August 2017, 19:06
SelectEvery could do the dropping, but not the shuffling, or am I misunderstanding the filter?
Correct, no shuffle.
sneaker_ger
16th August 2017, 19:13
I think Selur means "shuffle" as in "re-order with fixed pattern", not "re-order randomly". :confused:
So it should be able to do everything ffmpeg's shuffleframes can do.
Selur
16th August 2017, 19:17
Yes, given a pattern like for example "0 2 7 5 4 3 1 6 8" would do some crazy reordering on each set of 9 frames.
Myrsloik
16th August 2017, 19:20
Yes, given a pattern like for example "0 2 7 5 4 3 1 6 8" would do some crazy reordering on each set of 9 frames.
I think that works. Try it and see. I probably made selectevery take the order into account.
feisty2
18th August 2017, 07:22
@Myrsloik
can you write something to convert a vaporsynth video clip to a numpy array and a reverse conversion like-wise? so, like
forward conversion: video clip -> numpy.array((framecount, height, width, channel))
reverse conversion: numpy.array((framecount, height, width, channel)) -> video clip
the conversion should only support GRAYS/RGBS/YUV444PS inputs obviously
the thing is... I wanna pre-process my image samples with vaporsynth before feeding them to keras
I could use vspipe to generate raw files and load them with numpy.memmap for now, but it sucks
Myrsloik
18th August 2017, 11:15
All frames are exposed as a memoryview. Just use get_frame(). I don't know the exact python way but I'm very certain you can create numpy arrays from memoryviews. Or maybe it already is one.
For the reverse you can probably use modifyframe (see the insane filter writing in python thread). No idea what the speed will be like, probably not that bad as long as you find the appropriate.
Or do it all in a single modifyframe callback. I have no idea what kind of preprocessing you want to do.
feisty2
18th August 2017, 13:57
I have no idea what kind of preprocessing you want to do.
say I wanna do a super resolution neural net with keras, first I would need to generate the corresponding low resolution version of the high resolution samples, and for that I need resampling filters.
there's scipy.misc.imresize but it's pretty rudimentary comparing to fmtc, it has very few resampling kernels, doesn't even have spline! and you can't tweak stuff like "taps" or whatever for each kernel, with fmtc I got control over everything, I can even create my own resampling kernel or resize under linear light
so I want vaporsynth (filters) to do stuff like that
concretely, something like
def GenLowResSamples(samples):
core = vs.get_core()
samples = ArrayToVideo(samples) #reverse conversion
samples = core.fmtc.resample(samples, sample.width//2, sample.height//2, kernel="sinc", taps=128, fulls=True, fulld=True)
samples = core.fmtc.resample(samples, sample.width*2, sample.height*2, kernel="sinc", taps=128, fulls=True, fulld=True)
samples = VideoToArray(samples) #forward conversion
return samples
lansing
20th August 2017, 01:42
Hi I'm trying to frame serve a video from Adobe Premiere to Vapoursynth using this frame server called advanced frame server, when I try to grab it with avisource, the editor crashed and I got this error "setVideoInfo: The frame rate specified by AVISource must be a reduced fraction. (Instead, it is 23976/1000.)", and there's no option in avisource to change it.
Selur
20th August 2017, 08:30
I think that works. Try it and see. I probably made selectevery take the order into account.
Works fine! Thanks to myrsloik and sneaker_ger for the help and pointing to SelectEvery() ! :D
shekh
23rd August 2017, 02:24
Tried to implement r210 DIB. Have issue with VapourSynth-R38
r = core.avisource.AVISource('rgb.avi')
r = core.resize.Point(r, format=vs.RGB30)
r.set_output()
Source is 784x400 but appears to have 832*4 pitch from vs (I derived it from total size and it works).
Is this error on output or there is some rule for it?
Myrsloik
23rd August 2017, 06:47
Hi I'm trying to frame serve a video from Adobe Premiere to Vapoursynth using this frame server called advanced frame server, when I try to grab it with avisource, the editor crashed and I got this error "setVideoInfo: The frame rate specified by AVISource must be a reduced fraction. (Instead, it is 23976/1000.)", and there's no option in avisource to change it.
Wil be fixed in the next version
Myrsloik
23rd August 2017, 06:59
Tried to implement r210 DIB. Have issue with VapourSynth-R38
r = core.avisource.AVISource('rgb.avi')
r = core.resize.Point(r, format=vs.RGB30)
r.set_output()
Source is 784x400 but appears to have 832*4 pitch from vs (I derived it from total size and it works).
Is this error on output or there is some rule for it?
Pitch is a multiple of 256 bytes. Can't even find a source on it rogjt now.
shekh
23rd August 2017, 09:35
Pitch is a multiple of 256 bytes. Can't even find a source on it rogjt now.
Good, found it in ffmpeg code.
Myrsloik
23rd August 2017, 09:39
Good, found it in ffmpeg code.
Note that you can't always assume it because for v210 and r210 and just about every format with special stride requirements at least half the software gets it wrong. Fun fact.
Myrsloik
24th August 2017, 18:36
Here's R39 test1 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R39-test1.exe)
It would be a proper RC if it wasn't for a bit more optimization and refactoring I want to do in the 3x3 pixel filter part of the code (aka the previously known as genericfilters part).
Glorious changes:
r39:
fixed missing fps correction in avisource that would produce an error with some files
switched to nasm as the assembler
updated to zimg v2.6
visual studio runtime detection is improved in the installer, it should no longer attempt re-installs when a newer version is present
minor optimization in vspipe, you can now output blankclip into the void much faster
memory will now be 64 byte aligned on systems with avx512 support
added swapn and dupn operators to expr
reverted the argument handling in levels, arguments no longer take a 3 plane list due it making no sense when combined with the planes argument
optimized levels, the integer version is now implemented with a lut and the floating point version is faster when gamma=1.0
improved get_outputs() in python (stuxcrystal)
format objects can now be cast to int which will return the format id (stuxcrystal)
added method to make it easier to query formats from python (stuxcrystal)
made it possible to install the python part as a module (stuxcrystal)
lansing
24th August 2017, 23:28
Here's R39 test1 (https://dl.dropboxusercontent.com/u/73468194/VapourSynth-R39-test1.exe)
It would be a proper RC if it wasn't for a bit more optimization and refactoring I want to do in the 3x3 pixel filter part of the code (aka the previously known as genericfilters part).
Glorious changes:
r39:
fixed missing fps correction in avisource that would produce an error with some files
switched to nasm as the assembler
updated to zimg v2.6
visual studio runtime detection is improved in the installer, it should no longer attempt re-installs when a newer version is present
minor optimization in vspipe, you can now output blankclip into the void much faster
memory will now be 64 byte aligned on systems with avx512 support
added swapn and dupn operators to expr
reverted the argument handling in levels, arguments no longer take a 3 plane list due it making no sense when combined with the planes argument
optimized levels, the integer version is now implemented with a lut and the floating point version is faster when gamma=1.0
improved get_outputs() in python (stuxcrystal)
format objects can now be cast to int which will return the format id (stuxcrystal)
added method to make it easier to query formats from python (stuxcrystal)
made it possible to install the python part as a module (stuxcrystal)
My video from frameserve is able to open now, but it was turned upside down
Myrsloik
25th August 2017, 12:07
What's the format? Can I have a sample of the input? 10 frames is enough
lansing
25th August 2017, 14:06
What's the format? Can I have a sample of the input? 10 frames is enough
The video file was a dummy generated by the frame server, here's the video info
Video
ID : 0
Format : VFW
Codec ID : DFSC
Codec ID/Info : DebugMode FrameServer VFW
Duration : 24 min 13 s
Bit rate : 767 b/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 23.976 (24000/1001) FPS
Bits/(Pixel*Frame) : 0.000
Stream size : 136 KiB (14%)
You can reproduce it with Premiere and this frame server (https://sourceforge.net/projects/advancedfs/). Media player classic play the file with no problem.
Myrsloik
25th August 2017, 18:45
The video file was a dummy generated by the frame server, here's the video info
Video
ID : 0
Format : VFW
Codec ID : DFSC
Codec ID/Info : DebugMode FrameServer VFW
Duration : 24 min 13 s
Bit rate : 767 b/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 23.976 (24000/1001) FPS
Bits/(Pixel*Frame) : 0.000
Stream size : 136 KiB (14%)
You can reproduce it with Premiere and this frame server (https://sourceforge.net/projects/advancedfs/). Media player classic play the file with no problem.
I said a sample. As in a piece of raw video. Not going to install that mess.
lansing
25th August 2017, 19:16
I said a sample. As in a piece of raw video. Not going to install that mess.
The frameserver export a dummy avi while Premiere was still on, then I loaded that dummy avi into vs. The problem was not on any particular video that was frameserved, as I tried on a couple of different videos already, so there's no sample I can give.
lansing
25th August 2017, 22:19
I found another problem with avisource, it couldn't open avi with Lagarith codec in RGB colorspace, it only works for lagarith yv12. I got this error "AttributeError: 'list' object has no attribute 'set_output'".
sample (http://www.mediafire.com/file/4ixy801ro2j2v14/lag_rgb.avi)
Myrsloik
25th August 2017, 22:21
I found another problem with avisource, it couldn't open avi with Lagarith codec in RGB colorspace, it only works for lagarith yv12. I got this error "AttributeError: 'list' object has no attribute 'set_output'".
sample (http://www.mediafire.com/file/4ixy801ro2j2v14/lag_rgb.avi)
It works. You get two clips back in a list when there's an alpha plane too. Set alpha=false if you don't need it at all.
lansing
25th August 2017, 22:30
It works. You get two clips back in a list when there's an alpha plane too. Set alpha=false if you don't need it at all.
There is no alpha option in avisource
Myrsloik
25th August 2017, 22:32
There is no alpha option in avisource
Ignore the part about that then. Confused it with ffms2. clip[0] and you're good.
lansing
25th August 2017, 22:46
Ignore the part about that then. Confused it with ffms2. clip[0] and you're good.
Ok the video shows up now, but now I got the upside down problem, probably the same problem as I reported earlier.
Myrsloik
25th August 2017, 22:53
With rgb lagarith? I'll test that again then. Just use flipvertical for now.
lansing
2nd September 2017, 23:12
I just saved a rgb curve file from photoshop (.acv), is there a function to load this into vapoursynth?
Myrsloik
2nd September 2017, 23:19
I just saved a rgb curve file from photoshop (.acv), is there a function to load this into vapoursynth?
No. Save it as a cube lut instead if possible because that is supported.
lansing
3rd September 2017, 00:41
Photoshop doesn't have the option to output the curve as lut file, and I couldn't find a acv to lut converter.
I'll figure out other way to output it as lut then.
poisondeathray
3rd September 2017, 01:27
Photoshop doesn't have the option to output the curve as lut file, and I couldn't find a acv to lut converter.
I'll figure out other way to output it as lut then.
what?
https://helpx.adobe.com/photoshop/using/export-color-lookup-tables.html
The other option is through avisynth gicocu , then import the avs with AVISource in vapoursynth
lansing
3rd September 2017, 01:50
what?
https://helpx.adobe.com/photoshop/using/export-color-lookup-tables.html
The other option is through avisynth gicocu , then import the avs with AVISource in vapoursynth
I'm don't have cc, I'm using cs6, it doesn't have it.
The avs one is outdated, the curve file photoshop uses now is .acv instead of .amp.
poisondeathray
3rd September 2017, 01:59
I'm don't have cc, I'm using cs6, it doesn't have it.
The avs one is outdated, the curve file photoshop uses now is .acv instead of .amp.
Couldn't you just replicate it in gimp ? Use gimp curve with gicocu?
poisondeathray
3rd September 2017, 02:08
The avs one is outdated, the curve file photoshop uses now is .acv instead of .amp.
You can export .amp instead of .acv by switching to the pencil tool. I don't have PS CS6 handy but it works in CC
https://www.photography-forums.com/threads/create-amp-file-from-acv-file.69289/
lansing
3rd September 2017, 08:33
You can export .amp instead of .acv by switching to the pencil tool. I don't have PS CS6 handy but it works in CC
https://www.photography-forums.com/threads/create-amp-file-from-acv-file.69289/
Yes I was able save it as amp file now. But the filter is giving me a headache trying to get it to work.
Got an error "vapoursynth.Error: Invalid avisynth colorspace in one of the input clips" when trying to load it into vs
cur_path = r'blah.amp'
clip = core.ffms2.Source(blah)
clip = core.resize.Bicubic(clip, format=vs.RGB24)
cc = core.avs.GiCoCu(clip, cur_path)
And then when I try to open it with avspmod in avs+ the program crashed
cur_path ="blah.amp"
GiCoCu(cur_path, alpha=False, photoshop=False)
poisondeathray
3rd September 2017, 15:14
Maybe because GiGoCu is avisynth 2.5 plugin ? Or maybe you're using 64bit vpy ?
Probably the former because I can't even get it to work in in 32bit avisynth . Unless there is another version somewhere ?
What about gradcurve, the vdub port for vapoursynth ?
I didn't test it yet, but in the example, he's using an .amp file
https://github.com/xekon/GradCurve
EDIT:
^ it worked ok for 64bit version with both amp and acv.
No error messages pop up for path errors; at first I was wondering why it wasn't working.
lansing
3rd September 2017, 16:21
Maybe because GiGoCu is avisynth 2.5 plugin ? Or maybe you're using 64bit vpy ?
Probably the former because I can't even get it to work in in 32bit avisynth . Unless there is another version somewhere ?
What about gradcurve, the vdub port for vapoursynth ?
I didn't test it yet, but in the example, he's using an .amp file
https://github.com/xekon/GradCurve
Wow nice find, didn't know that we have the curve filter for vs.
The filter work both on amp and acv, no more work around or conversion.
cur_path = r'test.amp'
clip = core.ffms2.Source(abc.mp4)
clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.RGB24)
clip = core.grad.Curve(clip, cur_path, ftype=1, pmode=1) # ftype 1 for amp, 2 for acv
Found some missing safety checks though, if I declared a wrong type in the argument for the input curve file, the editor will crash. These are the 2 combinations I found that crash, don't know if there's more.
cur_path = r'test.amp'
clip = core.grad.Curve(clip, cur_path, ftype=2, pmode=1)
cur_path = r'test.acv'
clip = core.grad.Curve(clip, cur_path, ftype=6, pmode=1)
lansing
3rd September 2017, 18:04
um, actually the filter was listed on the vapoursynth plugin page months ago...
But its description is meaningless, it's a curve reader rather than anything else that was said on the official thread (https://forum.doom9.org/showthread.php?t=174096).
lansing
4th September 2017, 06:53
Hi I'm getting this green vertical bar on the right of my frame after using resize on the video, and there are random crashes for no reason.
clip = core.resize.Bicubic(clip, width=640, height=480)
here's the video sample that's causing the problem
http://www.mediafire.com/file/p9jgodk3mwf9loo/snow.avi
LigH
4th September 2017, 12:52
Without downloading it, just a guess: Does it have an odd width?
poisondeathray
4th September 2017, 14:22
It's 720x416 . xvid.
Crashes with all source filters, ffms2, l-smash, avisource in vapoursynth R39 x64. Even crashes feeding avs using avisource . (avs works independently, avs+resize works too, and feeding the 640x480 bicubic resized from avisynth works)
poisondeathray
4th September 2017, 14:32
But resizing using fmtconv (bicubic) works... so it's likely related to the internal zimg implementation
lansing
4th September 2017, 15:23
Without downloading it, just a guess: Does it have an odd width?
Ok after some further testings I found the point where the problem occurs.
It's when the width of the input video is smaller than 720 pixel. All input clip with width bigger than 720 will work, couldn't find the exact crash pattern. Some width that is smaller than 720 may work, some may crash.
This will work:
clip = core.std.BlankClip(width=1920, height=1080, length=10000)
clip = core.resize.Bicubic(clip, width=748, height=400)
clip = core.resize.Bicubic(clip, width=740, height=480)
This will crash or give me a green right bar for an actual video:
clip = core.std.BlankClip(width=1920, height=1080, length=10000)
clip = core.resize.Bicubic(clip, width=710, height=400)
clip = core.resize.Bicubic(clip, width=740, height=480)
poisondeathray
4th September 2017, 15:32
This will crash or give me a green right bar for an actually video:
clip = core.std.BlankClip(width=1920, height=1080, length=10000)
clip = core.resize.Bicubic(clip, width=710, height=400)
clip = core.resize.Bicubic(clip, width=740, height=480)
This works for me, I think because it's in RGB. If you use format=vs.YUV420P8 for BlankClip, I get green bar
Are_
4th September 2017, 18:05
2.6.1
depth: fix SSE2 conversions with mod4 and mod8 widths (introduced in 2.6)
Looks like it is fixed in git, because some green bar problems disappeared, but I still get segfaults when trying to run the original line.
import vapoursynth as vs
core = vs.get_core()
clip = core.ffms2.Source('snow.avi')
clip = core.resize.Bicubic(clip, width=640, height=480)
clip.set_output()
Anybody else?
Are_
4th September 2017, 18:13
This script produces a segfault too. For me this is a little random, and lower lengths are more prone to produce a segfault.
import vapoursynth as vs
core = vs.get_core()
clip = core.std.BlankClip(width=720, height=416, length=62)
clip = core.resize.Bicubic(clip, width=640, height=480)
clip.set_output()
Because this is random for me, have anybody else this problem? Or is maybe my hardware / software builds?
Myrsloik
4th September 2017, 18:20
R39 test2 (https://www.dropbox.com/s/bzs8qoa174k11d8/VapourSynth-R39-test2.exe?dl=1)
Should fix the resizing errors
lansing
4th September 2017, 18:31
R39 test2 (https://www.dropbox.com/s/bzs8qoa174k11d8/VapourSynth-R39-test2.exe?dl=1)
Should fix the resizing errors
The random crash is gone, but the green bar is still there for the sample video, sometime blue sometime red.
Myrsloik
4th September 2017, 21:37
R39 test3 (https://www.dropbox.com/s/fsdll7igx16cgg5/VapourSynth-R39-test3.exe?dl=1)
Now with one more resizer fix
lansing
4th September 2017, 22:08
R39 test3 (https://www.dropbox.com/s/fsdll7igx16cgg5/VapourSynth-R39-test3.exe?dl=1)
Now with one more resizer fix
Now the crash came back with the green bar
Myrsloik
4th September 2017, 22:20
Now the crash came back with the green bar
Does ot work properly with R38?
lansing
4th September 2017, 22:40
Does ot work properly with R38?
Just tried it, it works fine in R38
Are_
4th September 2017, 23:23
Latest update to zimg fixed this for me, no more segfaults here.
Myrsloik
5th September 2017, 14:22
R39 test4 (https://www.dropbox.com/s/qsukynipemu18j9/VapourSynth-R39-test4.exe?dl=1)
I miscompiled test3 so that's why it didn't work. That's what happens when you have to reinstall everything on a new computer...
lansing
5th September 2017, 14:50
R39 test4 (https://www.dropbox.com/s/qsukynipemu18j9/VapourSynth-R39-test4.exe?dl=1)
I miscompiled test3 so that's why it didn't work. That's what happens when you have to reinstall everything on a new computer...
Yes the problem is fixed now, thanks
deniskx
7th September 2017, 10:40
Hello. You can call me stupid, but I broke my head. I'm pretty good in Avisynth, but in Vapoursynth is a beginner. I have Xubuntu 16.04 x86, Vapoursynth from PPA. I need to connect avisynth TIVTC.dll plugin, because of 2-pass mode=2 and mode=4 (I have a complex video), which is not in VIVTC. And I can not.
import vapoursynth as vs
core = vs.get_core()
core.avs.LoadPlugin(TIVTC.dll)
video = core.ffms2.Source(source=input.mkv)
video = core.avs.TDecimate()
video.set_output()
vspipe --y4m script.vpy - | ffmpeg -i pipe: output.mkv
writes errors like that:
No attribute with the name avs exists. Did you mistype a plugin namespace
Help me, please.
tuanden0
7th September 2017, 16:00
Hello. You can call me stupid, but I broke my head. I'm pretty good in Avisynth, but in Vapoursynth is a beginner. I have Xubuntu 16.04 x86, Vapoursynth from PPA. I need to connect avisynth TIVTC.dll plugin, because of 2-pass mode=2 and mode=4 (I have a complex video), which is not in VIVTC. And I can not.
import vapoursynth as vs
core = vs.get_core()
core.avs.LoadPlugin(TIVTC.dll)
video = core.ffms2.Source(source=input.mkv)
video = core.avs.TDecimate()
video.set_output()
vspipe --y4m script.vpy - | ffmpeg -i pipe: output.mkv
writes errors like that:
No attribute with the name avs exists. Did you mistype a plugin namespace
Help me, please.
Try add "-" after output:
vspipe --y4m script.vpy - | ffmpeg -i pipe: output.mkv -
:D
Myrsloik
7th September 2017, 17:34
Hello. You can call me stupid, but I broke my head. I'm pretty good in Avisynth, but in Vapoursynth is a beginner. I have Xubuntu 16.04 x86, Vapoursynth from PPA. I need to connect avisynth TIVTC.dll plugin, because of 2-pass mode=2 and mode=4 (I have a complex video), which is not in VIVTC. And I can not.
import vapoursynth as vs
core = vs.get_core()
core.avs.LoadPlugin(TIVTC.dll)
video = core.ffms2.Source(source=input.mkv)
video = core.avs.TDecimate()
video.set_output()
vspipe --y4m script.vpy - | ffmpeg -i pipe: output.mkv
writes errors like that:
No attribute with the name avs exists. Did you mistype a plugin namespace
Help me, please.
You can't load avisynth plugins in linux. If that's what you're trying to do.
LigH
7th September 2017, 19:38
Maybe not yet (https://github.com/taviso/loadlibrary) ... :p
Myrsloik
7th September 2017, 19:41
Maybe not yet (https://github.com/taviso/loadlibrary) ... :p
Not by me. Proper ports are better anyway. You'd still need x64 versions of everything which not all things have.
I have a dream that one day an avisynth user will suggest doing the right thing and not just another shitty compatibility hack.
LigH
7th September 2017, 19:46
Of course. A cross-platform portable loadable library format ... sigh ... Mono?!
Myrsloik
7th September 2017, 19:47
Of course. A cross-platform portable loadable library format ... sigh ... Mono?!
It's called C. With a system compiler. Works everywhere.
LigH
7th September 2017, 20:03
May there be no system dependent function calls. Or references to external libraries (like FFT3D). Do it yourself ... everything ... from scratch. Or from other OpenSource projects. Rely on the community! Closed Source is so ... last millennium. ;)
https://cosgan.de/images/smilie/nahrung/a015.gif
deniskx
8th September 2017, 13:56
You can't load avisynth plugins in linux.
Thanks. This should be specified here (http://www.vapoursynth.com/doc/functions/loadpluginavs.html) so as not to mislead people.
What the point of Vapoursynth then? Another fork? Windows has a working learning Avisynth. Linux does not have avs plug-ins, so Avisynth under Wine is the best solution then.
Myrsloik
8th September 2017, 14:02
Thanks. This should be specified here (http://www.vapoursynth.com/doc/functions/loadpluginavs.html) so as not to mislead people.
What the point of Vapoursynth then? Another fork? Windows has a working learning Avisynth. Linux does not have avs plug-ins, so Avisynth under Wine is the best solution then.
Native binaries are native only. You should definitely know this since you've heard about wine.
VapourSynth also isn't a fork. The point is code quality, portability and proper multithreading support. And more flexible scripting too.
And no, not caving in to your documentation demands. It shall remain unchanged.
feisty2
8th September 2017, 14:59
Thanks. This should be specified here (http://www.vapoursynth.com/doc/functions/loadpluginavs.html) so as not to mislead people.
What the point of Vapoursynth then? Another fork? Windows has a working learning Avisynth. Linux does not have avs plug-ins, so Avisynth under Wine is the best solution then.
vaporsynth got the ability (std.Expr) to evaluate RPN expressions on 32 bits floating point precision video clips and take (practically) arbitrary amount of clips as the input, while avisynth got the naďve mt_lut(xyz) that takes up to 3 clips and only works with 8 bits low precision clips
that's enough for me to sentence avisynth to death
TheFluff
8th September 2017, 16:14
What the point of Vapoursynth then?
Unlike Avisynth, VS isn't completely awful.
poisondeathray
8th September 2017, 16:55
But avisynth has things that vapoursynth can't do right now. Like audio.
So not completely aweful :)
mparade
10th September 2017, 14:46
Can someone help why it is not possible to feed a HDR10 encoded content to x265 to reencode using DGDecNV (latest with HDR10 support) and Vapoursynth?
Error message as follows:
x265 [error]: unable to open input file
Author of DGDecNV suggested asking the Vapoursynth guys about it. What information should be provided for support?
I am not a programmer, not using Vapoursynth directly but perhaps can provide all the info required to find the reason for the problem.
Please help.
stax76
10th September 2017, 15:03
@mparade
Your VS script would be a start.
mparade
10th September 2017, 16:00
@mparade
Your VS script would be a start.
Please find as an attachement.
http://mammutmail.com/hu/download/b4fd9283677f21bb3b8fff07f65d0611
LigH
10th September 2017, 16:01
Attachments need to be approved here. Better use any pastebin if you can, or the CODE bbTag.
Selur
10th September 2017, 16:10
@mparade: Do you get an error when you open the script with inside the Vapoursynth editor, or through:
"C:\PROGRA~1\Hybrid\VAPOUR~1\vspipe.exe" --info "PATH to Script"
if you do you might want to share that info,...
mparade
10th September 2017, 16:35
@mparade: Do you get an error when you open the script with inside the Vapoursynth editor, or through:
"C:\PROGRA~1\Hybrid\VAPOUR~1\vspipe.exe" --info "PATH to Script"
if you do you might want to share that info,...
In VS editor there seems to be no error.
In Windows command line I got: "No output file specified"
sneaker_ger
10th September 2017, 16:37
You need to specify a hyphen ("-") for the vsipe command.
Selur
10th September 2017, 16:48
Oh, sorry, sneaker_ger is right I forgot to write it down. :)
"C:\PROGRA~1\Hybrid\VAPOUR~1\vspipe.exe" --info "PATH to Script" -
Cu Selur
mparade
10th September 2017, 17:03
Oh, sorry, sneaker_ger is right I forgot to write it down. :)
"C:\PROGRA~1\Hybrid\VAPOUR~1\vspipe.exe" --info "PATH to Script" -
Cu Selur
Then:
1. Message on command line: setVideoInfo: The VSFormat pointer passed by DGSource was not obtained from registerFormat() or getFormatPreset().
2. I get bug report from my Windows 10 64 bit OS:
Operation of VSPipe.exe has been terminated -- close program button inside the bug report window needs to click on
Selur
10th September 2017, 17:10
setVideoInfo: The VSFormat pointer passed by DGSource was not obtained from registerFormat() or getFormatPreset().
That either sounds like a bug in DGSource or a bug/limitation in Vapoursynth 'avs'-filter handling capabilities.
stax76
10th September 2017, 17:11
I've tried:
import vapoursynth as vs
core = vs.get_core()
core.avs.LoadPlugin(r"D:\Software\Medien\DGDecNV\DGDecodeNV.dll")
clip = core.avs.DGSource(r"D:\Video\Samples\4K\HEVC 10-bit_temp\HEVC 10-bit.dgi", fulldepth = True)
clip.set_output()
result:
Unhandled exception at 0x00007FFB268634BE (ucrtbase.dll) in Veedub64.exe: Fatal program exit requested.
mparade
12th September 2017, 20:02
The answer to this maybe as simple as whether Vapoursynth supports HDR from Avisynth source filters or not. Or maybe it can have problem with 16 bit and it needs to be converted to 10 bit first.
Selur
12th September 2017, 20:06
Problem is:
a. DG probably will not create a native Vapoursynth version of DGSource.
b. I would understand the Vapoursynth developers when they say that they won't support anything but 8bit from Avisynth filters.
-> I keep my fingers crossed. :)
Myrsloik
12th September 2017, 22:28
Problem is:
a. DG probably will not create a native Vapoursynth version of DGSource.
b. I would understand the Vapoursynth developers when they say that they won't support anything but 8bit from Avisynth filters.
-> I keep my fingers crossed. :)
I already support all the avs+ formats. This is something else. I also have no intention of paying (I mean compulsory donation hahahahaha) to debug this. Or buying an nvidia graphics card for that matter.
Let the butthurt commence!
Logan9778
13th September 2017, 07:40
Yeah, just love that "compulsory donation". :p However, in Nvidia's defense ( as much as they charge for a dang video card ), using the GPU did significantly speed up my AviSynth / X264 output.
lansing
13th September 2017, 16:15
How do I apply filter to a range of frames on a video? I have a list of range and a list of different setting of a filter, and have each setting applies to each range of frames.
ranges = [[0,100],[500,1000],[1500,10000]]
settings = [1,2,3]
clip = somefunc(setting=settings[0]) # applies to frame 0-100
clip = somefunc(setting=settings[1]) # applies to frame 500-1000
This looks like a task for the FrameEval but it doesn't allow me to set the range of frames as input.
Myrsloik
13th September 2017, 17:53
How do I apply filter to a range of frames on a video? I have a list of range and a list of different setting of a filter, and have each setting applies to each range of frames.
ranges = [[0,100],[500,1000],[1500,10000]]
settings = [1,2,3]
clip = somefunc(setting=settings[0]) # applies to frame 0-100
clip = somefunc(setting=settings[1]) # applies to frame 500-1000
This looks like a task for the FrameEval but it doesn't allow me to set the range of frames as input.
Trim and splice. Like avisynth.
splinter98
13th September 2017, 18:19
Trim and splice. Like avisynth.
Yep, but unlike avisynth you can sprinkle some python magic (untested):
def gen_clip(clip, ranges, settings):
i = 0
for rng, setting in ranges:
start, end = rng
if start > i:
yield clip[i:start], None
yield clip[start:end]), setting
i = end
if end < len(clip):
yield clip[end:]
clip = core.std.Splice([somefunc(c, setting=s) for c,s in gen_clip(clip, ranges, settings) if s is not None else c])
manono
13th September 2017, 20:33
Trim and splice. Like avisynth.
Except AviSynth has ReplaceFramesSimple (http://www.avisynth.nl/users/stickboy/RemapFrames.zip):
A=somefunc(settings)
ReplaceFramesSimple(Last,A,Mappings="[0 500]")
It is, admittedly, even more helpful when you have multiple instances of needing the same settings over a limited range of frames but I couldn't live without it and find the more traditional Trim/Splice method pretty clunky and completely unworkable when there are a lot of different filters with different settings to use over a limited range of frames. It won't work in Vapoursynth without changes being made?
http://www.avisynth.nl/users/stickboy/
Are_
13th September 2017, 23:42
And in vapoursynth you have https://github.com/Irrational-Encoding-Wizardry/Vapoursynth-RemapFrames and https://github.com/Irrational-Encoding-Wizardry/fvsfunc/blob/master/fvsfunc.py#L825 and only god know how many more python functions scattered around the internet.
TheFluff
14th September 2017, 00:32
Yes. You have the Python standard library at your fingertips and the VS clips are list-like objects. There is absolutely no need for plugins to muck around with frame orders or applying filters to parts of clips.
If I read the original request correctly you just want to use zip() (https://docs.python.org/3/library/functions.html#zip) to pair up frame ranges with their arguments. That's pretty much a oneliner, something like
ranges = [(0, 200), (300, 400)]
settings = [{'argument': 3}, {'argument': 4}]
clip = core.std.splice([core.foo.Bar(clip, **args)[start:end] for (start, end), args in zip(ranges, settings)])
Not tested, of course.
Python syntax abuse used:
- Double splat operator (**), or "argument dict unpacking": if you have a function in Python that takes two named arguments a and b, and a dict like {"a": 3, "b": 4}, calling func(**argsDict) will end up calling the function with the a parameter being 3 and the b parameter being 4. Very handy, that. Use single splat (*) for similarly translating a list to positional arguments. You can use both at the same time, as in func(*positional, **named).
- List comprehensions, as in [str(x) for x in [0, 1, 2]] - a handy way to write oneliners and you should use them at every opportunity to make sure nobody can read your code.
- Nested destructuring (or maybe it's more appropriately called "unpacking" in Python terminology?) assignment of iterator variables, as in:
[str(c) for (b, c), a in [((3, 5), 6)]]
# returns ['5']
lansing
14th September 2017, 00:55
Yes. You have the Python standard library at your fingertips and the VS clips are list-like objects. There is absolutely no need for plugins to muck around with frame orders or applying filters to parts of clips.
If I read the original request correctly you just want zip() (https://docs.python.org/3/library/functions.html#zip) to pair up frame ranges with their arguments. That's pretty much a oneliner, something like
ranges = [(0, 200), (300, 400)]
settings = [{'argument': 3}, {'argument': 4}]
clip = core.std.splice([core.foo.Bar(clip[start:end], **args) for (start, end), args in zip(ranges, settings)])
Not tested, of course.
Python syntax abuse used:
- Double splat operator (**), or "argument dict unpacking": if you have a function in Python that takes two named arguments a and b, and a dict like {"a": 3, "b": 4}, calling func(**argsDict) will end up calling the function with the a parameter being 3 and the b parameter being 4. Very handy, that. Use single splat (*) for similarly translating a list to positional arguments. You can use both at the same time, as in func(*positional, **named).
- List comprehensions, as in [str(x) for x in [0, 1, 2]] - a handy way to write oneliners and you should use them at every opportunity to make sure nobody can read your code.
- Nested destructuring (or maybe it's more appropriately called "unpacking" in Python terminology?) assignment of iterator variables, as in:
[str(c) for (b, c), a in [((3, 5), 6)]]
# returns ['5']
I did use zip() in a for loop similar, but then that will only append clips with frames that were specified in the ranges. In this example, I want to apply filter on frame 0-200 and 300-400, and have frame 201-299 and frames after 400 untouched.
Reading through the filter description, looks like ReplaceFrames is the function for this task.
lansing
14th September 2017, 15:30
Ok I got it working with ReplaceFramesSimple in the remapframes package
ranges = [[0,200],[300,400],[1000,10000]]
settings = [1,2,3]
for r, s in zip(ranges, settings):
temp = somefunc(clip, setting=s)
map_string = '[{} {}]'.format(r[0], r[1])
final_clip = core.remap.Rfs(clip, temp, mappings=map_string, mismatch=False)
Artofeel
19th September 2017, 13:04
AVFS is not working since pfmap-185 version
just closes right after start mounting (VapourSynth-R39-test4 \ VapourSynth-R38)
pfmap-184 is last working
I'm only one who used that feature?..
Myrsloik
19th September 2017, 13:08
AVFS is not working since pfmap-185 version
just closes right after start mounting (VapourSynth-R39-test4 \ VapourSynth-R38)
pfmap-184 is last working
I'm only one who used that feature?..
I'll give it a try then. Note that you don't even need it since a branded pismo library is also included in the installer.
Artofeel
19th September 2017, 15:08
Note that you don't even need it since a branded pismo library is also included in the installer.yeah, but I use pismo
like store thousands of images in one .pfo file
so I need new version of it due to some bugfixes
lansing
24th September 2017, 02:18
I'm trying to load a virtualdub filter through the avs loader, and I'm getting the error "Plugin C:/Program Files (x86)/VapourSynth/core64/plugins/AvsCompat.dll tried to register 'NeatVideo' more than once".
core.avs.LoadPlugin(r"VDubFilter.dll")
core.avs.LoadVirtualdubPlugin(r'NeatVideo.vdf', 'NeatVideo', 1)
clip = core.avs.NeatVideo(clip, ProfilePath, PresetPath, '1', '1', '1', '0')
Myrsloik
24th September 2017, 08:32
I'm trying to load a virtualdub filter through the avs loader, and I'm getting the error "Plugin C:/Program Files (x86)/VapourSynth/core64/plugins/AvsCompat.dll tried to register 'NeatVideo' more than once".
core.avs.LoadPlugin(r"VDubFilter.dll")
core.avs.LoadVirtualdubPlugin(r'NeatVideo.vdf', 'NeatVideo', 1)
clip = core.avs.NeatVideo(clip, ProfilePath, PresetPath, '1', '1', '1', '0')
Where can I find both of these dlls and their source code?
I suspect that it's registering several different overloads of the same function which isn't supported (and so unusual nobody really encountered it before).
lansing
24th September 2017, 13:23
The vdubfilter.dll came with the avs+ update zip,
https://github.com/pinterf/AviSynthPlus/releases
The virtualdub version of the neatvideo dll can be download from its demo version
https://www.neatvideo.com/download
Myrsloik
24th September 2017, 20:13
The vdubfilter.dll came with the avs+ update zip,
https://github.com/pinterf/AviSynthPlus/releases
The virtualdub version of the neatvideo dll can be download from its demo version
https://www.neatvideo.com/download
Should be fixed in the next version. Note that the different overloads of the NeatVideo function will be distinct ones since VS doesn't do overloads at all. So the different versions will be called NeatVideo, NeatVideo_2, NeatVideo_3 and so on. Now to look into a few more bugs before I release the next test version.
lansing
24th September 2017, 20:30
I'll report this issue to the neatvideo forum to see if it's a bug or not
Myrsloik
24th September 2017, 20:33
I'll report this issue to the neatvideo forum to see if it's a bug or not
It's not a bug.
lansing
24th September 2017, 20:39
It's not a bug.
Okay.
Myrsloik
26th September 2017, 21:12
yeah, but I use pismo
like store thousands of images in one .pfo file
so I need new version of it due to some bugfixes
Reproduced. I've contacted Joe Lowe about it so it should be fixed soon...
Myrsloik
26th September 2017, 21:23
R39-RC1 (https://www.dropbox.com/s/xv65xpsdflahjub/VapourSynth-R39-rc1.exe?dl=1)
Start testing!
r39:
updated to zimg v2.6
added offline documentation to the installer
renamed the croprel function to crop, croprel will still be kept as an alias for for compatibility with existing scripts
fixed missing max value clamping for 9-15 bit input with convolution
optimized prewitt and sobel
removed the min and max arguments from sobel and prewitt because they interact very oddly with float formats
avisynth compatibility can now handle functions with multiple overloads
added float support to boxblur
removed subtext file size limit
fixed missing fps correction in avisource that would produce an error with some files
switched to nasm as the assembler
visual studio runtime detection is improved in the installer, it should no longer attempt re-installs when a newer version is present
minor optimization in vspipe, you can now output blankclip into the void much faster
memory will now be 64 byte aligned on systems with avx512 support
added swapn and dupn operators to expr
reverted the argument handling in levels, arguments no longer take a 3 plane list due it making no sense when combined with the planes argument
optimized levels, the integer version is now implemented with a lut and the floating point version is faster when gamma=1.0
improved get_outputs() in python (stuxcrystal)
format objects can now be cast to int which will return the format id (stuxcrystal)
added method to make it easier to query formats from python (stuxcrystal)
made it possible to install the python part as a module (stuxcrystal)
lansing
26th September 2017, 23:18
Ran into another problem with the avs' virtualdub plugin loader that it doesn't takes in named arguments, while vapoursynth asks for named arguments.
Also got the error "VirtualdubFilterProxy: only RGB32 supported for VirtualDub filters" and there's no conversion to RGB32 in vs. And when I set "format=vs.RGB" then editor would crash.
clip = core.resize.Bicubic(clip, format=vs.RGB)
clip.set_output()
Myrsloik
26th September 2017, 23:19
Ran into another problem with the avs' virtualdub plugin loader that it doesn't takes in named arguments, while vapoursynth asks for named arguments.
Also got the error "VirtualdubFilterProxy: only RGB32 supported for VirtualDub filters" and there's no conversion to RGB32 in vs. And when I set "format=vs.RGB" then editor would crash.
clip = core.resize.Bicubic(clip, format=vs.RGB)
clip.set_output()
You can use unnamed arguments so I don't see the problem. The format you want is COMPATBGR32
lansing
26th September 2017, 23:41
I got the error "NeatVideo: Too many unnamed arguments specified". I'm using an older version of NeatVideo(3.5) which should be taking in 7 arguments including "clip".
core.avs.LoadPlugin(r"VDubFilter.dll")
core.avs.LoadVirtualdubPlugin(r'NeatVideo.vdf', 'NeatVideo', 1)
#...
clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.COMPATBGR32)
clip = core.avs.NeatVideo(clip, ProfilePath, PresetPath, '1', '1', '1', '0')
Myrsloik
26th September 2017, 23:44
I got the error "NeatVideo: Too many unnamed arguments specified". I'm using an older version of NeatVideo(3.5) which should be taking in 7 arguments including "clip".
core.avs.LoadPlugin(r"VDubFilter.dll")
core.avs.LoadVirtualdubPlugin(r'NeatVideo.vdf', 'NeatVideo', 1)
#...
clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.COMPATBGR32)
clip = core.avs.NeatVideo(clip, ProfilePath, PresetPath, '1', '1', '1', '0')
It's got multiple overloads like I mentioned. Try the NeatVideo_N() functions. List all the functions and signatures to see which version takes 7 arguments.
lansing
27th September 2017, 00:09
Okay I got the filter to work with NeatVideo_2(). And when I intentionally left out two, it gives me an error "NeatVideo_2: argument s6 is required", it doesn't tell me how many arguments I'm missing.
And there's a lot of warning about frame N not prefetched in the editor's log:
"Avisynth Compat: requested frame 47 not prefetched, using slow method"
Myrsloik
27th September 2017, 00:12
Okay I got the filter to work with NeatVideo_2(). And when I intentionally left out two, it gives me an error "NeatVideo_2: argument s6 is required", it doesn't tell me how many arguments I'm missing.
And there's a lot of warning about frame N not prefetched in the editor's log:
"Avisynth Compat: requested frame 47 not prefetched, using slow method"
That's normal since it doesn't know about these filters. At least it works. Two layers of compatibility wrappers will always be quirky...
lansing
27th September 2017, 02:59
um, after more testing, looks like the filter stop having effect after around 6 random seeks in the preview or a few seconds of playback.
Myrsloik
27th September 2017, 22:58
um, after more testing, looks like the filter stop having effect after around 6 random seeks in the preview or a few seconds of playback.
What's profilepath and presetpath? How do I make myself a working script with this so I can try it?
lansing
28th September 2017, 02:11
I uploaded a sample profile and preset for the Neatvideo4 demo version here, it takes 2 arguments instead of 7 in the older version
sample profiles (http://www.mediafire.com/file/j70mrl8bvs6eqne/nv4_profile_preset_sample.7z)
sample script:
ProfilePath = r'sample_noise_profile.dnp'
PresetPath = r'sample_preset.nfp'
core.avs.LoadPlugin(r"VDubFilter.dll")
core.avs.LoadVirtualdubPlugin(r'NeatVideo4.vdf', 'NeatVideo', 1)
clip = core.ffms2.Source('abc.mp4')
clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.COMPATBGR32)
clip = core.avs.NeatVideo_2(clip, ProfilePath, PresetPath)
Myrsloik
28th September 2017, 09:22
yeah, but I use pismo
like store thousands of images in one .pfo file
so I need new version of it due to some bugfixes
The bug has been located and the next pismo release should fix it.
Artofeel
28th September 2017, 17:49
The bug has been located and the next pismo release should fix it.
yes it's worked now
thanks to you and Joe
Myrsloik
29th September 2017, 22:34
I uploaded a sample profile and preset for the Neatvideo4 demo version here, it takes 2 arguments instead of 7 in the older version
sample profiles (http://www.mediafire.com/file/j70mrl8bvs6eqne/nv4_profile_preset_sample.7z)
sample script:
ProfilePath = r'sample_noise_profile.dnp'
PresetPath = r'sample_preset.nfp'
core.avs.LoadPlugin(r"VDubFilter.dll")
core.avs.LoadVirtualdubPlugin(r'NeatVideo4.vdf', 'NeatVideo', 1)
clip = core.ffms2.Source('abc.mp4')
clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.COMPATBGR32)
clip = core.avs.NeatVideo_2(clip, ProfilePath, PresetPath)
Odd, seems to work correctly here the whole time. The processing it does is a simple level/color adjustment, right?
Even with a load of seeking. The demo doesn't have some odd frame processing limit?
lansing
30th September 2017, 00:24
Odd, seems to work correctly here the whole time. The processing it does is a simple level/color adjustment, right?
Even with a load of seeking. The demo doesn't have some odd frame processing limit?
It's a denoising filter.
I tested again on both version, seems like the problem only occurs in my older v3.6, doesn't happen in the newer demo v4, while both works fine when loading from avs+.
And I couldn't find an older v3 demo version for you to test on...so I guess I'll just have to update my software.
Myrsloik
30th September 2017, 15:38
R39-RC3 (https://www.dropbox.com/s/jehsp83eml35jjk/VapourSynth-R39-RC3.exe?dl=1)
Should be final unless other issues are found. Test to see if all the issue you've reported actually are fixed. Will release it in a few days if no problems are found.
r39:
updated to zimg v2.6
updated pismo file mount runtime to build 188
added offline documentation to the installer
fixed clamping issues in levels filter
renamed the croprel function to crop, croprel will still be kept as an alias for for compatibility with existing scripts
fixed missing max value clamping for 9-15 bit input with convolution
optimized prewitt and sobel
removed the min and max arguments from sobel and prewitt because they interact very oddly with float formats
avisynth compatibility can now handle functions with multiple overloads
added float support to boxblur
removed subtext file size limit
fixed missing fps correction in avisource that would produce an error with some files
switched to nasm as the assembler
visual studio runtime detection is improved in the installer, it should no longer attempt re-installs when a newer version is present
minor optimization in vspipe, you can now output blankclip into the void much faster
memory will now be 64 byte aligned on systems with avx512 support
added swapn and dupn operators to expr
reverted the argument handling in levels, arguments no longer take a 3 plane list due it making no sense when combined with the planes argument
optimized levels, the integer version is now implemented with a lut and the floating point version is faster when gamma=1.0
improved get_outputs() in python (stuxcrystal)
format objects can now be cast to int which will return the format id (stuxcrystal)
added method to make it easier to query formats from python (stuxcrystal)
made it possible to install the python part as a module (stuxcrystal)
lansing
30th September 2017, 17:00
Loading RGB24 clip with avisource still has the upside down bug
LigH
30th September 2017, 17:34
There are top-down and bottom-up DIB's, IIRC...
Myrsloik
30th September 2017, 17:42
Loading RGB24 clip with avisource still has the upside down bug
Right, I'll take a look at that too. Can't remember if I tried to flip things correctly or not in avisource...
Myrsloik
30th September 2017, 18:16
Loading RGB24 clip with avisource still has the upside down bug
I need a sample to debug this. It should be doing the right thing already.
lansing
30th September 2017, 18:27
I need a sample to debug this. It should be doing the right thing already.
http://www.mediafire.com/file/r7lrydac2f6u8b4/rgb24.avi
DJATOM
4th October 2017, 12:54
I have hard times compiling r38 (as well as master) on Debian 8: https://pastebin.com/X8YZ7bEm
Is gcc 4.9 too old for it?
Myrsloik
4th October 2017, 13:07
I have hard times compiling r38 (as well as master) on Debian 8: https://pastebin.com/X8YZ7bEm
Is gcc 4.9 too old for it?
Too old ffmpeg probably
DJATOM
4th October 2017, 15:13
Managed to build and install VS using ffmpeg from git, thanks for suggestion.
Myrsloik
7th October 2017, 22:48
R39 released. Important changes listed here (http://www.vapoursynth.com/2017/10/r39-fixing-bugs-and-undoing-bad-ideas/).
hydra3333
8th October 2017, 04:13
thank you.
hydra3333
8th October 2017, 07:29
Glorious changes:
r39:
...
switched to nasm as the assembler
...
OK, thank you.
Having previously rebuilt avisynth_compat.cpp a few times, I thought I'd give it a go again (the solution relied on yasm) . The updated build instructions say
Needs Visual Studio 2017 and vsnasm (https://github.com/ShiftMediaProject/VSNASM) So I downloaded VSNASM. Following instructions, in it's readme,
The project provides a basic installer script that can automatically detect any installed Visual Studio 2013, 2015 or 2017 installation and then install the required components. To use this script simply run 'install_script.bat' from an elevated command prompt. the 'install_script.bat' failed - it couldn't find vs2017 - so I will give the manual nasm install a go, unless you have other suggestions ?
Myrsloik
8th October 2017, 12:36
I think the trick is to run it from a vs2017 command prompt to make it find the proper install path
hydra3333
8th October 2017, 14:09
I think the trick is to run it from a vs2017 command prompt to make it find the proper install path
Updated VS2017, rebooted, did it -
c:\temp\VSNASM-master\install_script.bat"
Detected 64 bit system running 32 bit shell...
Existing Visual Studio environment detected...
Access is denied.
The system cannot find the file specified.
The system cannot find the path specified.
Installing build customisations...
Error: Failed to copy build customisations
Ensure that this script is run in a shell with the necessary write privileges
Press any key to continue . . .
:) if it's not one thing it's another ....
So, tried under a standard admin cmd box again and it nearly worked.
Detected 64 bit system...
Visual Studio 2015 environment detected...
Error: Failed to get location of msbuild
Press any key to continue . . .
FFS.
Myrsloik
8th October 2017, 14:18
Admin vs2017 prompt obviously
hydra3333
8th October 2017, 15:19
OK thank you, looked for that and it worked.
For posterity and other under-educated people like me who do this rarely, a quick web searched indicated this was how to do it.
"To use this script simply run 'install_script.bat' from a VS2017 elevated command prompt."
In Windows 10
Open the Start menu, by pressing the Windows logo key Windows logo on your keyboard for example.
On the Start menu, enter dev.
This will bring a list of installed apps that match your search pattern.
If you're looking for a different command prompt, try entering a different search term such as prompt.
Choose the Developer Command Prompt (or the command prompt you want to use) and right click and run as admin.
In Windows 8.1
Go to the Start screen, by pressing the Windows logo key Windows logo on your keyboard for example.
On the Start screen, press CTRL + TAB to open the Apps list and then enter V.
This will bring a list that includes all installed Visual Studio command prompts.
Choose the x64 vs2017 Developer Command Prompt (or the command prompt you want to use) and right click and run as admin.
edit 1: no, that only appeared to work but didn't. This did though from inside an admin cmd box
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations>copy C:\Users\u\Desktop\Vapoursynth\VSNASM\VSNASM-master\na*.* .\
C:\Users\u\Desktop\Vapoursynth\VSNASM\VSNASM-master\nasm.props
C:\Users\u\Desktop\Vapoursynth\VSNASM\VSNASM-master\nasm.targets
C:\Users\u\Desktop\Vapoursynth\VSNASM\VSNASM-master\nasm.xml
3 file(s) copied.And also remembering to set a system environment variable (right click on "This PC", properties, "environment variables") named NASMPATH equal to the folder (with trailing slash) where you placed the downloaded nasm.exe.
Myrsloik
8th October 2017, 15:21
This is something you have to tell the vsnasm people about. I don't write their installation instructions
hydra3333
8th October 2017, 15:41
This is something you have to tell the vsnasm ĺeople about. I don't write their installation instructions
Yes, and thank you for the info anyway, it led to a way to get it done !
Boulder
14th October 2017, 12:14
I finally upgraded to R39 from R36 I think. I'm using this kind of a part in my cleanup script to compare the changes in the luma plane between the cleaned video and the original one. With R39, I'm only getting a black screen for the frame showing the differences. What am I doing wrong? I couldn't find anything in the "possibly breaking" parts.
planes = [0]
expr = ('{median} x + y -').format(median=1<<(src.format.bits_per_sample-1))
expr = [(i in planes) * expr for i in range(1)]
result = core.std.Expr([src, finalclip], expr)
result = core.std.Levels(result, min_in=127, max_in=132,min_out=0, max_out=255, planes=0)
finalclip = core.std.Interleave(clips=[finalclip, result])
gonca
16th October 2017, 23:44
I already support all the avs+ formats. This is something else. I also have no intention of paying (I mean compulsory donation hahahahaha) to debug this. Or buying an nvidia graphics card for that matter.
Let the butthurt commence!
code in avisynth_compat.cpp
static void VS_CC avisynthFilterInit(VSMap *in, VSMap *out, void **instanceData, VSNode *node, VSCore *core, const VSAPI *vsapi) {
WrappedClip *clip = (WrappedClip *) * instanceData;
if (!clip->preFetchClips.empty())
clip->fakeEnv->uglyNode = clip->preFetchClips.front();
const VideoInfo &viAvs = clip->clip->GetVideoInfo();
::VSVideoInfo vi;
vi.height = viAvs.height;
vi.width = viAvs.width;
vi.numFrames = viAvs.num_frames;
vi.fpsNum = viAvs.fps_numerator;
vi.fpsDen = viAvs.fps_denominator;
vs_normalizeRational(&vi.fpsNum, &vi.fpsDen);
if (viAvs.IsYV12())
vi.format = vsapi->getFormatPreset(pfYUV420P8, core);
else if (viAvs.IsYV24())
vi.format = vsapi->getFormatPreset(pfYUV444P8, core);
else if (viAvs.IsYV16())
vi.format = vsapi->getFormatPreset(pfYUV422P8, core);
else if (viAvs.IsYV411())
vi.format = vsapi->getFormatPreset(pfYUV411P8, core);
else if (viAvs.IsColorSpace(VideoInfo::CS_YUV9))
vi.format = vsapi->getFormatPreset(pfYUV410P8, core);
else if (viAvs.IsY8())
vi.format = vsapi->getFormatPreset(pfGray8, core);
else if (viAvs.IsYUY2())
vi.format = vsapi->getFormatPreset(pfCompatYUY2, core);
else if (viAvs.IsRGB32())
vi.format = vsapi->getFormatPreset(pfCompatBGR32, core);
else
vsapi->setError(out, "Avisynth Compat: Only YV12, YUY2 and RGB32 supported");
vi.flags = 0;
vsapi->setVideoInfo(&vi, 1, node);
}
add two lines to the if-else
else if (viAvs.IsColorSpace(VideoInfo::CS_YUV420P16))
vi.format = vsapi->getFormatPreset(pfYUV420P16, core);
Myrsloik
17th October 2017, 13:17
code in avisynth_compat.cpp
static void VS_CC avisynthFilterInit(VSMap *in, VSMap *out, void **instanceData, VSNode *node, VSCore *core, const VSAPI *vsapi) {
WrappedClip *clip = (WrappedClip *) * instanceData;
if (!clip->preFetchClips.empty())
clip->fakeEnv->uglyNode = clip->preFetchClips.front();
const VideoInfo &viAvs = clip->clip->GetVideoInfo();
::VSVideoInfo vi;
vi.height = viAvs.height;
vi.width = viAvs.width;
vi.numFrames = viAvs.num_frames;
vi.fpsNum = viAvs.fps_numerator;
vi.fpsDen = viAvs.fps_denominator;
vs_normalizeRational(&vi.fpsNum, &vi.fpsDen);
if (viAvs.IsYV12())
vi.format = vsapi->getFormatPreset(pfYUV420P8, core);
else if (viAvs.IsYV24())
vi.format = vsapi->getFormatPreset(pfYUV444P8, core);
else if (viAvs.IsYV16())
vi.format = vsapi->getFormatPreset(pfYUV422P8, core);
else if (viAvs.IsYV411())
vi.format = vsapi->getFormatPreset(pfYUV411P8, core);
else if (viAvs.IsColorSpace(VideoInfo::CS_YUV9))
vi.format = vsapi->getFormatPreset(pfYUV410P8, core);
else if (viAvs.IsY8())
vi.format = vsapi->getFormatPreset(pfGray8, core);
else if (viAvs.IsYUY2())
vi.format = vsapi->getFormatPreset(pfCompatYUY2, core);
else if (viAvs.IsRGB32())
vi.format = vsapi->getFormatPreset(pfCompatBGR32, core);
else
vsapi->setError(out, "Avisynth Compat: Only YV12, YUY2 and RGB32 supported");
vi.flags = 0;
vsapi->setVideoInfo(&vi, 1, node);
}
add two lines to the if-else
else if (viAvs.IsColorSpace(VideoInfo::CS_YUV420P16))
vi.format = vsapi->getFormatPreset(pfYUV420P16, core);
I meant avs 2.6 since avs+ keeps changing the api. Screw that.
TheFluff
18th October 2017, 09:47
Last time an implementation of the Avs+-specific high bitdepth stuff was attempted, the VideoInfo API in Avs+ was kinda immature. See here (https://forum.doom9.org/showthread.php?p=1782135#post1782135) and the following posts. I think the suggestions were merged into pinterf's avs+ but it's been mucked around with again after that and I think there are still some outstanding weird edge cases and other oddities. Hence VS pretends to be vanilla 2.6 when loading plugins.
Myrsloik
18th October 2017, 10:33
The reason I confused myself is that I added avs+ support to avfs. That was a bit of a mistake due to its extreme pre-alpha state. And can you even name a single avisynth plugin that doesn't already have a port you need it for? I can't think of any...
videoh
18th October 2017, 12:45
Here are some changes I made to AvsCompat to support CS_YUV420P16 from an Avisynth+ filter.
http://rationalqm.us/misc/Vapoursynth Usage.zip
hydra3333
18th October 2017, 14:50
+1 :)
Myrsloik
18th October 2017, 19:44
Since the avs+ api is apparently quite stable now (nobody seems to have stated this before I asked) I'll put proper support on my todo list. Your hack is rejected since it causes a pile of interesting issues because no plugin ever handles a partial avs+ feature level properly.
2.5 compatibility may or may not disappear (it's exclusive to 32bit anyway) to make the process simpler.
Myrsloik
19th October 2017, 10:46
I finally upgraded to R39 from R36 I think. I'm using this kind of a part in my cleanup script to compare the changes in the luma plane between the cleaned video and the original one. With R39, I'm only getting a black screen for the frame showing the differences. What am I doing wrong? I couldn't find anything in the "possibly breaking" parts.
planes = [0]
expr = ('{median} x + y -').format(median=1<<(src.format.bits_per_sample-1))
expr = [(i in planes) * expr for i in range(1)]
result = core.std.Expr([src, finalclip], expr)
result = core.std.Levels(result, min_in=127, max_in=132,min_out=0, max_out=255, planes=0)
finalclip = core.std.Interleave(clips=[finalclip, result])
Definitely an unintended change. Will fix.
pinterf
19th October 2017, 13:41
A question:
In the Expr filter source a load-type enum appears instead of a store-type. Is it a typo? It perhaps does not matter because the condition is never true, just asking.
See here: https://github.com/vapoursynth/vapoursynth/blob/master/src/core/exprfilter.cpp#L799
And a comment for Expr filter documentation: the maximum number of clips is 26 instead of 3.
Now it says: "Expr evaluates an expression per pixel for up to 3 input *clips*."
Myrsloik
19th October 2017, 13:51
A question:
In the Expr filter source a load-type enum appears instead of a store-type. Is it a typo? It perhaps does not matter because the condition is never true, just asking.
See here: https://github.com/vapoursynth/vapoursynth/blob/master/src/core/exprfilter.cpp#L799
And a comment for Expr filter documentation: the maximum number of clips is 26 instead of 3.
Now it says: "Expr evaluates an expression per pixel for up to 3 input *clips*."
That code should never be reached and is probably just a leftover. It's possible some path passes a null vi but throws an error later and this makes the check easier.
Myrsloik
22nd October 2017, 22:56
Proper avs+ support is mostly finished, expect test builds in a day or two. The only removed feature is mvtools compatibility since that hack was exceptionally ugly and a superior native version exists.
hydra3333
23rd October 2017, 12:47
Proper avs+ support is mostly finished, expect test builds in a day or two. Thank you.
Boulder
23rd October 2017, 12:51
The Vapoursynth version of QTGMC (in havsfunc) works with the VS-native MVTools. Both have their own sticky threads in this forum section.
Myrsloik
23rd October 2017, 21:57
R40-test1 (https://www.dropbox.com/s/jrwvxu3caq3tc2b/VapourSynth-R40-test1.exe?dl=1)
It should be release quality so if you reported one of the issues go test it.
Changes:
r40:
fixed rgb output sometimes being flipped in avisource
added alpha output settings to avisource, the default is no alpha output
fixed gamma being infinite if not set in levels, bug introduced in r39
removed the hack needed to support avisynth mvtools, the native mvtools has been superior for several years now and removing the hack makes avisynth filter creation much faster
added avisynth+ compatibility
only do prefetching in avfs with vs script when linear access is detected, fixes excessive prefetching that could make opening scripts very slow
ChaosKing
24th October 2017, 09:56
Why is there a restart computer option at the end of the installer? Is it really necessary? Bad User Experience :D
Myrsloik
24th October 2017, 10:11
Why is there a restart computer option at the end of the installer? Is it really necessary? Bad User Experience :D
Because a file was in use when you installed. Bad User.
feisty2
24th October 2017, 16:23
I wanna slice all images in a folder into small patches to train my neural net
I'm currently doing
import vapoursynth as vs
import os
core = vs.get_core()
def load(addr):
clp = core.imwrif.Read(addr)
clp = core.fmtc.matrix(clp, "709", fulls=True, fulld=True)
clp = core.std.ShufflePlanes(clp, 0, vs.GRAY)
clp = core.fmtc.resample(clp, clp.width//2, clp.height//2, kernel="cubic", a1=-0.5, a2=0, fulls=True, fulld=True)
clp = core.std.CropAbs(clp, 159, 159, (clp.width-159)//2+100, (clp.height-159)//2-50)
return clp
clps = []
addrs = os.listdir("img/")
for x in addrs:
clps += [load("img/"+x)]
clp = clps.pop(0)
for x in clps:
clp += x
clp.set_output()
but this simple operation takes TREMENDOUS amount of ram, I'm talking like ~20GB and also runs pretty slow (~2fps)....
something aint right,,,, how do I fix it?
Myrsloik
24th October 2017, 17:18
You've hit one of the edge cases. Each imwri instance caches the last output frame so by doing what you're doing it will have an insane memory usage.
You shouldn't even do it that way. Simply pass a list of all the filenames to one instance and set mismatch=true. Put your cropabs trick after. Probably done and running at reasonable speed after it.
DJATOM
24th October 2017, 19:42
Is there any TCPDeliver-like alternative for VapourSynth?
Myrsloik
24th October 2017, 19:47
Is there any TCPDeliver-like alternative for VapourSynth?
No, why would you even need that in <current year>?
We've got piles of cores locally...
DJATOM
24th October 2017, 20:07
Just wanted encode (or split filtering chain) using 2 PCs (that should speed things up).
Myrsloik
24th October 2017, 20:32
Just wanted encode (or split filtering chain) using 2 PCs (that should speed things up).
Did you try using the avisynth plugin? It may even work
DJATOM
25th October 2017, 16:59
It doesn't work. Host application just crashing on connection attempt.
Myrsloik
25th October 2017, 18:55
It doesn't work. Host application just crashing on connection attempt.
Here's another idea I don't even know if it works. Mount a script with avfs and then open that file over the network on the second computer.
Then report your findings...
DJATOM
26th October 2017, 14:22
Well, not a top priority, I will try it later.
djb01
29th October 2017, 08:52
Recently updated to r39 and I'm trying to figure out why my vspipe output is now lacking so much information.
https://i.imgur.com/vbwIfll.png
This is with vspipe.exe test.vpy - --y4m --progress | x264_x64_10bit_2851.exe --demuxer y4m -o out.mkv -
(The x264 binary is 2851 tmod, but I also tried kmod)
It used to have % complete, eta, estimated size, bitrate (you can see in the above image it says kb/s but doesn't actually show the bitrate -- well, it flickers between fps and bitrate but it's so fast you can't see it), and would update after every frame. I don't have this problem when using avisynth/avs4x26x-x64, so I think vspipe must be the cause, right? Is it possible to get the "old" style of progress output back?
Myrsloik
29th October 2017, 09:24
. I don't have this problem when using avisynth/avs4x26x-x64, so I think vspipe must be the cause, right? Is it possible to get the "old" style of progress output back?
Vspipe never had that information to begin with. It's most likely an x264 change.
djb01
29th October 2017, 10:08
It's most likely an x264 change.
Hmm. Well, this is weird. Turns out I needed to hardcode a --frames length for the progress to show correctly when using vspipe.
DJATOM
29th October 2017, 10:29
Recently updated to r39 and I'm trying to figure out why my vspipe output is now lacking so much information.
https://i.imgur.com/vbwIfll.png
This is with vspipe.exe test.vpy - --y4m --progress | x264_x64_10bit_2851.exe --demuxer y4m -o out.mkv -
(The x264 binary is 2851 tmod, but I also tried kmod)
It used to have % complete, eta, estimated size, bitrate (you can see in the above image it says kb/s but doesn't actually show the bitrate -- well, it flickers between fps and bitrate but it's so fast you can't see it), and would update after every frame. I don't have this problem when using avisynth/avs4x26x-x64, so I think vspipe must be the cause, right? Is it possible to get the "old" style of progress output back?
You can apply my XLENGTH support patch and recompile x264 on your own: https://pastebin.com/sZLD6vyg
Myrsloik
29th October 2017, 11:35
It'd be great if you could verify if the avs+ compatibility works and if the other fixed issues really are fixed.
Boulder
29th October 2017, 12:41
It'd be great if you could verify if the avs+ compatibility works and if the other fixed issues really are fixed.Sorry, forgot to test "fixed gamma being infinite if not set in levels, bug introduced in r39". I assume that's for my issue.
With an 8-bit video, it works, with 16-bit video it doesn't (still a black frame output).
Myrsloik
29th October 2017, 16:30
Sorry, forgot to test "fixed gamma being infinite if not set in levels, bug introduced in r39". I assume that's for my issue.
With an 8-bit video, it works, with 16-bit video it doesn't (still a black frame output).
I tried it again and it works here. Are you certain you didn't just forget to scale min/max_in or something?
Boulder
29th October 2017, 16:54
I tried it again and it works here. Are you certain you didn't just forget to scale min/max_in or something?
Ah, now I got it. Was it automatically scaled in the earlier versions? So for 16-bit video the comparison part should be like this:
clp = whatever_clip_thats_16bit_video
finalclip = core.rgvs.RemoveGrain(clp, mode=17)
planes = [0]
expr = ('{median} x + y -').format(median=1<<(clp.format.bits_per_sample-1))
expr = [(i in planes) * expr for i in range(1)]
result = core.std.Expr([clp, finalclip], expr)
result = core.std.Levels(result, min_in=127*256, max_in=132*256, min_out=0*256, max_out=255*256, planes=0)
finalclip = core.std.Interleave(clips=[finalclip, result])
Myrsloik
29th October 2017, 17:01
Ah, now I got it. Was it automatically scaled in the earlier versions? So for 16-bit video the comparison part should be like this:
clp = whatever_clip_thats_16bit_video
finalclip = core.rgvs.RemoveGrain(clp, mode=17)
planes = [0]
expr = ('{median} x + y -').format(median=1<<(clp.format.bits_per_sample-1))
expr = [(i in planes) * expr for i in range(1)]
result = core.std.Expr([clp, finalclip], expr)
result = core.std.Levels(result, min_in=127*256, max_in=132*256, min_out=0*256, max_out=255*256, planes=0)
finalclip = core.std.Interleave(clips=[finalclip, result])
No, it was never scaled at all. I don't do that in any of my VS stuff, especially not where you may want to have exact values.
Boulder
29th October 2017, 17:07
So how was it working properly despite me not scaling it? Sorry, I'm not entirely aware where the actual problem was, and I'm not entirely sure if I ran R36 or R37 earlier. Nevertheless, it's working fine now after the scaling is added to the values.
Myrsloik
29th October 2017, 17:37
Now I just need someone to test to see if the DG stuff works.
Btw, avisource in test1 has a regression that makes raw 24 and 32bit rgb avi files flipped. It does however no longer flip files that decode to raw rgb. This will be corrected in the next version so no need to report it.
videoh
29th October 2017, 18:58
DG stuff works.
Boulder
29th October 2017, 20:26
I'm getting random crashes in vspipe with the test version.
Faulting application name: vspipe.exe, version: 0.0.0.0, time stamp: 0x59f625ab
Faulting module name: DGDecodeNV.dll, version: 2053.0.0.112, time stamp: 0x59f243c4
Exception code: 0xc0000005
Fault offset: 0x000000000002e544
Faulting process id: 0x1bf8
Faulting application start time: 0x01d350eaaa4ce85c
Faulting application path: C:\Program Files\VapourSynth\core64\vspipe.exe
Faulting module path: C:\Program Files\VapourSynth\avs64\DGDecodeNV.dll
Report Id: e91f6cd2-bcdd-11e7-b4dd-00acc7375d92
The crash seems to occur much more frequently if I use my hack-of-a-denoising-function which utilizes mvtools among other smaller things. Often the crash occurs right when starting the encode with x265. Previewing in Vapoursynth Editor works fine all the time.
Mystery Keeper
29th October 2017, 21:46
Boulder, you can encode with VapourSynth Editor too. Try and say if you get the same crash. Don't forget to disable the encoder output in encoder arguments.
Boulder
30th October 2017, 04:51
It crashes in the same way.
I'll try to narrow down the part of the function which causes the crash, but it may take a while.
EDIT: it was faster than I thought. The "DitherLumaRebuild" function (borrowed in this example script from havsfunc) is what causes the crash. If it's removed, the encoding seems to progress further. The more mvtools stuff there is (i.e. MRecalculate added), the faster the crash. This version crashed just seconds after the encoding started.
import vapoursynth as vs
import resamplehq as rhq
def DitherLumaRebuild(src, s0=2., c=0.0625, chroma=True):
core = vs.get_core()
if not isinstance(src, vs.VideoNode):
raise TypeError('DitherLumaRebuild: This is not a clip')
shift = src.format.bits_per_sample - 8
isGray = src.format.color_family == vs.GRAY
k = (s0 - 1) * c
t = 'x {} - {} / 0 max 1 min'.format(16 << shift, 219 << shift)
c1 = 1 + c
c2 = c1 * c
e = '{k} {c1} {c2} {t} {c} + / - * {t} 1 {k} - * + {i} *'.format(k=k, c1=c1, c2=c2, t=t, c=c, i=256 << shift)
return core.std.Expr([src], [e] if isGray else [e, 'x {neutral} - 128 * 112 / {neutral} +'.format(neutral=128 << shift) if chroma else ''])
core = vs.get_core()
core.avs.LoadPlugin(r'C:\\Program Files\\VapourSynth\\avs64\DGDecodeNV.dll')
clp = core.avs.DGSource(r'Y:\bwtestclip.dgi')
clp = core.fmtc.bitdepth(clp, bits=16)
src = clp
feed = DitherLumaRebuild(src)
prefilt = feed
pelmdg = core.fmtc.resample(clip=src, scale=2, kernel='spline64', center=False)
pelprefilt = core.fmtc.resample(clip=prefilt, scale=2, kernel='spline64', center=False)
superanalyse = core.mv.Super(prefilt, pel=2, chroma=False, rfilter=4, pelclip=pelprefilt)
supermdg = core.mv.Super(src, pel=2, chroma=False, rfilter=4, levels=1, pelclip=pelmdg)
bv1 = core.mv.Analyse(superanalyse, dct=0, blksize=16, overlap=8, search=5, searchparam=4, pelsearch=4, isb=True, chroma=False, delta=1, truemotion=False, _global=True)
fv1 = core.mv.Analyse(superanalyse, dct=0, blksize=16, overlap=8, search=5, searchparam=4, pelsearch=4, isb=False, chroma=False, delta=1, truemotion=False, _global=True)
bv1 = core.mv.Recalculate(superanalyse, bv1, thsad=200, blksize=8, overlap=4, search=3, searchparam=4, chroma=False, truemotion=False)
fv1 = core.mv.Recalculate(superanalyse, fv1, thsad=200, blksize=8, overlap=4, search=3, searchparam=4, chroma=False, truemotion=False)
bv1 = core.mv.Recalculate(superanalyse, bv1, thsad=200, blksize=4, overlap=2, search=3, searchparam=4, chroma=False, truemotion=False)
fv1 = core.mv.Recalculate(superanalyse, fv1, thsad=200, blksize=4, overlap=2, search=3, searchparam=4, chroma=False, truemotion=False)
finalclip = core.mv.Degrain1(src, supermdg, bv1, fv1, thsad=200, thsadc=200, limit=1, limitc=5, plane=0)
finalclip.set_output()
Mystery Keeper
30th October 2017, 15:16
It crashes in the same way.
I'll try to narrow down the part of the function which causes the crash, but it may take a while.
EDIT: it was faster than I thought. The "DitherLumaRebuild" function (borrowed in this example script from havsfunc) is what causes the crash. If it's removed, the encoding seems to progress further. The more mvtools stuff there is (i.e. MRecalculate added), the faster the crash. This version crashed just seconds after the encoding started.
import vapoursynth as vs
import resamplehq as rhq
def DitherLumaRebuild(src, s0=2., c=0.0625, chroma=True):
core = vs.get_core()
if not isinstance(src, vs.VideoNode):
raise TypeError('DitherLumaRebuild: This is not a clip')
shift = src.format.bits_per_sample - 8
isGray = src.format.color_family == vs.GRAY
k = (s0 - 1) * c
t = 'x {} - {} / 0 max 1 min'.format(16 << shift, 219 << shift)
c1 = 1 + c
c2 = c1 * c
e = '{k} {c1} {c2} {t} {c} + / - * {t} 1 {k} - * + {i} *'.format(k=k, c1=c1, c2=c2, t=t, c=c, i=256 << shift)
return core.std.Expr([src], [e] if isGray else [e, 'x {neutral} - 128 * 112 / {neutral} +'.format(neutral=128 << shift) if chroma else ''])
core = vs.get_core()
core.avs.LoadPlugin(r'C:\\Program Files\\VapourSynth\\avs64\DGDecodeNV.dll')
clp = core.avs.DGSource(r'Y:\bwtestclip.dgi')
clp = core.fmtc.bitdepth(clp, bits=16)
src = clp
feed = DitherLumaRebuild(src)
prefilt = feed
pelmdg = core.fmtc.resample(clip=src, scale=2, kernel='spline64', center=False)
pelprefilt = core.fmtc.resample(clip=prefilt, scale=2, kernel='spline64', center=False)
superanalyse = core.mv.Super(prefilt, pel=2, chroma=False, rfilter=4, pelclip=pelprefilt)
supermdg = core.mv.Super(src, pel=2, chroma=False, rfilter=4, levels=1, pelclip=pelmdg)
bv1 = core.mv.Analyse(superanalyse, dct=0, blksize=16, overlap=8, search=5, searchparam=4, pelsearch=4, isb=True, chroma=False, delta=1, truemotion=False, _global=True)
fv1 = core.mv.Analyse(superanalyse, dct=0, blksize=16, overlap=8, search=5, searchparam=4, pelsearch=4, isb=False, chroma=False, delta=1, truemotion=False, _global=True)
bv1 = core.mv.Recalculate(superanalyse, bv1, thsad=200, blksize=8, overlap=4, search=3, searchparam=4, chroma=False, truemotion=False)
fv1 = core.mv.Recalculate(superanalyse, fv1, thsad=200, blksize=8, overlap=4, search=3, searchparam=4, chroma=False, truemotion=False)
bv1 = core.mv.Recalculate(superanalyse, bv1, thsad=200, blksize=4, overlap=2, search=3, searchparam=4, chroma=False, truemotion=False)
fv1 = core.mv.Recalculate(superanalyse, fv1, thsad=200, blksize=4, overlap=2, search=3, searchparam=4, chroma=False, truemotion=False)
finalclip = core.mv.Degrain1(src, supermdg, bv1, fv1, thsad=200, thsadc=200, limit=1, limitc=5, plane=0)
finalclip.set_output()It all sounds like a running out of memory issue. Have you got virtual memory disabled?
Boulder
30th October 2017, 17:22
It all sounds like a running out of memory issue. Have you got virtual memory disabled?
VM is enabled, 8 GB as a fixed value in addition to 8 GB of RAM. I took a look in Task Manager and vspipe took around 2,5 GB of memory at the beginning of the encode and would gradually release memory.
videoh
30th October 2017, 18:07
I duplicated this using HolyWu's script above with a YV12 source and found that after some number of frames this DGSource GetFrame() code hits a bad pointer:
PVideoFrame frame = env->NewVideoFrame(vi);
out->y = frame->GetWritePtr(PLANAR_Y); // pointer OK
out->u = frame->GetWritePtr(PLANAR_U); // pointer BAD
out->v = frame->GetWritePtr(PLANAR_V); // pointer OK
The returned out->u pointer is bad. Sometimes it is the PLANAR_V get call also.
This is done at the very top of the DGSource GetFrame(), so it appears to be an issue with AvsCompat.dll. vs_pipe is not involved.
videoh
30th October 2017, 19:39
If I delete the Degrain1() call, it no longer fails.
Myrsloik
30th October 2017, 22:02
I tested with a simpler version of Boulder's script below. It does crash with AvsCompat.dll from R40-test1, while AvsCompat.dll from R39 works fine. The crash doesn't always happen at the same frame though. Here is the call stack (https://i.imgur.com/U8bLEcU.png) but I guess it probably doesn't help much.
clip = core.avs.DGSource('foo.dgi')
clip = core.resize.Bicubic(clip, format=vs.YUV420P16)
src = clip
prefilt = core.std.BoxBlur(clip, hradius=1, vradius=1)
pelmdg = core.resize.Spline36(src, src.width * 2, src.height * 2)
pelprefilt = core.resize.Spline36(prefilt, prefilt.width * 2, prefilt.height * 2)
superanalyse = core.mv.Super(prefilt, pelclip=pelprefilt)
supermdg = core.mv.Super(src, levels=1, pelclip=pelmdg)
bv1 = core.mv.Analyse(superanalyse, blksize=16, overlap=8, isb=True)
fv1 = core.mv.Analyse(superanalyse, blksize=16, overlap=8, isb=False)
clip = core.mv.Degrain1(clip, supermdg, bv1, fv1)
clip.set_output()
Does it happen with threads=1?
Myrsloik
31st October 2017, 00:50
R40 test2 (https://www.dropbox.com/s/jz7yz6g018advpf/VapourSynth-R40-test2.exe?dl=1)
Should fix the avisynth compatibility issues. This happened BECAUSE AVS+ DECIDED TO MAKE DATA OFFSETS INT INSTEAD OF SIZE_T. Why this was done is a huge mystery, it's also as if it's testing just how many small changes can be made before it chokes on its own ABI and dies. This build should have undone all of this.
Also fixes the flipped rgb in avisource
pinterf
31st October 2017, 09:52
Should fix the avisynth compatibility issues. This happened BECAUSE AVS+ DECIDED TO MAKE DATA OFFSETS INT INSTEAD OF SIZE_T. Why this was done is a huge mystery, it's also as if it's testing just how many small changes can be made before it chokes on its own ABI and dies. This build should have undone all of this.
Perhaps it wasn't avs+.
https://forum.doom9.org/showthread.php?p=1712673#post1712673
Myrsloik
31st October 2017, 10:58
Perhaps it wasn't avs+.
https://forum.doom9.org/showthread.php?p=1712673#post1712673
I need those size_t changes and so does everyone else who ever wants to use a different memory layout behind the scenes. There are also zero plugins I know of that aren't compatible because of it. Just keep digging your API hole, it isn't my problem anymore.
TheFluff
31st October 2017, 15:15
Perhaps it wasn't avs+.
https://forum.doom9.org/showthread.php?p=1712673#post1712673
Yes it's Avs+. We've been over this before, in quite some detail - it's one of the dumber hills ultim&co decided to die on. See here (https://forum.doom9.org/showthread.php?p=1771304#post1771304) and here (https://forum.doom9.org/showthread.php?p=1771312#post1771312) if you want to read someone (me) complaining on the internet, but the tl;dr is that when IanB switched to size_t in the 2.6 API, ultim&co thought "maintaining compatibility"* with like a dozen 64-bit plugin DLL's from 2010 that were at that point only available via web.archive.org was too important to make the same change.
* Note: I'm strongly suspect ultim&co didn't really understand their own ABI, because as Myrsloik says I'm preeeetty sure they could've switched to size_t and those old plugins would've kept working anyway in practice. I think you can still do it now, if you want. It'll technically be an ABI break but I'm pretty sure it'll actually work in all practical cases until people get around to recompiling.
Boulder
31st October 2017, 17:34
R40 test2 is working, no more crashes.
Myrsloik
7th November 2017, 22:42
R40-RC1 (https://www.dropbox.com/s/o6istvl68pa6ldk/VapourSynth-R40-RC1.exe?dl=1)
Time to finally get a maintenance release out to fix the broken levels for everyone. Report if anything in the change list is more broken than before. Release in two days or so unless major bugs are found.
r40:
improved expr asm slightly
made the framebuffer memory pool size a percentage of the total allowed memory usage instead of a fixed size, this should scale better when processing 8k and larger resolutions
fixed rgb output sometimes being flipped in avisource
added alpha output settings to avisource, the default is no alpha output
fixed gamma being infinite if not set in levels, bug introduced in r39
removed the hack needed to support avisynth mvtools, the native mvtools has been superior for several years now and removing the hack makes avisynth filter creation much faster
added avisynth+ compatibility
only do prefetching in avfs with vs script when linear access is detected, fixes excessive prefetching that could make opening scripts very slow
lansing
8th November 2017, 16:24
I couldn't play a avfs mounted 10 bit avi on any media player, while the original 10 bit video works fine.
Myrsloik
8th November 2017, 16:51
I couldn't play a avfs mounted 10 bit avi on any media player, while the original 10 bit video works fine.
Which renderer are you using (I sure hope you're using madvr)? what's the output pin format in both cases?
lansing
8th November 2017, 17:16
The video format after mount is YUV420P10.
With media player classic, renderer used is Enhanced Video Renderer. I don't know what pin format is. With the avsf one, it reads "P010". With the original file, it reads "NV12".
With VLC player, I get the error message "VLC could not decode the format "P010" (No description for this codec)".
Myrsloik
8th November 2017, 17:20
The video format after mount is YUV420P10.
With media player classic, renderer used is Enhanced Video Renderer. I don't know what pin format is. With the avsf one, it reads "P010". With the original file, it reads "NV12".
With VLC player, I get the error message "VLC could not decode the format "P010" (No description for this codec)".
Then the explanation is very simple. Your renderer can't accept it and negotiates another output format it can accept from the decoder (which is basically YV12) and displays that. Since avfs only ever returns one format it's rejected. Install madvr, use mpc and try again for better results.
lansing
8th November 2017, 17:41
Yes madvr plays it without problem
lansing
9th November 2017, 04:31
I'm trying to create a blankclip with compatbgr32, but blankclip doesn't support the format.
Myrsloik
9th November 2017, 09:32
I'm trying to create a blankclip with compatbgr32, but blankclip doesn't support the format.
Create a rgb24 blankclip and then convert it if you really need it
lansing
9th November 2017, 16:59
Create a rgb24 blankclip and then cpnvert ot of you really need ot
When I declared a copy clip and format in blankclip, the declared format doesn't overwrite the format of the copy clip like other arguments. It still gave me the error "compat formats not supported".
core.std.BlankClip(compat_clip,length=padding, format=vs.RGB24)
Myrsloik
9th November 2017, 17:05
When I declared a copy clip and format in blankclip, the declared format doesn't overwrite the format of the copy clip like other arguments. It still gave me the error "compat formats not supported".
core.std.BlankClip(compat_clip,length=padding, format=vs.RGB24)
Will fix
Boulder
10th November 2017, 16:23
How to properly do a thing like Greyscale() in Vapoursynth? I've got a movie which is supposedly black and white, but according to the x265 logs, there is data in the chroma channels.
core.std.ShufflePlanes(clips=inclip, planes=0, colorfamily=vs.GRAY) does create a greyscale clip but in Gray8 format. If I use core.resize.Bicubic(clp, format=vs.YUV420P16) after it to make the video something to feed to x265, the chroma channels have garbage (green) in them.
mandarinka
10th November 2017, 16:41
Usually the "black and white" is a transfer from film or photo material. It is not going to be greyscale in the computer (or YUV) sense of the word.
If you strip the chroma, you will loose that "color" tone of the source, and it is likely not-so-insignificant alteration. So I would not do this, unless you are dealing with actual digital cap of a greyscale computer image and you know that for sure.
Basically, think of "sepia" photos. You also ruin those by insisting on saving them in "BW/greyscale" format.
Myrsloik
10th November 2017, 16:42
How to properly do a thing like Greyscale() in Vapoursynth? I've got a movie which is supposedly black and white, but according to the x265 logs, there is data in the chroma channels.
core.std.ShufflePlanes(clips=inclip, planes=0, colorfamily=vs.GRAY) does create a greyscale clip but in Gray8 format. If I use core.resize.Bicubic(clp, format=vs.YUV420P16) after it to make the video something to feed to x265, the chroma channels have garbage (green) in them.
Try R40-RC2 (https://www.dropbox.com/s/kf959odlklhlby4/VapourSynth-R40-RC2.exe?dl=1)
It also fixes the blankclip bug reported by lansing
Boulder
10th November 2017, 16:45
Usually the "black and white" is a transfer from film or photo material. It is not going to be greyscale in the computer (or YUV) sense of the word.
If you strip the chroma, you will loose that "color" tone of the source, and it is likely not-so-insignificant alteration. So I would not do this, unless you are dealing with actual digital cap of a greyscale computer image and you know that for sure.
Basically, think of "sepia" photos. You also ruin those by insisting on saving them in "BW/greyscale" format.
Hmm..that's an interesting point of view. I was asking this because it is the first time for BW movies that I see anything chroma-related in the P/B frame weighting according to x264/x265 logs. Of course, I'll compare the two outputs if I can see any difference.
Myrsloik: thanks, will test it!
Boulder
10th November 2017, 16:51
Try R40-RC2 (https://www.dropbox.com/s/kf959odlklhlby4/VapourSynth-R40-RC2.exe?dl=1)
It also fixes the blankclip bug reported by lansing
And it works, no more garbage there.
mandarinka
10th November 2017, 16:54
It can also contain rainbows and such garbage added in transfer/processing too, in such case, I would try to use derainbowers on it, maybe even strong ones (but not ones that wash out colors in large areas, to be safe).
Boulder
10th November 2017, 18:20
It can also contain rainbows and such garbage added in transfer/processing too, in such case, I would try to use derainbowers on it, maybe even strong ones (but not ones that wash out colors in large areas, to be safe).
I checked many places by comparing the greyscaled and original output and couldn't see any visual differences. Maybe there's just some bluish hue or something like that which is basically impossible to notice even with a frame by frame comparison. Funny thing is that the greyscale version required a slightly more bitrate when I did a short test encode. The UV channels clearly affected the frame type decision.
Myrsloik
10th November 2017, 18:50
R40 released. Blog post as usual (http://www.vapoursynth.com/2017/11/r40-avisynth-compatibility-and-fixes/). Everyone should upgrade since it's a maintenance release.
hydra3333
10th November 2017, 22:43
Thank you. In regard to building vapoursynth :-
I think I had been using an incorrect github link for avisynth+ :(
Can you please confirm whether this is the right link ? It seems to have been updated more recently.
https://github.com/pinterf/AviSynthPlus/tree/MT
And this is the right link for zimg I guess.
https://github.com/sekrit-twc/zimg/releases
Myrsloik
11th November 2017, 00:29
Thank you. In regard to building vapoursynth :-
I think I had been using an incorrect github link for avisynth+ :(
Can you please confirm whether this is the right link ? It seems to have been updated more recently.
https://github.com/pinterf/AviSynthPlus/tree/MT
And this is the right link for zimg I guess.
https://github.com/sekrit-twc/zimg/releases
Both are right
DJATOM
11th November 2017, 02:19
Myrsloik
I tried to find out why TCPServer fails: https://github.com/DJATOM/TCPDeliver/blob/master/src/TCPServer.cpp#L478. I don't know why it crashing on GetFrame call, that code works well on Avisynth.
pinterf
14th November 2017, 16:25
Possibly a rare use case in Expr: you cannot use 8-16 bit clips with 32 bit float clips in one expression (working register ordering is the opposite)
kgrabs
19th November 2017, 08:52
^ speaking of std.Expr, outputting float from int clips, or vice versa causes some crazy things to happen: http://screenshotcomparison.com/comparison/123935
Myrsloik
19th November 2017, 16:42
^ speaking of std.Expr, outputting float from int clips, or vice versa causes some crazy things to happen: http://screenshotcomparison.com/comparison/123935
Already fixed in git. Same issue as pinterf found.
Myrsloik
19th November 2017, 23:25
Myrsloik
I tried to find out why TCPServer fails: https://github.com/DJATOM/TCPDeliver/blob/master/src/TCPServer.cpp#L478. I don't know why it crashing on GetFrame call, that code works well on Avisynth.
Nope, can't figure out exactly why. Couldn't even get it to connect and trigger the error oddly enough. Not going to spend more time on this since it's a great perversion even of the avisynth api...
lansing
29th November 2017, 04:07
I have a problem applying multiple instances of the virtualdub filter neatvideo in vapoursynth, it was able to load preview but crash on preview close.
core.avs.LoadPlugin(r"C:\Program Files (x86)\AviSynth+\plugins64+\VDubFilter.dll")
core.avs.LoadVirtualdubPlugin(r'neatvideo.vdf', 'nv', 1)
clipa = core.avs.nv_2(clip, setting_a)
clipb = core.avs.nv_2(clip, setting_b)
clip = clipa + clipb
clip.set_output()
However, saving the filter under a different function name will work:
core.avs.LoadPlugin(r"C:\Program Files (x86)\AviSynth+\plugins64+\VDubFilter.dll")
core.avs.LoadVirtualdubPlugin(r'neatvideo.vdf', 'nv', 1)
core.avs.LoadVirtualdubPlugin(r'neatvideo.vdf', 'nv2', 1)
clipa = core.avs.nv_2(clip, setting_a)
clipb = core.avs.nv2_2(clip, setting_b)
clip = clipa + clipb
clip.set_output()
I first thought that it was a problem with neatvideo and avisynth because it was mentioned on the user manual. But after asking in the neatvideo forum and testing it out in avs+, it actually works without any problem. So I think the problem is from vapoursynth.
Here's the crash log from vs editor
Problem signature:
Problem Event Name: BEX64
Application Name: vsedit.exe
Application Version: 18.0.0.0
Application Timestamp: 59f4da49
Fault Module Name: NeatVideo.vdf_unloaded
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 540f49bd
Exception Offset: 000007fed7512d60
Exception Code: c0000005
Exception Data: 0000000000000008
OS Version: 6.1.7601.2.1.0.256.1
Locale ID: 1033
Additional Information 1: 0052
Additional Information 2: 0052a83208d9c99bc2a54c9c0c8ea3e8
Additional Information 3: ce3c
Additional Information 4: ce3cde77cba7f1c58c793ecf99d5100f
Myrsloik
29th November 2017, 13:53
I have a problem applying multiple instances of the virtualdub filter neatvideo in vapoursynth, it was able to load preview but crash on preview close.
...
Interesting observation. Does it crash on script evaluation, first frame request or later? There's probably some locking/shared resource in the dll that's causing it. I'll try to debug it just to see but these things are hard to figure out without the source.
lansing
29th November 2017, 15:25
Interesting observation. Does it crash on script evaluation, first frame request or later? There's probably some locking/shared resource in the dll that's causing it. I'll try to debug it just to see but these things are hard to figure out without the source.
It works fine on preview, I was able to navigate and seek without a problem. It crashes only when I close the preview. I tried opening benchmark while still with the preview window open, the benchmark window works fine until I tried closing it.
I tried the same actions on virtualdub filtermod, no problem on navigate and seeking. I tried running "video analysis pass" and abort it and no crash. The program only crash on close. Here's the crash info.
https://pastebin.com/3LY0zMrA
Selur
2nd December 2017, 18:43
Small question: Is there a source filter which can handle movs which only link to the tracks?
On ffmpeg I can play such files by adding '-enable_drefs 1', but I don't know of any option in FFmpegSource2, LSMASHVideoSource or LWLibavVideoSource which supports this.
-> is there some to me unknown option or source filter which could be used for this?
Cu Selur
Ps.: Background: A user asked me (see: https://forum.selur.net/showthread.php?tid=162) whether I could add support for this in Hybrid which is why I'm looking into it.
Myrsloik
2nd December 2017, 18:45
Small question: Is there a source filter which can handle movs which only link to the tracks?
On ffmpeg I can play such files by adding '-enable_drefs 1', but I don't know of any option in FFmpegSource2, LSMASHVideoSource or LWLibavVideoSource which supports this.
-> is there some to me unknown option or source filter which could be used for this?
Cu Selur
Ps.: Background: A user asked me (see: https://forum.selur.net/showthread.php?tid=162) whether I could add support for this in Hybrid which is why I'm looking into it.
Maybe, create an issue with this text and maybe I'll look into it later. No idea how that part of the api works.
Selur
2nd December 2017, 18:45
Will do. Thanks!
Myrsloik
2nd December 2017, 19:34
Will do. Thanks!
Do you have some small sample to go with it? I think it's just a simple option to change but need to be able to test it.
Selur
2nd December 2017, 19:36
There's a download link (google drive) to a test folder with the files in the first post over in my board. -> https://forum.selur.net/showthread.php?tid=162
Cu Selur
lansing
4th December 2017, 05:25
Can I output image file name with imwrif base on frame number in the frame property?
Myrsloik
4th December 2017, 09:42
Can I output image file name with imwrif base on frame number in the frame property?
If you call imwri insode frameeval ypu should be able to do it.
lansing
5th December 2017, 04:07
I have problem with the syntax on appending clips reading from text file. I need to reorder a clip like this:
clip[500:600] + clip[400:450] + clip[601:700]
I have looked in remapframes, but it doesn't have such function.
Right now my text read like this:
500 600
400 450
601 700
And I use a for loop to create the clips, but I always ended having to create a dummy 1 frame accumulator clip so that I can append the clips onto, and then strips that out after the loop.
clip = core.ffms2.source("abc")
accum_clip = clip[1]
with open(file) as f:
line = f.readline()
for line in f:
start, end = (int(x.strip()) for x in line.split())
accum_clip += clip[start:end]
clip = core.std.Trim(accum_clip, 1)
How do I avoid doing that dummy clip?
lansing
5th December 2017, 05:57
Ok that looks better than my dummy clip. Didn't know that you can pack those shortcut format into the splice function.
tyee
6th December 2017, 04:58
Just starting to learn VS, but can't find links to any 64 bit plugins to test a script. Trying to find RemoveGrain.dll and Repair.dll to test finesharp script. Anyone got links?
update - ok, I read they are not needed anymore but I would like to know where the 64 bit plugins reside?
lansing
6th December 2017, 06:26
Just starting to learn VS, but can't find links to any 64 bit plugins to test a script. Trying to find RemoveGrain.dll and Repair.dll to test finesharp script. Anyone got links?
update - ok, I read they are not needed anymore but I would like to know where the 64 bit plugins reside?
http://www.vapoursynth.com/doc/pluginlist.html
lansing
6th December 2017, 07:10
Updating on my issue with loading multiple instances of a virtualdub filters. I did more testings on a few more vd filters, the problem should be coming from either avisynth or virtualdub. (I highly believe that it's avisynth)
Loading multiple instance of any vd filter in an avs script will result in an "out-of-bound memory access" crash on program close, which is the same behavior I had in vapoursynth earlier.
This will crash in avisynth:
LoadVirtualDubPlugin("Autolevels.vdf", "Autolevels", 0)
src = AVISource("sample.avi").ConvertToRGB32()
a = src.Autolevels(40, 46, 50, 0, 0, 0, 0, 0)
b = src.Autolevels(40, 80, 50, 0, 0, 0, 0, 0)
a+b
This will work:
LoadVirtualDubPlugin("Autolevels.vdf", "Autolevels", 0)
LoadVirtualDubPlugin("Autolevels_copy.vdf", "Autolevels_copy", 0)
src = AVISource("sample.avi").ConvertToRGB32()
a = src.Autolevels(40, 46, 50, 0, 0, 0, 0, 0)
b = src.Autolevels_copy(40, 80, 50, 0, 0, 0, 0, 0)
a+b
pinterf
6th December 2017, 08:54
Updating on my issue with loading multiple instances of a virtualdub filters. I did more testings on a few more vd filters, the problem should be coming from either avisynth or virtualdub. (I highly believe that it's avisynth)
Loading multiple instance of any vd filter in an avs script will result in an "out-of-bound memory access" crash on program close, which is the same behavior I had in vapoursynth earlier.
Yes, already reported, something like a double free at exit, don't spend any more time investigating on the vs side.
lansing
6th December 2017, 19:01
Yes, already reported, something like a double free at exit, don't spend any more time investigating on the vs side.
Ok hope this get fix soon, getting it to work fills in the last missing piece of my project.
lansing
9th December 2017, 04:46
Is there a function that can replace a range of frames with another range of frame of the same clip?
I want to replace frame 200-250 with frame 0-150. It's not remapping, the length of the resulting clip should be different to the original. I looked into remapframes but it doesn't have it.
AzraelNewtype
9th December 2017, 07:28
Sure.
http://www.vapoursynth.com/doc/functions/trim.html
http://www.vapoursynth.com/doc/functions/splice.html
lansing
9th December 2017, 08:20
Sure.
http://www.vapoursynth.com/doc/functions/trim.html
http://www.vapoursynth.com/doc/functions/splice.html
I know that we can write it using those native functions. I'm just asking to see if we have something written already.
I have another question about slicing, is there a short form to get a clip of N frame to the end of the clip? "clip[50, -1]" only gets frame 50 to the second to the last frame, is there a flag that represent the last frame of the clip?
AzraelNewtype
9th December 2017, 09:51
clip[50:]
Of course [:-1] is only giving the second to last. That's what negative slice indexes do.
As for wrapping three trims and a splice to do arbitrary replacement of unrelated clips, that kind of really small helper function isn't the sort of thing people share libraries of. A naive implementation is probably about five lines. It's barely even syntactic sugar if you have to define the trim points of the input and replacement separately.
lansing
11th December 2017, 17:22
Reporting a memory leak on ModifyFrame as I found it here (https://forum.doom9.org/showthread.php?p=1826659#post1826659) earlier.
Memory will not flush after I closed preview in vs editor. Using the sample script from the document will cause the leak:
def set_frame_number(n, f):
fout = f.copy()
fout.props['FrameNumber'] = n
return fout
clip = core.std.ModifyFrame(clip=clip, clips=clip, selector=set_frame_number)
Myrsloik
12th December 2017, 13:22
Reporting a memory leak on ModifyFrame as I found it here (https://forum.doom9.org/showthread.php?p=1826659#post1826659) earlier.
Memory will not flush after I closed preview in vs editor. Using the sample script from the document will cause the leak:
def set_frame_number(n, f):
fout = f.copy()
fout.props['FrameNumber'] = n
return fout
clip = core.std.ModifyFrame(clip=clip, clips=clip, selector=set_frame_number)
I've found 3 memory leaks so far in various places. Expect the next version to improve on things a lot. Note that all leaks more or less only happened when objects were destroyed so it'd never be discovered when using vspipe or simply encoding things.
Myrsloik
12th December 2017, 16:43
R41-test1 (https://www.dropbox.com/s/q2gb0hmuh3ywyiy/VapourSynth-R41-test1.exe?dl=1)
Some of the fixes required fairly big changes in the cython code so test as many scripts as possible. This binary should be considered alpha quality.
r41:
updated to zimg v2.7
removed dependency on the now deprecated codecvt header
fixed memory leak where modifyframe wouldn't release the function reference when done
fixed a rare memory leak that could happen if the core was freed before the last frame
fixed a memory leak that would happen if a python videoframe object was instantiated
improved imwri's input and output format guessing, now integer and float image formats will most likely be returned in native precision
imwri now requires hdri support since it's now enabled by default
stackvertical now properly rejects compat formats instead of producing unexpected output
the default initial cache size now also depends on the number of threads used
fixed negative frame request error listing the parent node name instead of the correct name
fixed expr clamping of 9-15 bit output, previously it would clamp to 16bit
fixed corrupted output in expr when mixing int and float for input and output (pinterf)
Imwri builds will be provided separately at a later time when more testing has been done.
lansing
12th December 2017, 22:21
Thank you, the leak is now gone, memory usage drops back to 30MB after preview close.
Can I output image file name with imwrif base on frame number in the frame property?
If you call imwri insode frameeval ypu should be able to do it.
I can't get it working, I tried various formatings but all failed.
from functools import partial
img_dir = r"F:\temp_img_w\{}.png"
def set_frame_number(n, f):
fout = f.copy()
fout.props.FrameNumber = n
return fout
clip = core.std.ModifyFrame(clip=clip, clips=clip, selector=set_frame_number)
def writeimgfn(n, f, clip, path):
num = f.props.FrameNumber
rgb_clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.RGB24)
return core.imwrif.Write(rgb_clip, imgformat="PNG", filename=path.format(n))
clip = core.std.FrameEval(clip, partial(writeimgfn, clip=clip, path=img_dir), prop_src=clip)
clip.set_output()
It returns error "Write: Filename string doesn't contain a number".
Myrsloik
12th December 2017, 22:40
Thank you, the leak is now gone, memory usage drops back to 30MB after preview close.
I can't get it working, I tried various formatings but all failed.
from functools import partial
img_dir = r"F:\temp_img_w\{}.png"
def set_frame_number(n, f):
fout = f.copy()
fout.props.FrameNumber = n
return fout
clip = core.std.ModifyFrame(clip=clip, clips=clip, selector=set_frame_number)
def writeimgfn(n, f, clip, path):
num = f.props.FrameNumber
rgb_clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.RGB24)
return core.imwrif.Write(rgb_clip, imgformat="PNG", filename=path.format(n))
clip = core.std.FrameEval(clip, partial(writeimgfn, clip=clip, path=img_dir), prop_src=clip)
clip.set_output()
It returns error "Write: Filename string doesn't contain a number".
Unless you have a more complex use case than this example you should simply be using vspipe and ffmpeg to write images. How does your script fail anyway?
lansing
12th December 2017, 23:13
Unless you have a more complex use case than this example you should simply be using vspipe and ffmpeg to write images. How does your script fail anyway?
I'm working on a project to color match dragon ball z, for better color matching accuracy, I need to build a big montage for every scene and stored them as a clip, like 1 frame = 1 montage, each frame resolution varies. After that I need to output all the images to be use for the color matching program.
By tagging and saving a frame number onto each output image instead of the sequence counter will help to back track if something went wrong. For example, if one of the images gives poor matching result, I would know exactly where to look for that scene.
gonca
14th December 2017, 00:44
Using Vapoursynth to try to process a UHD video
script is
import vapoursynth as vs
core = vs.get_core()
core.avs.LoadPlugin(r'C:\Program Files (Portable)\dgdecnv\x64 Binaries\DGDecodeNV.dll')
clip = core.avs.DGSource(r'D:\#TEMP\xxxx.dgi', fieldop=0, fulldepth=True)
clip.set_output()
error report
Error Video encoding using NVEnc 3.23 (1.7.0.4)
Video encoding using NVEnc 3.23 failed with exit code: -1073741819 (0xC0000005)
The exit code might be a system error code: The instruction at 0xp referenced memory at 0xp. The memory could not be s.
------------------- Video encoding using NVEnc 3.23 -------------------
"C:\Program Files (Portable)\StaxRip\Apps\NVEnc\NVEncC64.exe" --vbrhq 38400 --codec h265 --preset quality --level 5.1 --output-depth 10 --weightp --ref 5 --gop-len 24 --lookahead 32 --qp-init 1 --max-bitrate 38400 --vbr-quality 25 --aq --cuda-schedule auto --colormatrix bt2020nc --colorprim bt2020 --transfer smpte2084 --mv-precision q-pel --cabac -i "W:\TEMP\KONG SKULL ISLAND_temp\KONG SKULL ISLAND.vpy" -o "W:\TEMP\KONG SKULL ISLAND_temp\KONG SKULL ISLAND_out.h265"
StaxRip.ErrorAbortException: Video encoding using NVEnc 3.23 failed with exit code: -1073741819 (0xC0000005)
The exit code might be a system error code: The instruction at 0xp referenced memory at 0xp. The memory could not be s.
------------------- Video encoding using NVEnc 3.23 -------------------
"C:\Program Files (Portable)\StaxRip\Apps\NVEnc\NVEncC64.exe" --vbrhq 38400 --codec h265 --preset quality --level 5.1 --output-depth 10 --weightp --ref 5 --gop-len 24 --lookahead 32 --qp-init 1 --max-bitrate 38400 --vbr-quality 25 --aq --cuda-schedule auto --colormatrix bt2020nc --colorprim bt2020 --transfer smpte2084 --mv-precision q-pel --cabac -i "W:\TEMP\KONG SKULL ISLAND_temp\KONG SKULL ISLAND.vpy" -o "W:\TEMP\KONG SKULL ISLAND_temp\KONG SKULL ISLAND_out.h265"
at StaxRip.Proc.Start() in D:\Projekte\VS\VB\StaxRip\General\Proc.vb:line 338
at StaxRip.NVEnc.Encode() in D:\Projekte\VS\VB\StaxRip\Encoding\NVEnc.vb:line 82
at StaxRip.GlobalClass.ProcessVideo() in D:\Projekte\VS\VB\StaxRip\General\GlobalClass.vb:line 225
at System.Threading.Tasks.Parallel.<>c__DisplayClass4_0.<Invoke>b__0()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at StaxRip.GlobalClass.ProcessJob(String jobPath) in D:\Projekte\VS\VB\StaxRip\General\GlobalClass.vb:line 137
If I run
"C:\Program Files (Portable)\StaxRip\Apps\NVEnc\NVEncC64.exe" --vbrhq 38400 --codec h265 --preset quality --level 5.1 --output-depth 10 --weightp --ref 5 --gop-len 24 --lookahead 32 --qp-init 1 --max-bitrate 38400 --vbr-quality 25 --aq --cuda-schedule auto --colormatrix bt2020nc --colorprim bt2020 --transfer smpte2084 --mv-precision q-pel --cabac -i "W:\TEMP\KONG SKULL ISLAND_temp\KONG SKULL ISLAND.vpy" -o "W:\TEMP\KONG SKULL ISLAND_temp\KONG SKULL ISLAND_out.h265"
Through the command line The error is Vapoursynth failed to open input file
Any ideas?
kriNon
14th December 2017, 14:28
I'm trying to use vapoursynth's avs.LoadPlugin(string path) to load some avisynth filters, however whenever I try to load almost any filter I will get the error:
Failed to evaluate the script:
Python exception: Avisynth Loader: failed to load module
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1830, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:36860)
File "", line 4, in
File "src\cython\vapoursynth.pyx", line 1722, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:35000)
vapoursynth.Error: Avisynth Loader: failed to load module
Any idea what could be causing this? I'm running Vapoursynth r40 and Avisynth 2.6 x86.
Thanks!
Myrsloik
14th December 2017, 14:31
I'm trying to use vapoursynth's avs.LoadPlugin(string path) to load some avisynth filters, however whenever I try to load almost any filter I will get the error:
Failed to evaluate the script:
Python exception: Avisynth Loader: failed to load module
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1830, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:36860)
File "", line 4, in
File "src\cython\vapoursynth.pyx", line 1722, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:35000)
vapoursynth.Error: Avisynth Loader: failed to load module
Any idea what could be causing this? I'm running Vapoursynth r40 and Avisynth 2.6 x86.
Thanks!
Did you escape the path properly?
kriNon
14th December 2017, 14:35
Ah sorry, forgot to post my script:
import vapoursynth as vs
core = vs.get_core()
core.avs.LoadPlugin(r"C:\Program Files (x86)\AviSynth\plugins\deen.dll")
Yeah, I did
LigH
14th December 2017, 14:36
I believe VapourSynth may not be able to load AviSynth plugins with the ancient v2.0 or v2.5 interfaces, but require v2.6... so: Do you have a few examples which plugins load and which don't?
kriNon
14th December 2017, 14:51
I've only tested a few, I remember that TIVTC v1.0.5 didn't work, but v1.0.9 worked. Neither Deen or eDeen have worked for me, however I've seen that in https://github.com/vapoursynth/vapoursynth/blob/master/src/avisynth/avisynth_compat.cpp there are the lines:
PREFETCHR1(deen)
PREFETCHR0(eDeen)
so I assume that there is compatibility?
Also someone used Deen in their vapoursynth script here:
https://gist.github.com/4re/bba3f65469acfe0ec08a
EDIT:
I tested a few avisynth plugins at random to see which ones worked, and can confirm that I got the same error message when trying to load Average, BlendWeight, ColorBalance, FFT3DFilter, and Vinverse.
I have recently reinstalled both Avisynth and Vapoursynth and am having the same error.
Are_
14th December 2017, 15:17
Sorry about that, I should delete it, it must not exist in current year.
Maybe you are trying to load 32bit plugins with 64bit vapoursynth or the other way around.
kriNon
14th December 2017, 15:20
Does 64bit vapoursynth not support 32bit plugins?
LigH
14th December 2017, 16:00
64-bit processes can only handle 64-bit DLL's in general. That's not a restriction of specific software, but of the CPU mode and its memory addressing and register handling.
If you wanted to use a 32-bit DLL, you would have to spawn a separate 32-bit process and exchange data between both of them.
kriNon
14th December 2017, 16:15
So I'm a little bit confused, would I need to uninstall vapoursynth and replace it with a 32-bit variant? or would I need to replace python with a 32 bit variant? or both?
LigH
14th December 2017, 16:23
VapourSynth is a Python module. To run VapourSynth as a 32-bit process, you would have to run it in 32-bit Python.
kriNon
14th December 2017, 16:28
Alright, Thanks for all of the help!
lansing
14th December 2017, 21:45
Just saw the new one liner call to import the core
from vapoursynth import core
Now how do we get things like vs.RGB24 without the "vs"? The document haven't update yet.
Myrsloik
14th December 2017, 22:19
Just saw the new one liner call to import the core
from vapoursynth import core
Now how do we get things like vs.RGB24 with the "vs"? The document haven't update yet.
Same as the old import vapoursynth as vs. You can also do things like from vapoursynth import core, RGB24, someotherformat, ...If you want to refer to them without the vs prefix. Python has loads of ways to import things.
lansing
14th December 2017, 23:08
Same as the old import vapoursynth as vs. You can also do things like from vapoursynth import core, RGB24, someotherformat, ...If you want to refer to them without the vs prefix. Python has loads of ways to import things.
I'm referring to these:
core.std.BlankClip(format=vs.YUV420P8, length=1000, color=[n, 128, 128])
AzraelNewtype
14th December 2017, 23:16
Did... you... try
from vapoursynth import YUV420P8
?
lansing
14th December 2017, 23:40
Did... you... try
from vapoursynth import YUV420P8
?
That would be really odd if we need to import every little thing we're going to use in the first line. For example, I'm going to use COMPATBGR32, RGB24, YUV420P8 and RGBS in a script, so that would be:
from vapoursynth import COMPATBGR32, RGB24, YUV420P8, RGBS
AzraelNewtype
15th December 2017, 00:33
Yes that is correct. This is how python namespace pollution works. Alternately, don't pollute your namespace.
poisondeathray
17th December 2017, 04:00
avisource, alpha channel questions
R40 x64
There seems to be problems with the alpha channel using AVISource on an RGB32(RGBA) AVI with a valid alpha channel (I tested uncompressed, lagarith, ut video codec) . The same AVI is ok in avisynth, and showalpha() shows the correct alpha
import vapoursynth as vs
core = vs.get_core()
video = core.avisource.AVISource(r'F:\blah.avi', pixel_type="RGB32", alpha=True)
#video[0].set_output()
video[1].set_output()
It's not completely black, there are some pixels here and there that are non black, but it's definitely corrupt.
alpha channel seems to work ok with other things, e.g. on an imagemagick RGBA png sequence , video[1].set_output() would show the correct alpha
Q2) How do you send RGB32 data to something else ? . If python holds it as an array, how would you encode, say an RGBA png sequence with ffmpeg ?
Myrsloik
17th December 2017, 13:28
avisource, alpha channel questions
R40 x64
There seems to be problems with the alpha channel using AVISource on an RGB32(RGBA) AVI with a valid alpha channel (I tested uncompressed, lagarith, ut video codec) . The same AVI is ok in avisynth, and showalpha() shows the correct alpha
import vapoursynth as vs
core = vs.get_core()
video = core.avisource.AVISource(r'F:\blah.avi', pixel_type="RGB32", alpha=True)
#video[0].set_output()
video[1].set_output()
It's not completely black, there are some pixels here and there that are non black, but it's definitely corrupt.
alpha channel seems to work ok with other things, e.g. on an imagemagick RGBA png sequence , video[1].set_output() would show the correct alpha
Q2) How do you send RGB32 data to something else ? . If python holds it as an array, how would you encode, say an RGBA png sequence with ffmpeg ?
1. I think I found part of the issue. Can I have a sample with a few frames to test if I succeeded in fixing it? I think it broke during some refactoring and nobody noticed...
2. There's actually no easy way to do that. I mean ideally you'd output RGBAP but the default output handling doesn't take this into consideration. How about a solution like this:
clip.set_output(alpha=alpha_clip)
And then it'd be output as GBRAP. Or something like that, thoughts?
poisondeathray
17th December 2017, 18:15
UT Video ULRA , alpha channel sample
http://www.mediafire.com/file/lsb7cz35387ow1z/UTVideo_ULRA.avi
Let me know if you need any other samples / codecs etc...
clip.set_output(alpha=alpha_clip)
And then it'd be output as GBRAP. Or something like that, thoughts?
I think that should work, but would alpha=True be more consistent ? Or would you have to define the alpha_clip specifically ?
Myrsloik
17th December 2017, 19:26
UT Video ULRA , alpha channel sample
http://www.mediafire.com/file/lsb7cz35387ow1z/UTVideo_ULRA.avi
Let me know if you need any other samples / codecs etc...
I think that should work, but would alpha=True be more consistent ? Or would you have to define the alpha_clip specifically ?
How else would it know what the alpha information is?
Myrsloik
18th December 2017, 17:49
R41-test2 (https://www.dropbox.com/s/xw0l31pxqhdmrwo/VapourSynth-R41-test2.exe?dl=1)
Fixes alpha handling in avisource and not much else.
kgrabs
20th December 2017, 01:43
I think something is up with the "bits" and "floatout" parameters of std.Lut/Lut2, you can "evaluate" it but previewing and encoding crash:
import vapoursynth as vs
core = vs.core
clip = core.std.BlankClip(format=vs.GRAY8)
core.std.Lut(clip, lut=[0]*256, bits=16).set_output()
Script was successfully evaluated. Output video info:
Frames: 240 | Time: 0:00:10.000 | Size: 640x480 | FPS: 24/1 = 24 | Format: Gray16
Crash on preview
import vapoursynth as vs
core = vs.core
clip = core.std.BlankClip(format=vs.GRAY8)
core.std.Lut(clip, lutf=[0.]*256, bits=32, floatout=True).set_output()
Script was successfully evaluated. Output video info:
Frames: 240 | Time: 0:00:10.000 | Size: 640x480 | FPS: 24/1 = 24 | Format: GrayS
Crash on preview
~Edit~
So, std.BoxBlur seems to be really, really slow at copying planes. The difference between splitting to GRAY clips and using the planes parameter is huge
args = dict(hradius=2, hpasses=1, vradius=2, vpasses=1)
clip = core.std.BlankClip(None, 1920, 1080, vs.YUV444PS, 500)
core.std.BoxBlur(clip, planes=[0], **args).set_output()
Time elapsed: 0:07.476 - 66.88474253259326474108 FPS
clip = core.std.BlankClip(None, 1920, 1080, vs.GRAYS, 500)
core.std.BoxBlur(clip, **args).set_output()
Time elapsed: 0:02.996 - 166.90969959623313911834 FPS
Myrsloik
20th December 2017, 20:12
I'll look into the first one - FIXED NOW. Second is memory bw limited due to blankclip having to fill all 3 planes. Set keep=1 in blankclip and you'll see that it's really close. Or should be at least...
Myrsloik
27th December 2017, 15:20
R41-test4 (https://www.dropbox.com/s/ldplss7dpz8mwjc/VapourSynth-R41-test4.exe?dl=1)
It's a test version because some fairly big changes have been made for the alpha output part. To use this simply do clip.set_output(alpha=alpha_clip) and it will be output through vspipe. Note that Y4M doesn't get alpha and can't be combined with it. Test it well.
r41:
updated to zimg v2.7
added convenient alpha output to vspipe and vsscript, set_output() in python now takes a second optional alpha clip which will be used for this
fixed avisource leaking one frame reference on destruction
updated plugin list to be more consistent with links to source/binaries and doom9 discussion thread
fixed lut triggering a fatal error when the bits argument is used
fixed regression that prevented alpha output from working in avisource
removed dependency on the now deprecated codecvt header
fixed memory leak where modifyframe wouldn't release the function reference when done
fixed a rare memory leak that could happen if the core was freed before the last frame
fixed a memory leak that would happen if a python videoframe object was instantiated
imwri will no longer write alpha to images unless an alpha clip is specified
improved imwri's input and output format guessing, now integer and float image formats will most likely be returned in native precision
imwri now requires hdri support since it's enabled by default in version 7, as a result of there only being one major configuration the namespace is now always imwri
stackvertical now properly rejects compat formats instead of producing unexpected output
the default initial cache size now also depends on the number of threads used
fixed negative frame request error listing the parent node name instead of the correct name
fixed expr clamping of 9-15 bit output, previously it would clamp to 16bit
fixed corrupted output in expr when mixing int and float for input and output (pinterf)
Myrsloik
28th December 2017, 13:07
I did some more testing and R41-test4 should be considered RC quality.
Myrsloik
30th December 2017, 19:49
R41-RC1 (https://www.dropbox.com/s/raa1xipgzwrwug1/VapourSynth-R41-RC1.exe?dl=1)
Fixes an avisource crash and some minor typos. Also lots of imwri changes but that's a separate thread.
kgrabs
31st December 2017, 17:24
About the BoxBlur thing, there's still a pretty big difference
#Main
from vapoursynth import core, GRAY, YUV, YUV444PS
args = dict(hradius=2, hpasses=1, vradius=2, vpasses=1, planes=[0])
# Use "planes"
clip = core.std.BlankClip(None, 1920, 1080, YUV444PS, 2000, keep=1)
clip = core.std.BoxBlur(clip, **args)
clip.set_output()
# Time elapsed: 0:27.135 - 73.70663065422803583715 FPS
# Split to Gray
clip_yuv = core.std.BlankClip(None, 1920, 1080, YUV444PS, 2000, keep=1)
clip = core.std.ShufflePlanes(clip_yuv, 0, GRAY)
clip = core.std.BoxBlur(clip, **args)
clip = core.std.ShufflePlanes([clip, clip_yuv], [0,1,2], YUV)
clip.set_output()
# Time elapsed: 0:11.011 - 181.64144952606065430700 FPS
The difference isnt as evident with 8 bit though:
Time elapsed: 0:05.794 - 345.20685825648109812391 FPS (split to gray)
Time elapsed: 0:07.107 - 281.39460754565209299471 FPS (use "planes")
PS sry for being lazy and taking like a week to do it :^)
Edit: Rather than also being 73fps like the "use planes" test, changing it to planes=[0,1,2] is actually only about 63fps. PPS I used R41-RC1
Myrsloik
31st December 2017, 18:27
About the BoxBlur thing, there's still a pretty big difference
#Main
from vapoursynth import core, GRAY, YUV, YUV444PS
args = dict(hradius=2, hpasses=1, vradius=2, vpasses=1, planes=[0])
# Use "planes"
clip = core.std.BlankClip(None, 1920, 1080, YUV444PS, 2000, keep=1)
clip = core.std.BoxBlur(clip, **args)
clip.set_output()
# Time elapsed: 0:27.135 - 73.70663065422803583715 FPS
# Split to Gray
clip_yuv = core.std.BlankClip(None, 1920, 1080, YUV444PS, 2000, keep=1)
clip = core.std.ShufflePlanes(clip_yuv, 0, GRAY)
clip = core.std.BoxBlur(clip, **args)
clip = core.std.ShufflePlanes([clip, clip_yuv], [0,1,2], YUV)
clip.set_output()
# Time elapsed: 0:11.011 - 181.64144952606065430700 FPS
The difference isnt as evident with 8 bit though:
Time elapsed: 0:05.794 - 345.20685825648109812391 FPS (split to gray)
Time elapsed: 0:07.107 - 281.39460754565209299471 FPS (use "planes")
PS sry for being lazy and taking like a week to do it :^)
Edit: Rather than also being 73fps like the "use planes" test, changing it to planes=[0,1,2] is actually only about 63fps. PPS I used R41-RC1
Sigh, you're right. I forgot to do the last optimization in the code so all planes are transposed even if no blurring is done to them. Will fix it since it will give nice speedups in many scripts...
Myrsloik
6th January 2018, 22:04
R41 RC2 (https://www.dropbox.com/s/x9lso79z2b6bszz/VapourSynth-R41-RC2.exe?dl=1)
Should fix BoxBlur not copying planes the fastest possible way. Otherwise no real changes from RC1. So test BoxBlur a bit to verify that I got it right.
Myrsloik
9th January 2018, 20:09
R41 released. The usual post about it (http://www.vapoursynth.com/2018/01/r41-less-leaking/). Have fun with less shitty alpha support.
poisondeathray
10th January 2018, 07:53
It’s now possible to pass a second alpha clip to set_output() in scripts and vspipe will output it.
How exactly is the vspipe output for alpha supposed to work ?
How about a solution like this:
clip.set_output(alpha=alpha_clip)
And then it'd be output as GBRAP. Or something like that, thoughts?
Is it like this ?
clip[0].set_output(alpha=clip[1])
vspipe --info reports RGB24
What exactly is COMPATBGR32 ? I know it's for legacy purposes, sometimes RGB flip , but does it carry a valid alpha or is it a "dummy" alpha ? or something completely different. I figured it was remotely similar to "RGB32" in avsiynth-ese
Myrsloik
10th January 2018, 10:56
How exactly is the vspipe output for alpha supposed to work ?
Is it like this ?
clip[0].set_output(alpha=clip[1])
vspipe --info reports RGB24
What exactly is COMPATBGR32 ? I know it's for legacy purposes, sometimes RGB flip , but does it carry a valid alpha or is it a "dummy" alpha ? or something completely different. I figured it was remotely similar to "RGB32" in avsiynth-ese
It works like you guessed. If you check the info output from vspipe it also says "alpha: yes" or something similar.
Compatbgr32 is simply packed bgra with dummy alpha. It only exists for avisynth compatibility reasons.
dipje
10th January 2018, 12:18
maybe asking is faster than trying it later tonight:
Is the 'b64a' packing of RGB64 now also working with alpha? Or is it a dummy alpha, the same is in the compatbgr32 mode?
Myrsloik
10th January 2018, 12:23
maybe asking is faster than trying it later tonight:
Is the 'b64a' packing of RGB64 now also working with alpha? Or is it a dummy alpha, the same is in the compatbgr32 mode?
No, as I wrote it's only in vspipe for now. So only planar output like GBRAPX and YUVAPX will work. If enough people request it I guess I could extend it to avfs and vfw too. The compat formats will be removed some day when I make a major api revision so don't expect improvements to those ever.
Oh an one more quirk, far from all the common FOURCCs even have alpha so in those case setting an alpha output clip would have inconsistent results. And then there's v210 with 2 bits of alpha...
poisondeathray
10th January 2018, 16:27
It works like you guessed. If you check the info output from vspipe it also says "alpha: yes" or something similar.
This is the official R41 x64 ; vspipe --info reports no alpha (but clip[0] and clip[1] are valid separately)
Width: 1280
Height: 720
Frames: 90
FPS: 24/1 (24.000 fps)
Format Name: RGB24
Color Family: RGB
Sample Type: Integer
Bits: 8
SubSampling W: 0
SubSampling H: 0
Myrsloik
10th January 2018, 16:54
This is the official R41 x64 ; vspipe --info reports no alpha (but clip[0] and clip[1] are valid separately)
Width: 1280
Height: 720
Frames: 90
FPS: 24/1 (24.000 fps)
Format Name: RGB24
Color Family: RGB
Sample Type: Integer
Bits: 8
SubSampling W: 0
SubSampling H: 0
You're using an old vspipe. Maybe old other stuff too. R41 always has a line with Alpha: yes/no
poisondeathray
10th January 2018, 17:41
You're using an old vspipe. Maybe old other stuff too. R41 always has a line with Alpha: yes/no
I know stuff is moving fast, but it's from yesterday :)
Dated 2018-01-09
R41 from official
https://github.com/vapoursynth/vapoursynth/releases
, or should I go back to RC ?
EDIT: you are right . I messed up vspipe versions, called the wrong one
So if it passes to the alpha, how do you use it with something like ffmpeg ? can I pipe rawvideo and specify the arguments in ffmpeg (since yuv4mpegpipe won't work)
Myrsloik
10th January 2018, 17:45
I know stuff is moving fast, but it's from yesterday :)
Dated 2018-01-09
R41 from official
https://github.com/vapoursynth/vapoursynth/releases
, or should I go back to RC ?
Just delete all copies of vspipe.exe and reinstall. I checked again and you're definitely using an older exe.
poisondeathray
10th January 2018, 17:53
^ Yes, you're right .I edited my post. Can you answer the 2nd question please ?
What -pix_fmt in ffmpeg ? Or can you show a usage example ?
poisondeathray
10th January 2018, 17:56
Ok , it's -pix_fmt gbrap ; apparently GBRAP (caps) doesn't work
Everything working now
Usage example for piping 8bit RGB with alpha to ffmpeg to write out a PNG sequence (in case other ppl get stuck)
#clip[0].set_output(alpha=clip[1]) #alpha clip specified in script
#since it's a rawvideo pipe, you need to specify dimensions, frame rate (I guess not for image sequence, but left it in for completeness in case you're writing an RGBA video), pixel format
vspipe script.vpy - | ffmpeg -f rawvideo -pix_fmt gbrap -s 1280x720 -r 24 -i - -c:v png -an -start_number 0 output%03d.png
dipje
10th January 2018, 18:13
I compiled r41 on Mac osx . I have a weird thing I didn't have with r40: vspipe keeps 'hanging' at the end of a video.
Instead of exiting and letting ffmpeg (I'm piping y4m yuv444p10 and plain rgb30 into ffmpeg) finish graceful, it just sits there doing nothing.
In vsedit when I try (benchmark) the script, it gives warnings at the end that it can't read all the frames.
But it did this in r40 as well and didn't have try hanging vspipe issue.
Source is a .webm from YouTube with ffms2000. I tried pulling the latest master from the ffms2000 branch and compiled it, but no luck.
Am I the only one ? If so, I'll dig a bit deeper if it's vapoursynth, the Mac, the source filter or the source :).
poisondeathray
10th January 2018, 18:49
I compiled r41 on Mac osx . I have a weird thing I didn't have with r40: vspipe keeps 'hanging' at the end of a video.
Instead of exiting and letting ffmpeg (I'm piping y4m yuv444p10 and plain rgb30 into ffmpeg) finish graceful, it just sits there doing nothing.
In vsedit when I try (benchmark) the script, it gives warnings at the end that it can't read all the frames.
But it did this in r40 as well and didn't have try hanging vspipe issue.
Source is a .webm from YouTube with ffms2000. I tried pulling the latest master from the ffms2000 branch and compiled it, but no luck.
Am I the only one ? If so, I'll dig a bit deeper if it's vapoursynth, the Mac, the source filter or the source :).
This works for me OK to completion on a random YT VP9 webm . Upscaled to format=vs.YUV444P10. ffms2000 test8 . Win8 x64. R41
Did you try another webm? maybe problem with that specific one ?
hydra3333
13th January 2018, 23:13
R41 released. The usual post about it (http://www.vapoursynth.com/2018/01/r41-less-leaking/). Have fun with {} alpha support.
Thank you.
hydra3333
13th January 2018, 23:14
Using Vapoursynth to try to process a UHD video
script is
error report
Error Video encoding using NVEnc 3.23 (1.7.0.4)
Video encoding using NVEnc 3.23 failed with exit code: -1073741819 (0xC0000005)
The exit code might be a system error code: The instruction at 0xp referenced memory at 0xp. The memory could not be s.
------------------- Video encoding using NVEnc 3.23 -------------------
"C:\Program Files (Portable)\StaxRip\Apps\NVEnc\NVEncC64.exe" --vbrhq 38400 --codec h265 --preset quality --level 5.1 --output-depth 10 --weightp --ref 5 --gop-len 24 --lookahead 32 --qp-init 1 --max-bitrate 38400 --vbr-quality 25 --aq --cuda-schedule auto --colormatrix bt2020nc --colorprim bt2020 --transfer smpte2084 --mv-precision q-pel --cabac -i "W:\TEMP\KONG SKULL ISLAND_temp\KONG SKULL ISLAND.vpy" -o "W:\TEMP\KONG SKULL ISLAND_temp\KONG SKULL ISLAND_out.h265"
StaxRip.ErrorAbortException: Video encoding using NVEnc 3.23 failed with exit code: -1073741819 (0xC0000005)
The exit code might be a system error code: The instruction at 0xp referenced memory at 0xp. The memory could not be s.
------------------- Video encoding using NVEnc 3.23 -------------------
"C:\Program Files (Portable)\StaxRip\Apps\NVEnc\NVEncC64.exe" --vbrhq 38400 --codec h265 --preset quality --level 5.1 --output-depth 10 --weightp --ref 5 --gop-len 24 --lookahead 32 --qp-init 1 --max-bitrate 38400 --vbr-quality 25 --aq --cuda-schedule auto --colormatrix bt2020nc --colorprim bt2020 --transfer smpte2084 --mv-precision q-pel --cabac -i "W:\TEMP\KONG SKULL ISLAND_temp\KONG SKULL ISLAND.vpy" -o "W:\TEMP\KONG SKULL ISLAND_temp\KONG SKULL ISLAND_out.h265"
at StaxRip.Proc.Start() in D:\Projekte\VS\VB\StaxRip\General\Proc.vb:line 338
at StaxRip.NVEnc.Encode() in D:\Projekte\VS\VB\StaxRip\Encoding\NVEnc.vb:line 82
at StaxRip.GlobalClass.ProcessVideo() in D:\Projekte\VS\VB\StaxRip\General\GlobalClass.vb:line 225
at System.Threading.Tasks.Parallel.<>c__DisplayClass4_0.<Invoke>b__0()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at StaxRip.GlobalClass.ProcessJob(String jobPath) in D:\Projekte\VS\VB\StaxRip\General\GlobalClass.vb:line 137
If I run
Through the command line The error is Vapoursynth failed to open input file
Any ideas?
No, not me :) I wonder, does it work under r41 ?
gonca
14th January 2018, 00:16
No, not me :) I wonder, does it work under r41 ?
Version of NVEncC was the problem
Versions after the one I was using work fine
hydra3333
14th January 2018, 00:44
OK, thank gonca. Not a Vs related issue then.
Myrsloik
14th January 2018, 19:05
R42 RC1 (https://www.dropbox.com/s/s5cfxesyd2hat0j/VapourSynth-R42-RC1.exe?dl=1)
R42 RC1 this soon because of a regression that makes player integration like mpv fail. Report if it works or not.
r42:
updated to zimg v2.7.1
vapoursynth.dll is now simply symlinked into the python directory, makes it less confusing to replace the dll since there's only one real copy
fixed regression introduced in r41 that would make setting a node using vsscript_setvariable silently fail
resize no longer pointlessly copies frames when no processing is needed (that dude)
optimized transpose filter even more (that dude)
Myrsloik
15th January 2018, 19:59
R42 released. No changes from RC1.
AzraelNewtype
17th January 2018, 00:19
Since somebody still hasn't pointed this out, there's also a R42.1, which most certainly has changed from RC1.
no1d
18th January 2018, 17:41
Is get_output returns two nodes now?
Myrsloik
18th January 2018, 18:22
Is get_output returns two nodes now?
Yes, it returns a tuple of main video and alpha
Myrsloik
21st January 2018, 14:10
R43 RC1 (https://www.dropbox.com/s/y5bgk59jmrqwktw/VapourSynth-R43-RC1.exe?dl=1)
r43:
updated to zimg v2.7.2
fixed a possible hang on error in vspipe, regression introduced with the alpha support in r41
Go test it. Not much changed but should fix all serious issues reported.
kolak
25th January 2018, 13:19
It does work better now.
hydra3333
26th January 2018, 04:03
Thank you Myrsloik, for your great work.
Myrsloik
26th January 2018, 13:14
R43-RC2 (https://www.dropbox.com/s/hlg298urritog5j/VapourSynth-R43-RC2.exe?dl=1)
r43:
updated to zimg v2.7.2
a tuple is now only returned from get_output in python when alpha actually exist, this undoes the python syntax change in r41
fixed a possible hang on error in vspipe, regression introduced with the alpha support in r41
Second and probably final RC. Should restore the final stuff broken in R41. Go test it.
feisty2
26th January 2018, 15:05
I wanna remove useless samples in my training set, the ones that don't have enough high frequency components
lemme rephrase that, after I extracted the high frequency components from each frame, I wanna remove frames whose standard deviation is below a certain threshold, and record which frames were removed in a log file, then read the log file and remove the same frames in another sequence, how do I do that?
WolframRhodium
26th January 2018, 16:20
remove frames whose standard deviation is below a certain threshold, and record which frames were removed in a log file, then read the log file and remove the same frames in another sequence
The following method is 2-pass:
1st pass:
mvf.PlaneStatistics (https://github.com/HomeOfVapourSynthEvolution/mvsfunc/blob/master/mvsfunc.py#L1200-L1318) shows the method of calculating the std.
A Python list can be created outside the runtime function, then once the std of each frame inside the runtime function is calculated, the list is used to store the label.
The std of the whole video can be calculated via vspipe or simply vsedit's benchmark.
And then the list is stored in the disk.
2nd pass:
core.std.DeleteFrames (http://www.vapoursynth.com/doc/functions/deleteframes.html) can be used to delete those frames after reading the list.
lansing
26th January 2018, 18:14
I wanna remove useless samples in my training set, the ones that don't have enough high frequency components
lemme rephrase that, after I extracted the high frequency components from each frame, I wanna remove frames whose standard deviation is below a certain threshold, and record which frames were removed in a log file, then read the log file and remove the same frames in another sequence, how do I do that?
Are you doing the write and read log in one script.
poisondeathray
26th January 2018, 18:19
how are you extracting / measuring / distinguishing between what is a "high frequency component" ?
feisty2
26th January 2018, 18:31
The following method is 2-pass:
1st pass:
mvf.PlaneStatistics (https://github.com/HomeOfVapourSynthEvolution/mvsfunc/blob/master/mvsfunc.py#L1200-L1318) shows the method of calculating the std.
A Python list can be created outside the runtime function, then once the std of each frame inside the runtime function is calculated, the list is used to store the label.
The std of the whole video can be calculated via vspipe or simply vsedit's benchmark.
And then the list is stored in the disk.
2nd pass:
core.std.DeleteFrames (http://www.vapoursynth.com/doc/functions/deleteframes.html) can be used to delete those frames after reading the list.
seems like a lot of trouble but... gonna try it
I hate coding
feisty2
26th January 2018, 18:32
Are you doing the write and read log in one script.
one script or separate scripts, either way works for me long as its simple enough
feisty2
26th January 2018, 18:41
how are you extracting / measuring / distinguishing between what is a "high frequency component" ?
u run a high pass filter (low pass filter + make dif) on ur clip and extract the high frequency components, it doesn't have to be extra accurate, I'm just removing useless image blocks from my super resolution neural net training set, image blocks without clear edges or fine details or textures are obviously garbage data to super resolution, they are doing nothing but wasting my training time, after u extracted the high frequencies, u calculate the standard deviation or the absolute or squared sum of the high frequencies to determine if a certain sample has enough amount of high frequencies for super resolution or not
lansing
26th January 2018, 19:58
Don't post attachment, admins are all dead, nobody will approve it.
LigH
26th January 2018, 21:28
If it is short, use the CODE bbCode block; if it is longer, use any pastebin service (many have syntax highlighting for programming languages).
I am sure Wikipedia once had a comparison chart of such services, but it seems to be gone.
lansing
27th January 2018, 00:40
A Python list can be created outside the runtime function, then once the std of each frame inside the runtime function is calculated, the list is used to store the label.
Looping through every frame of the video to store the frame property into a list has a huge time issue.
filter_list = [] # list to store hi freq frame numbers
for frame in clip.frames():
frame_std = frame.props['PlaneSTD']
frame_num = frame.props['FrameNum']
if frame_std > 0.0031: # std threshold
if frame_num not in filter_list:
filter_list.append(frame_num)
My loop here took about 5 minutes to instantiate on a 720p 24 minutes video.
WolframRhodium
27th January 2018, 01:39
Looping through every frame of the video to store the frame property into a list has a huge time issue.
filter_list = [] # list to store hi freq frame numbers
for frame in clip.frames():
frame_std = frame.props['PlaneSTD']
frame_num = frame.props['FrameNum']
if frame_std > 0.0031: # std threshold
if frame_num not in filter_list:
filter_list.append(frame_num)
My loop here took about 5 minutes to instantiate on a 720p 24 minutes video.
Try the runtime function
filter_list = []
def _PlaneStd(n, f, clip):
frame_std = frame.props['PlaneSTD']
if frame_std > 0.0031:
filter_list.append(str(n))
if n == clip.num_frames - 1:
outFile = open('a.txt', 'w+')
outFile.write('{}'.format("".join(filter_list)))
return clip
clip = core.std.FrameEval(clip functools.partial(_PlaneStd, clip=clip), prop_src=clip)
or maybe the bottleneck is at file reading?
Myrsloik
27th January 2018, 01:43
I'm not sure that script will always work properly. Frames can be (and commonly are) processed out of order. Just saying...
Since we're on the subject I'm planning to add support for writing frame properties to a file in vspipe. Unfortunately for you I didn't get around to implementing it yet. Also, using get_frame() in python is always slow, it basically forces single threading.
lansing
27th January 2018, 03:01
Try the runtime function
filter_list = []
def _PlaneStd(n, f, clip):
frame_std = frame.props['PlaneSTD']
if frame_std > 0.0031:
filter_list.append(str(n))
if n == clip.num_frames - 1:
outFile = open('a.txt', 'w+')
outFile.write('{}'.format("".join(filter_list)))
return clip
clip = core.std.FrameEval(clip functools.partial(_PlaneStd, clip=clip), prop_src=clip)
or maybe the bottleneck is at file reading?
I thought it was a bad practice to mutate data that was outside the scope of a standalone function.
feisty2
28th January 2018, 04:38
well thank u all, I got it worked out alright now
Myrsloik
29th January 2018, 20:43
R43 RC4 (https://www.dropbox.com/s/k62zsj96ndqq1cz/VapourSynth-R43-RC4.exe?dl=1)
One final RC (for real this time) since many small nitpicky things were discovered.
r43:
updated to zimg v2.7.2
all vsscript functions are now internally guarded by a mutex to make them threadsafe
changed boxblur defaults to hradius and vradius=1, this makes more sense than having it throw an error with default arguments
added xyz as an alias for st428 in resize
add vsscript_getvsapi2 function which takes the required vapoursynth api version into account
a tuple is now only returned from get_output in python when alpha actually exist, this undoes the python syntax change in r41
fixed a possible hang on error in vspipe, regression introduced with the alpha support in r41
monohouse
31st January 2018, 11:33
hi I just installed (on windows) vapor R42.1 with python but no matter how I do it I always get the error:
c:\Program Files (x86)\Python36-32>VSPipe.exe --info G:\test.vpy -
Failed to initialize VapourSynth environment
python is installed, I had both 32 and 64, I also tried to use the portable vapor - it give the same error
Myrsloik
31st January 2018, 11:34
hi I just installed (on windows) vapor R42.1 with python but no matter how I do it I always get the error:
c:\Program Files (x86)\Python36-32>VSPipe.exe --info G:\test.vpy -
Failed to initialize VapourSynth environment
python is installed, I had both 32 and 64, I also tried to use the portable vapor - it give the same error
Let me guess, you didn't install all windows updates...
monohouse
31st January 2018, 11:37
it windows 7 SP1
Myrsloik
31st January 2018, 11:38
it windows 7 SP1
With all updates installed?
monohouse
31st January 2018, 11:50
with none updates installed :x no wait...platform update installed and directx11 update also installed, manually
but to what update are you refering ? I can dunlawd him and install him manually
KB976932 ?
Myrsloik
31st January 2018, 20:58
with none updates installed :x no wait...platform update installed and directx11 update also installed, manually
but to what update are you refering ? I can dunlawd him and install him manually
KB976932 ?
I don't remember exactly. Unpatched windows 7 isn't supported, it's that simple.
Myrsloik
31st January 2018, 20:58
R43 released (http://www.vapoursynth.com/2018/01/r43-cleaning-up-the-remaining-mess-from-r41/).
monohouse
1st February 2018, 15:44
ok I floted this bote :)
but still need some help, what's this meens ?
C:\VapourSynth\core64>vspipe.exe --info W:\test.vpy -
Failed to retrieve output node. Invalid index specified?
Myrsloik
1st February 2018, 15:49
ok I floted this bote :)
but still need some help, what's this meens ?
C:\VapourSynth\core64>vspipe.exe --info W:\test.vpy -
Failed to retrieve output node. Invalid index specified?
You probably forgot set_output() in your test script.
monohouse
1st February 2018, 17:04
I got it all working :)
thank for fast reply
thank for help
most important: thank for vaporsynth :)
hydra3333
2nd February 2018, 03:59
R43 released (http://www.vapoursynth.com/2018/01/r43-cleaning-up-the-remaining-mess-from-r41/).
By reading the handy instructions, I got a successfully completed build using the latest vs2017 with latest python and avisynth from git and zimg from git and vapoursynth from git with a small mod to AvsCompat (although it somewhere mentioned "RC2" as a version, so I hope I haven't stuffed it up).
Thank you for your great work.
monohouse
2nd February 2018, 11:16
if I wanne load into vapor raw YV12 file, I use avisource to do it ?
ChaosKing
2nd February 2018, 11:23
I don't think it will work, but there is https://github.com/chikuzen/vsrawsource
Binary: https://forum.doom9.org/showthread.php?t=166075
Maybe ffms can also open raw files!?
monohouse
2nd February 2018, 11:44
he can't I tryed, I will test this one, thank :)
poisondeathray
2nd February 2018, 16:31
he can't I tryed, I will test this one, thank :)
vsrawsource works for me
Maybe problem with your file or script ?
Any error messages ? Post your script
LigH
2nd February 2018, 22:33
No, FFMS2 can't read raw YUV.
VS_Fan
3rd February 2018, 22:12
I remember having troubles some time ago reading raw video streams with vsrawsource. Then I managed to use ffmpeg and ffms2 as a workaround. Based on a limitation specified in ffms2 documentation: “Because of LAVF's demuxer, most raw streams […] will fail to work properly”, I used ffmpeg to generate a new file with the raw video inside an MKV container:
For 420p8 (rawvideo): ffmpeg -f rawvideo -vcodec rawvideo -pixel_format yuv420p -video_size <XXXxYYY> -framerate <num>:<den> -i <input_raw_yuv_420p8_file> -pix_fmt yuv420p -vcodec rawvideo -an <output_raw_yuv_420p8_file>.mkvFor 422p10 (v210): ffmpeg -f v210 -vcodec v210 -pixel_format yuv422p10le -video_size <XXXxYYY> -framerate <num>:<den> -i <input_raw_yuv_422p10_file> -pix_fmt yuv422p10le -vcodec v210 -an <output_raw_yuv_422p10_file>.mkv
After that, I could successfully use .ffms2.Source() to read those raw video streams contained in mkv
Myrsloik
8th February 2018, 11:48
Here's a build with updated zimg (https://www.dropbox.com/s/htfjbr08ldjzf25/VapourSynth-R43-fix1.exe?dl=1) as the only difference. It should fix crash issues on core 2 quad cpus. Everything else is unaffected.
Myrsloik
8th February 2018, 11:51
I remember having troubles some time ago reading raw video streams with vsrawsource. Then I managed to use ffmpeg and ffms2 as a workaround. Based on a limitation specified in ffms2 documentation: “Because of LAVF's demuxer, most raw streams […] will fail to work properly”, I used ffmpeg to generate a new file with the raw video inside an MKV container:
For 420p8 (rawvideo): ...
Raw is mostly in the sense no container AND uncompressed video format without sufficient headers. Basically things where width, height and format aren't stored so you'd need extra arguments to pass it along. By this definition not even y4m is raw.
Selur
8th February 2018, 17:38
@Myrsloik: Any change for a fixed portable 64bit version? :)
feisty2
8th February 2018, 18:04
I just ditched uncompressed raw recently, instead I switched to uncompressed TIFF sequence, it's still uncompressed but saves u from manually specifying the width, height, sample type, endianness and colorspace...
feisty2
8th February 2018, 18:34
something that makes uncompressed TIFF sequence a bit better than y4m is that it's a universal format and supported everywhere, numpy and scipy got native support for TIFF sequence and can convert it to a numpy array or memmap if the sequence is too large, uncompressed raw is also universally supported but like I just said, it requires u to specify a few things and that sucks, and y4m is pretty much unknown and generally not supported in programs other than a few encoding tools...
Myrsloik
8th February 2018, 23:05
@Myrsloik: Any change for a fixed portable 64bit version? :)
Maybe later. Report some more bugs so I'll have to make a full release...
cwk
9th February 2018, 03:27
Have the inpand and expand functions been ported to Vapoursynth? I'm looking to run a dehalo script on linux, so using the Avisynth repair dll is a no go.
WolframRhodium
9th February 2018, 04:26
Have the inpand and expand functions been ported to Vapoursynth? I'm looking to run a dehalo script on linux, so using the Avisynth repair dll is a no go.
inpand:
core.std.Minimum (http://www.vapoursynth.com/doc/functions/minimum_maximum.html#std.Minimum)
expand:
core.std.Maximum (http://www.vapoursynth.com/doc/functions/minimum_maximum.html#std.Maximum)
cwk
9th February 2018, 05:45
Many thanks Wolfram.
MonoS
9th February 2018, 21:35
If i need some quite big buffer (for 4k content about 100mb) in my plugin and don't want to allocate via malloc at every frame and instead allocate at filter instantiation, how can i do it?
TheFluff
9th February 2018, 22:50
If i need some quite big buffer (for 4k content about 100mb) in my plugin and don't want to allocate via malloc at every frame and instead allocate at filter instantiation, how can i do it?
Is the allocation actually slowing you down a lot? Have you benchmarked it?
Myrsloik
9th February 2018, 23:30
If i need some quite big buffer (for 4k content about 100mb) in my plugin and don't want to allocate via malloc at every frame and instead allocate at filter instantiation, how can i do it?
Make it parallelrequests. Allocate it once in the constructor. See if less parallelism even matters?
Selur
10th February 2018, 00:19
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/SourceFilter/FFMS2/ffms2.dll")
# Loading F:\TestClips&Co\files\Test-AC3-5.1.avi using FFMS2
clip = core.ffms2.Source(source="F:/TESTCL~1/files/TEST-A~1.AVI",cachefile="H:/Temp/avi_4a88093b3b83d19d00642a5a96b0af78_41.ffindex",format=vs.YUV420P8,alpha=False)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg")
# Making sure input color range is set to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# Loading F:\TestClips&Co\files\Subtitles\Appa 7 Arb done.ass using SubText
clip = core.sub.TextFile(clip=clip, file="F:/TestClips&Co/files/Subtitles/Appa 7 Arb done.ass", fontdir="G:/Hybrid/settings/fonts")
# adjusting output color from: RGB24 to YUV420P10 for x265Model (i420)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="470bg")
# Output
clip.set_output()
gives me:
Error getting the frame number 0:
Resize error: Resize error 3074: no path between colorspaces (2/2/2 => 5/2/2). May need to specify additional colorspace parameters.
Seems like I'm missing some additional colorspace parameters, but which?
Cu Selur
VS_Fan
10th February 2018, 01:40
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="470bg", matrix_in_s="470bg")
edit: or simply:
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10)
Selur
10th February 2018, 06:49
Thanks :)
MonoS
10th February 2018, 17:22
Is the allocation actually slowing you down a lot? Have you benchmarked it?
I can't quantify it precisely, but i guess about 5/10%
Make it parallelrequests. Allocate it once in the constructor. See if less parallelism even matters?
With ParallelRequests it's about 20% slower.
Stephen R. Savage
11th February 2018, 00:30
You can store the buffer per-thread. Allocate the buffer on first use.
std::map<std::thread::id, std::shared_ptr<void>> per_thread_buffer;
/* ... */ get_frame(/* ... */)
{
void *buf = per_thread_buffer[std::this_thread::get_id()].get();
// ...
}
You can also use VSAPI::newVideoFrame to allocate memory. The allocation is cached in the frame buffer pool.
/* ... */ get_frame(/* ... */, VSCore *core, VSAPI *vsapi)
{
const int buffer_size = /* ... */;
VSFrameRef *buf_frame = vsapi->newVideoFrame(vsapi->getFormatPreset(pfGray8, core), buffer_size, 1, nullptr, core);
void *buf = vsapi->getReadPtr(buf_frame, 0);
// ...
vsapi->freeFrame(buf_frame);
}
MonoS
11th February 2018, 11:49
You can store the buffer per-thread. Allocate the buffer on first use.
std::map<std::thread::id, std::shared_ptr<void>> per_thread_buffer;
/* ... */ get_frame(/* ... */)
{
void *buf = per_thread_buffer[std::this_thread::get_id()].get();
// ...
}
You can also use VSAPI::newVideoFrame to allocate memory. The allocation is cached in the frame buffer pool.
/* ... */ get_frame(/* ... */, VSCore *core, VSAPI *vsapi)
{
const int buffer_size = /* ... */;
VSFrameRef *buf_frame = vsapi->newVideoFrame(vsapi->getFormatPreset(pfGray8, core), buffer_size, 1, nullptr, core);
void *buf = vsapi->getReadPtr(buf_frame, 0);
// ...
vsapi->freeFrame(buf_frame);
}
i tried the first solution and i got about 5% of performance, thanks :D
kriNon
28th February 2018, 15:51
Could someone please explain how to get the OCR plugin working? Supposedly it's meant to be an included plugin, however my installation doesn't have any corresponding dll file. I've taken a look at five or so of the latest vapoursynth releases on github and none of them have included the dll for the ocr plugin.
Selur
28th February 2018, 17:37
1st time I hear of an ocr plugin for Vapoursynth,... :)
kriNon
1st March 2018, 02:15
Yeah, supposedly it exists according to: www.vapoursynth.com/doc/plugins/ocr.html
Can't find any documentation on getting it setup and working though as it doesn't seem to come with vapoursynth from what I can tell
Myrsloik
1st March 2018, 11:33
Yeah, supposedly it exists according to: www.vapoursynth.com/doc/plugins/ocr.html
Can't find any documentation on getting it setup and working though as it doesn't seem to come with vapoursynth from what I can tell
Nobody ever bothered to make a windows compile of it. That's mostly the problem. I'll poke someone and include it the next release.
Hrxn
14th March 2018, 01:10
Short question regarding the documentation:
From the Windows Portable Instructions
Simply decompress the portable VapourSynth archive into the Python dir and overwrite all existing files. Done.
You can also use the VapourSynth Editor by decompressing it into the same directory.
Extracting VapourSynth64-Portable-Rxx.7z to "Python dir", as in the directory of the Python system installation?
The usual default is XXXX\AppData\Local\Programs\Python\Python36
.. and the VapourSynth Editor should be extracted into this directory as well?
There isn't another way to do this? Without tampering with my Python install dir?
Selur
14th March 2018, 01:23
I use a portable Vapoursynth and Pyhton in Hybrid.
I downloaded the portable Vapoursynth and extracted the portable Python into the Vapoursynth folder, into which I also extracted vsedit, works all fine.
If you got a system wide Python installed no moving of the portable version or vsedit is required iirc.
Cu Selur
ChaosKing
18th March 2018, 19:57
I wrote a small "vs plugin loading checker" script and got some errors...
What does "No entry point found" mean exactly? CombMask should be a vs dll.
Error 193 means it's a 32Bit dll, correct?
Is it possible to not autoload all plugins when using get_core()?
#######################################
VapourSynth Video Processing Library
Copyright (c) 2012-2018 Fredrik Mellbin
Core R43
API R3.5
Options: -
#######################################
checking dlls in E:\PortableApps\VapourSynth\plugins64
#######################################
Failed to load E:\PortableApps\VapourSynth\plugins64\bilateralGPU.dll. GetLastError() returned 126. A DLL dependency is probably missing.
No entry point found in E:\PortableApps\VapourSynth\plugins64\CombMask.dll
No entry point found in E:\PortableApps\VapourSynth\plugins64\cudart64_80.dll
Failed to load E:\PortableApps\VapourSynth\plugins64\externalfilters.dll. GetLastError() returned 193.
No entry point found in E:\PortableApps\VapourSynth\plugins64\libfftw3-3.dll
No entry point found in E:\PortableApps\VapourSynth\plugins64\libfftw3f-3.dll
Failed to load E:\PortableApps\VapourSynth\plugins64\libIlmImf.dll. GetLastError() returned 126. A DLL dependency is probably missing.
No entry point found in E:\PortableApps\VapourSynth\plugins64\libiomp5md.dll
No entry point found in E:\PortableApps\VapourSynth\plugins64\libmfxsw64.dll
Plugin load failed, namespace focus already populated (E:\PortableApps\VapourSynth\plugins64\libtemporalsoften.dll)
No entry point found in E:\PortableApps\VapourSynth\plugins64\ReduceFlicker.dll
Failed to load E:\PortableApps\VapourSynth\plugins64\scenechange.dll. GetLastError() returned 193.
No entry point found in E:\PortableApps\VapourSynth\plugins64\svml_dispmd.dll
Failed to load E:\PortableApps\VapourSynth\plugins64\tc2cfr.dll. GetLastError() returned 193.
Failed to load E:\PortableApps\VapourSynth\plugins64\temporalsoften2.dll. GetLastError() returned 193.
No entry point found in E:\PortableApps\VapourSynth\plugins64\w2xc.dll
No entry point found in E:\PortableApps\VapourSynth\plugins64\XySubFilter.dll
#######################################
Found 103 dlls. Errors: 17
import sys, os, glob
import vapoursynth as vs
def print_version(core):
vs_version = core.version()
print('#######################################')
print(vs_version)
print('#######################################')
def main(argv):
if(len(sys.argv) > 1):
path = argv[1]
else:
exit("\n\rUsage: vs_plugin_check.py <path-to-vapoursynth-plugins-folder>\n\r")
core = vs.get_core()
print_version(core)
plugin_dir = glob.glob(path + '/*.dll')
print("checking dlls in", path)
print('#######################################')
error_count = 0
for dll in plugin_dir:
cnt += 1
try:
core.std.LoadPlugin(path=dll)
except Exception as e:
if "already loaded" not in str(e):
error_count += 1
print(e)
print('#######################################')
print("Found", len(plugin_dir), "dlls. Errors:", error_count)
print()
if __name__ == "__main__":
main(sys.argv)
Myrsloik
18th March 2018, 20:24
I wrote a small "vs plugin loading checker" script and got some errors...
What does "No entry point found" mean exactly? CombMask should be a vs dll.
Error 193 means it's a 32Bit dll, correct?
Is it possible to not autoload all plugins when using get_core()?
...
No entry point simply means the dll doesn't export a function named VapourSynthPluginInit (or it's stdcall mangled equivalent). It's simply not a VS plugin then. Note that unlike avisynth the entry point stuff has never changed...
Error code 193 can be found here
here (https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx). It's vague but probably corrupt file or not the correct bitness.
Autoloading will always be on. Don't put stuff in the folder if you don't want to use it. If you don't use it I'll taunt you and call you smelly.
ChaosKing
18th March 2018, 22:00
No entry point simply means the dll doesn't export a function named VapourSynthPluginInit (or it's stdcall mangled equivalent). It's simply not a VS plugin then. Note that unlike avisynth the entry point stuff has never changed...
Error code 193 can be found here
here (https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx). It's vague but probably corrupt file or not the correct bitness.
Autoloading will always be on. Don't put stuff in the folder if you don't want to use it. If you don't use it I'll taunt you and call you smelly.
After a long and thorough shower I pushed this script with some updates to github in case some one needs it: https://github.com/theChaosCoder/vapoursynth-plugin-check
#######################################
checking dlls in E:\PortableApps\VapourSynth\plugins64
#######################################
Errors:
-------
Failed to load E:\PortableApps\VapourSynth\plugins64\bilateralGPU.dll. GetLastError() returned 126. A DLL dependency is probably missing.
Failed to load E:\PortableApps\VapourSynth\plugins64\libIlmImf.dll. GetLastError() returned 126. A DLL dependency is probably missing.
Plugin load failed, namespace focus already populated (E:\PortableApps\VapourSynth\plugins64\libtemporalsoften.dll)
Errors: Not a VS-Plugin
-------
No entry point found in E:\PortableApps\VapourSynth\plugins64\CombMask.dll
No entry point found in E:\PortableApps\VapourSynth\plugins64\ReduceFlicker.dll
No entry point found in E:\PortableApps\VapourSynth\plugins64\XySubFilter.dll
Errors: incorrect bitness (32bit instead of 64bit) or corrupt file.
-------
Failed to load E:\PortableApps\VapourSynth\plugins64\externalfilters.dll. GetLastError() returned 193.
Failed to load E:\PortableApps\VapourSynth\plugins64\scenechange.dll. GetLastError() returned 193.
Failed to load E:\PortableApps\VapourSynth\plugins64\tc2cfr.dll. GetLastError() returned 193.
Failed to load E:\PortableApps\VapourSynth\plugins64\temporalsoften2.dll. GetLastError() returned 193.
Notices:
-------
cudart64_80.dll some dll for CUDA GPU stuff
libfftw3-3.dll is a dependency by fft3dfilter or mvtools-sf
libfftw3f-3.dll is a dependency by fft3dfilter or mvtools-sf
libiomp5md.dll is part of the Waifu2x-w2xc filter
libmfxsw64.dll is part of the DGMVCSourceVS filter
svml_dispmd.dll is part of the Waifu2x-w2xc filter
w2xc.dll is part of the Waifu2x-w2xc filter
#######################################
Found 103 dlls. Errors: 10 Notices: 7
Myrsloik
2nd April 2018, 21:01
R44-test1 (https://www.dropbox.com/s/ytt1gonb15lh9cq/VapourSynth-R44-test1.exe?dl=1)
Basically the only notable change is largepage support. Try it and see if it makes memory allocation when processing 4k material faster. To better compare it can be disabled by setting the environment variable VS_NO_LARGE_PAGES. Have fun...
hydra3333
3rd April 2018, 10:50
Thank you.
Selur
7th April 2018, 05:35
Small question, how can I check whether either: 'core.nnedi3.nnedi3' or 'core.znedi3.nnedi3' is available.
Background: I want to adjust a bunch of scripts (like havsfunc.py) to only use 'core.znedi3.nnedi3' in case it's available and use 'core.nnedi3.nnedi3' otherwise, since the OS X Installer currently has no znedi3 (same for eedi3m).
Cu Selur
Selur
7th April 2018, 05:58
Thanks! :)
Selur
7th April 2018, 06:27
Thanks.
VS_Fan
7th April 2018, 07:27
Basically the only notable change is largepage support.You could be interested in this possible windows 10 system bug (https://sourceforge.net/p/sevenzip/discussion/45797/thread/e730c709/), reported by 7-Zip author and some 7-Zip users, causing system crashes and corruption when using large memory pages
Myrsloik
12th April 2018, 21:39
I'm disappointed, nobody benchmarked it? Do I really have to produce my own benchmarketing material?
Btw, the bug seems to be fixed in the spring creator's update so hopefully by the time R44 is released it won't really be a problem. I think the only other real improvements for R44 will be further tweaks to the memory pool. There have been surprisingly few bugs reported so far, only the poor core 2 quad users don't like R43...
LigH
12th April 2018, 22:57
benchmarketing
Freud likes that. :p
LigH
13th April 2018, 13:56
The only other application I remember having support for large pages is 7-zip.
Selur
15th April 2018, 06:25
So enabling large page support is a bad thing atm. :)
VS_Fan
15th April 2018, 19:35
Shouldn't Linux, macOS and Windows 10 v18.03 users be safe testing with Large Memory Pages? It would be nice to have any benchmarks from them.
Igor Pavlov (developer of 7-zip) posted (https://sourceforge.net/p/sevenzip/discussion/45797/thread/e730c709/#b240/0211) his findings and thoughts some 5 days ago
Myrsloik
15th April 2018, 19:36
Shouldn't Linux, macOS and Windows 10 v18.03 users be safe testing with Large Memory Pages? It would be nice to have any benchmarks from them.
Igor Pavlov (developer of 7-zip) posted (https://sourceforge.net/p/sevenzip/discussion/45797/thread/e730c709/#b240/0211) his findings and thoughts some 5 days ago
It's safe on all windows 10 versions. There's a workaround for the bug. Obviously D9 didn't bother to actually try it but instead went off and made stuff up...
VS_Fan
16th April 2018, 08:51
I’m on laptop with an intel core i5 4gen, 8GB RAM and windows 10 home edition (v18.03 = 10.0.16299.371), so no group policy editor for me. So I tried running vspipe in a command prompt with administrator rights to get LP working.
This are the results for the same vpy script provided by HolyWu: (vspipe.exe test.vpy .)
Vapoursynth R43: (No LP)
Output 500 frames in 37.62 seconds (13.29 fps)
Vapoursynth R44-test1, VS_NO_LARGE_PAGES set:
Output 500 frames in 40.75 seconds (12.27 fps)
Vapoursynth R44-test1, VS_NO_LARGE_PAGES not set:
Output 500 frames in 37.51 seconds (13.33 fps)
Vapoursynth R44-test1, VS_NO_LARGE_PAGES not set: (on an administrator command prompt)
Windows VirtualAlloc bug detected: page still mapped
Output 500 frames in 39.67 seconds (12.60 fps)
The time variations could be related to the antivirus scanning my external USB disk in the background
Myrsloik
16th April 2018, 09:21
I’m on laptop with an intel core i5 4gen, 8GB RAM and windows 10 home edition (v18.03 = 10.0.16299.371), so no group policy editor for me. So I tried running vspipe in a command prompt with administrator rights to get LP working.
This are the results for the same vpy script provided by HolyWu: (vspipe.exe test.vpy .)
Vapoursynth R43: (No LP)
Output 500 frames in 37.62 seconds (13.29 fps)
Vapoursynth R44-test1, VS_NO_LARGE_PAGES set:
Output 500 frames in 40.75 seconds (12.27 fps)
Vapoursynth R44-test1, VS_NO_LARGE_PAGES not set:
Output 500 frames in 37.51 seconds (13.33 fps)
Vapoursynth R44-test1, VS_NO_LARGE_PAGES not set: (on an administrator command prompt)
Windows VirtualAlloc bug detected: page still mapped
Output 500 frames in 39.67 seconds (12.60 fps)
The time variations could be related to the antivirus scanning my external USB disk in the background
I think your background tasks have a bigger effect than large pages at its best.
lansing
17th April 2018, 04:47
I find the wording of "VS_NO_LARGE_PAGES set/not set" confusing. I have to rethink a few times every time I read it because of the double negative.
foxyshadis
17th April 2018, 04:52
I’m on laptop with an intel core i5 4gen, 8GB RAM and windows 10 home edition (v18.03 = 10.0.16299.371), so no group policy editor for me. So I tried running vspipe in a command prompt with administrator rights to get LP working.
This are the results for the same vpy script provided by HolyWu: (vspipe.exe test.vpy .)
Vapoursynth R43: (No LP)
Output 500 frames in 37.62 seconds (13.29 fps)
Vapoursynth R44-test1, VS_NO_LARGE_PAGES set:
Output 500 frames in 40.75 seconds (12.27 fps)
Vapoursynth R44-test1, VS_NO_LARGE_PAGES not set:
Output 500 frames in 37.51 seconds (13.33 fps)
Vapoursynth R44-test1, VS_NO_LARGE_PAGES not set: (on an administrator command prompt)
Windows VirtualAlloc bug detected: page still mapped
Output 500 frames in 39.67 seconds (12.60 fps)
The time variations could be related to the antivirus scanning my external USB disk in the background
Almost all group policies are just regedits with airs, and work the same on Home once set: This one is HKEY_CURRENT_USER\System\CurrentControlSet\Policies DWORD SeLockMemoryPrivilege value 0x1. Reboot after setting.
ChaosKing
17th April 2018, 16:35
I just tried the 4k code snipped by HolyWu + PS code above and it is SLOW:
Output 1000 frames in 172.86 seconds (5.78 fps) | 15% CPU load :-/
With "$env:VS_NO_LARGE_PAGES = 1"
Output 1000 frames in 24.06 seconds (41.55 fps) | 75% CPU load
p.s. I have 16gb of ram.
ChaosKing
17th April 2018, 22:33
Now with core.max_cache_size = 32768
Output 1000 frames in 16.40 seconds (60.96 fps)
$env:VS_NO_LARGE_PAGES = 1
Output 1000 frames in 16.24 seconds (61.59 fps)
From 40 to 60fps, nice speed up! CPU load was 100% now.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.