Log in

View Full Version : Vapoursynth


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 [32] 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

8-BaLL
29th May 2015, 13:40
Alright, thanks. I will install and test it. I hope megui can handle vapoursynth scripts.

feisty2
1st June 2015, 14:56
will "rgvs" and std.Median have float point support someday?

Myrsloik
1st June 2015, 15:00
will "rgvs" and std.Median have float point support someday?

I guess so. At least the core functions where it makes sense. Honestly I see the future of removegrain as being chopped up into functions with names that make sense and maybe then I'll add floating point versions of that too.

Is there any particular reason you want to use floats?

feisty2
1st June 2015, 15:07
Is there any particular reason you want to use floats?

I'll output the final result as an uncompressed 32bpc float point TIFF sequence to minimize the precision loss, cuz I'll do some color grading after that, and color grading is famous for demanding precision :)

Myrsloik
1st June 2015, 15:09
I'll output the final result as an uncompressed 32bpc float point TIFF sequence to minimize the precision loss, cuz I'll do some color grading after that, and color grading is famous for demanding precision :)

Real professional stuff. I like that. Tell me which functions you need and I'll take a look at them at some point in the future (unfortunately for you I have plenty of real work stuff to do).

feisty2
1st June 2015, 15:19
dfttest (with float point), rawsource (with float point), luts/lutsx (guess 8bpc would be enough for them, cuz I only need them to create masks), eedi3 (with high bitdepth support, and SSE2 opt from cretindesalpes, nnedi3 is awesome as an upscaler, but just not the right tool to deinterlace)
edit: I don't know if you'll ever have time to do those above, but thx for vaporsynth anyway, it's awesometastic :)

foxyshadis
2nd June 2015, 10:12
Turns out my old request was a lot easier to accomplish than I thought; merely adding another line, <VS_FOLDER>\scripts, to vapoursynth.pth let me put all of the common scripts in that folder instead of polluting my relatively difficult to access Python folder.

jeremy33
11th June 2015, 20:57
Hello,

I use this PPA (https://launchpad.net/~djcj/+archive/ubuntu/vapoursynth) to install vapoursynth and some python scripts, like finesharp, on Ubuntu.
I'm in touch with djcj, the ppa maintainer, to allow the use of the python scripts without the need to make some /home config files like :

$ mkdir -p "${HOME}/.config/vapoursynth"
$ tee "${HOME}/.config/vapoursynth/vapoursynth.conf" << 'EOF'
UserPluginDir=/Path/To/filters/
EOF
- add to ~/.profile
export PYTHONPATH=$PYTHONPATH:/Path/To/filters/

The scripts are installed here "/usr/lib/python3/dist-packages/vapoursynth-scripts/".

Is it possible to do that and how ?

Maybe at the compile time we have to use something like that (http://www.vapoursynth.com/doc/autoloading.html#linux):

SystemPluginDir, whose default value is set at compile time to $libdir/vapoursynth, or to the location passed to the --with-plugindir argument to configure.

feisty2
13th June 2015, 09:24
rgvs mode13 and 14 are broken

Myrsloik
13th June 2015, 09:25
rgvs mode13 and 14 are broken

Broken how?

feisty2
13th June 2015, 09:29
Broken how?

the right half of the image looks like "interlaced" kinda stuff, I'm testing on Gray16 clips

feisty2
13th June 2015, 09:44
and mode15/16 are broken as well, same issue like 13/14

Myrsloik
13th June 2015, 11:24
and mode15/16 are broken as well, same issue like 13/14

You're right, and it only seems to happen with gray16 input. That's very odd...

Myrsloik
13th June 2015, 18:31
Here's just a R28 work in progress version (https://www.dropbox.com/s/wecntdf9xve68qc/vapoursynth-r28-test1.exe?dl=1) for you to try.

Changes:
fixed an image corruption bug with 9-16 bit input to rgvs when the c++ code is used
fixed division by zero issues in muldivrational in vshelper.h
blankclip can now create 0 (unknown/variable) fps clips
added float support to planedifference and planeaverage
added half support to addborders
relevant compile time options are now in the version string

feisty2
14th June 2015, 05:07
rgvs works okay now
good news

jeremy33
16th June 2015, 11:33
Is somebody have an idea ?
Hello,

I use this PPA (https://launchpad.net/~djcj/+archive/ubuntu/vapoursynth) to install vapoursynth and some python scripts, like finesharp, on Ubuntu.
I'm in touch with djcj, the ppa maintainer, to allow the use of the python scripts without the need to make some /home config files like :

$ mkdir -p "${HOME}/.config/vapoursynth"
$ tee "${HOME}/.config/vapoursynth/vapoursynth.conf" << 'EOF'
UserPluginDir=/Path/To/filters/
EOF
- add to ~/.profile
export PYTHONPATH=$PYTHONPATH:/Path/To/filters/

The scripts are installed here "/usr/lib/python3/dist-packages/vapoursynth-scripts/".

Is it possible to do that and how ?

Maybe at the compile time we have to use something like that (http://www.vapoursynth.com/doc/autoloading.html#linux):

SystemPluginDir, whose default value is set at compile time to $libdir/vapoursynth, or to the location passed to the --with-plugindir argument to configure.

Are_
16th June 2015, 13:11
Sincerely, I fail to understand what is your problem.

jeremy33
16th June 2015, 15:51
We simply try to install vapoursynth and some python scripts, like finesharp, on Ubuntu with this PPA (https://launchpad.net/~djcj/+archive/ubuntu/vapoursynth) and we want to make these scripts (eg. finesharp) works "out of the box".
At the moment Vapoursynth doesn't find the scripts and we need to make some config files after the install to make them work.

This is what I need to use after the install :

$ mkdir -p "${HOME}/.config/vapoursynth"
$ tee "${HOME}/.config/vapoursynth/vapoursynth.conf" << 'EOF'
UserPluginDir=/Path/To/filters/
EOF
- add to ~/.profile
export PYTHONPATH=$PYTHONPATH:/Path/To/filters/

So the question is how can we tell to Vapoursynth where the scripts are without the need of some config files after the install ?

sl1pkn07
16th June 2015, 18:35
install in the python3 sites-package

python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())" for get the path

example for Arch https://aur4.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vapoursynth-plugin-finesharp-git

jeremy33
16th June 2015, 20:07
Thank you I will try

kaefert
16th June 2015, 22:30
I have a long vapoursynth script working on many videos resulting in a clip "sum" with RGB48 colorspace.

I want to output yuv 10bit to ffmpeg to encode as x265 mp4.

previously, I converted my RGB48 clip to YUV16 like that:

c=core.fmtc.matrix (clip=sum, mat="601", col_fam=vs.YUV, bits=16)
c=core.fmtc.resample (clip=c, css="420")
c.set_output()

but now the core.fmtc package is gone and the only replacement I could find is
core.resize.Bicubic(clip=sum, format=vs.YUV420P10) # vs.YUV420P16

but this does not seem to work: both P10 and P16 give this error:
$ "/cygdrive/c/Program Files (x86)/VapourSynth/core64/vspipe.exe" -y "join_prepared.vpy" -
YUV4MPEG2 C420 W3840 H2160 F0:0 Ip A0:0
[swscaler @ 00000015D3790020] gbrp16le is not supported as output pixel format
[swscaler @ 00000015D3790020] gbrp16le is not supported as output pixel format
[swscaler @ 00000015D379A020] gbrp16le is not supported as output pixel format
[swscaler @ 00000015D379A020] gbrp16le is not supported as output pixel format
[swscaler @ 00000015D379A020] gbrp16le is not supported as output pixel format
[swscaler @ 00000015D379A020] gbrp16le is not supported as output pixel format
[swscaler @ 00000015D379A020] gbrp16le is not supported as output pixel format
[swscaler @ 00000015CDE28020] gbrp16le is not supported as output pixel format
Error: Failed to retrieve frame 1 with error: Resize: context creation failed
Output 0 frames in 492.19 seconds (0.00 fps)

whats the correct way to do it, or do I need to step back to an older vapoursynth version still containing the core.fmtc package?

sneaker_ger
16th June 2015, 22:42
You can download fmtc here:
http://forum.doom9.org/showthread.php?t=166504

kaefert
17th June 2015, 09:53
thanks sneaker_ger!

now my next problem is: I have a ton of 16bit color-depth tif files, which all work fine to import into vapoursynth using the imwri.Read plugin, and turning up as clips in RGB48 format, just as I want them to.

But I have this one tif file, which looks just the same as all the others with all the tools I could think of like picture viewers, MediaInfo.exe and GIMP. But imported into Vapoursynth it results in a clip with the Format: Gray16

What could cause that? Or do I need to ask this question over there? http://forum.doom9.org/showthread.php?t=170981

UPDATE: strike that. I did not read MediaInfo.exe output exactly enough. color space of my problematic tif is "Y" instead of "RGB" as all the others. though I have no idea why it is a different color space, all have been created the same way by loading a JPG into imagemagick manipulating it a bit and exporting to a 16 bit tif file.

UPDATE2: okey, so it seems ImageMagick has decided based on the image content that RGB is not needed, and gray is enough. The image looked to me to have not only gray but also a little yellowish and redish taint, but maybe thats just my screen ;)
So I found I need to force ImageMagick to output an RGB color space TIF by using the option "-type truecolor"

Myrsloik
17th June 2015, 09:55
thanks sneaker_ger!

now my next problem is: I have a ton of 16bit color-depth tif files, which all work fine to import into vapoursynth using the imwri.Read plugin, and turning up as clips in RGB48 format, just as I want them to.

But I have this one tif file, which looks just the same as all the others with all the tools I could think of like picture viewers, MediaInfo.exe and GIMP. But imported into Vapoursynth it results in a clip with the Format: Gray16

What could cause that? Or do I need to ask this question over there? http://forum.doom9.org/showthread.php?t=170981

No idea. Does it work if you use the imagemagick commandline stuff to convert it?

kaefert
17th June 2015, 10:27
No idea. Does it work if you use the imagemagick commandline stuff to convert it?

sorry Myrsloik for causing this confusion. I've updated my previous post to reflect what I've found: I needed to force ImageMagick to write my tif with RGB color space using -type truecolor since apperantly this one picture only had gray pixels (althought to my eyes through my screen it looked like having a yellow and/or redish taint)

jeremy33
18th June 2015, 02:10
install in the python3 sites-package

python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())" for get the path

example for Arch https://aur4.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vapoursynth-plugin-finesharp-git
I didn't try yet but is there a "cleaner" way to do that because I think it's better to put all the scripts in a folder inside python3 dist-package (dist-package is for ubuntu) like "/usr/lib/python3/dist-packages/vapoursynth-scripts/" whereas to put them directly in "dist-packages".

sl1pkn07
18th June 2015, 05:39
https://github.com/vapoursynth/vapoursynth/issues/156

foxyshadis
18th June 2015, 07:22
Turns out my old request was a lot easier to accomplish than I thought; merely adding another line, <VS_FOLDER>\scripts, to vapoursynth.pth let me put all of the common scripts in that folder instead of polluting my relatively difficult to access Python folder.

I prefer autoloading from a subfolder of VS, Avisynth style, but you can arrange yours as you wish. I found that VS will overwrite vapoursynth.pth each install, so creating a new vs-scripts.pth was more reliable. These files all go in the site-packages folder. As soon as you do that, you can import the script without loading it.

Note that .pth files actually add their contained folders to the runtime path, not just the import path, if that affects anything you do.

feisty2
18th June 2015, 08:15
@Myrsloik
will you add float point support to core functions and rgvs in the next release?
if so, that means I get to process my vids again pretty soon, and I will decide to make peace with 16bits mvtools
if not, that means I still got a lot of time to mess with filters, then I will stick to mvtools modification

Myrsloik
18th June 2015, 11:07
I won't have time to change that much before the next release. So no.

jeremy33
18th June 2015, 17:06
install in the python3 sites-package

python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())" for get the path

example for Arch https://aur4.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vapoursynth-plugin-finesharp-git
I tried to install them in python3 dist-package and I have this error : "Instruction not allowed".
Do you know why ?

https://github.com/vapoursynth/vapoursynth/issues/156
Thank you, I hope it will be add.

sl1pkn07
18th June 2015, 17:32
I tried to install them in python3 dist-package and I have this error : "Instruction not allowed".
Do you know why ?

when install? when load (in vpy script)? when?


└───╼ python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
/usr/lib/python3.4/site-packages
└───╼ ls $(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")/fine*
-rw-r--r-- 1 root root 6927 jun 16 19:30 /usr/lib/python3.4/site-packages/finesharp.py


testcase

import vapoursynth as vs
core = vs.get_core()
import finesharp
clip = core.std.BlankClip(format=vs.YUV420P8)
clip = finesharp.sharpen(clip)
clip.set_output()



└───╼ vspipe prueba.vpy -y --info -
Width: 640
Height: 480
Frames: 240
FPS: 24/1 (24.000 fps)
Format Name: YUV444P8
Color Family: YUV
Bits: 8
SubSampling W: 0
SubSampling H: 0


EDITED: do'h, i'm still noob

jeremy33
18th June 2015, 21:30
python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
/usr/lib/python3/dist-packages

ls $(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")/fine*
/usr/lib/python3/dist-packages/finesharp.py

I have the error when I play a movie with mpv and, of course, vapoursynth :

mpv --vf-add=vapoursynth=/media/Data/vapoursynth.py "big buck bunny 480p h264.mkv"
Playing: big buck bunny 480p h264.mkv
(+) Video --vid=1 (h264)
Opening video filter: [vapoursynth file=/media/Data/vapoursynth.py]
Instruction non permise
"Instruction non permise" = "Instruction not allowed"

foxyshadis
18th June 2015, 22:53
So what's in your vapoursynth.py? Have you tested it (replacing video_in with an actual source filter) in vsedit? Have you asked for help from mpv devs?

jeremy33
19th June 2015, 00:13
MPV and Vapoursynth work perfectly if I use these config files after the installation of MPV and Vapoursynth from the ppa :

$ mkdir -p "${HOME}/.config/vapoursynth"
$ tee "${HOME}/.config/vapoursynth/vapoursynth.conf" << 'EOF'
UserPluginDir=/Path/To/filters/
EOF
- add to ~/.profile
export PYTHONPATH=$PYTHONPATH:/Path/To/filters/

I tested with a simple vapoursynth.py script like this one from sl1pkn07 but I have the same error

import vapoursynth as vs
core = vs.get_core()
import finesharp
clip = core.std.BlankClip()
clip = core.fmtc.matrix(clip, mat="709", col_fam=vs.YUV)
clip = finesharp.sharpen(clip)
clip.set_output()

I don't asked for help from MPV devs because it's a Vapoursynth "problem". I just want to use Vapoursynth with the python scripts like finesharp right after the install without the need of some config files after the install.
They manage to do it on Arch so it can be possible on Ubuntu.

sl1pkn07
19th June 2015, 05:51
works for me (edited my last post)

input.vpy

import vapoursynth as vs
core = vs.get_core()
clip = core.std.BlankClip(format=vs.YUV420P8)
clip.set_output()


filter.vpy

import vapoursynth as vs
import finesharp
core = vs.get_core()
clip = video_in
clip = finesharp.sharpen(clip)
clip.set_output()


http://wstaw.org/m/2015/06/19/Screenshot_20150619_064924.png

jackoneill
19th June 2015, 10:59
python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
/usr/lib/python3/dist-packages

ls $(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")/fine*
/usr/lib/python3/dist-packages/finesharp.py

I have the error when I play a movie with mpv and, of course, vapoursynth :

mpv --vf-add=vapoursynth=/media/Data/vapoursynth.py "big buck bunny 480p h264.mkv"
Playing: big buck bunny 480p h264.mkv
(+) Video --vid=1 (h264)
Opening video filter: [vapoursynth file=/media/Data/vapoursynth.py]
Instruction non permise
"Instruction non permise" = "Instruction not allowed"

Last time I tried to use one of the plugins from that PPA (fmtconv), it was compiled incorrectly. It was not suitable for distribution due to the use of AVX instructions in some code path that is supposed to run on any old CPU with SSE2, not just those that have AVX. The result is exactly the error message you got.

Here is how to check:

gdb --args mpv etc
run
[prints "Instruction non permise"]
set disassembly-flavor intel
disassemble
[hit enter until you see "=>" on the left next to the illegal instruction]

jeremy33
19th June 2015, 11:29
works for me (edited my last post)
Ok, little mistake ;) so I tried that and that works ! Thank you.

import vapoursynth as vs
import finesharp
core = vs.get_core()
clip = video_in
clip = finesharp.sharpen(clip)
clip.set_output()

Now if I use my script that still don't work and I think jackoneill is probably right.

Last time I tried to use one of the plugins from that PPA (fmtconv), it was compiled incorrectly. It was not suitable for distribution due to the use of AVX instructions in some code path that is supposed to run on any old CPU with SSE2, not just those that have AVX. The result is exactly the error message you got.
I run the gdb command and this is the error :

Program received signal SIGILL, Illegal instruction.
0x00007fffaeb57750 in vsutl::compute_fmt_mac_cst(double&, double&, VSFormat const&, bool, VSFormat const&, bool, int) () from /usr/lib/x86_64-linux-gnu/vapoursynth/libfmtconv.so

That's weird because Vapoursynth works if I use the config files after the install (mkdir -p "${HOME}/.config/vapoursynth" ...)

jackoneill
19th June 2015, 12:40
Maybe you have more than one copy of fmtconv.

jeremy33
19th June 2015, 12:53
That don't seem to be the case. I search on my entire drive and I only found one copy of fmtconv.

jeremy33
20th June 2015, 21:58
That works !

djcj now use the original Makefiles from "https://github.com/EleonoreMizo/fmtconv/tree/master/build/unix" to build fmtconv on the PPA.

Thank you very much

feisty2
24th June 2015, 10:22
http://i.imgur.com/ZV4LT6z.png
dunno why but vspipe failed to ouput "GrayS" clips, and preview in vseditor works good, so the vaporsynth core gotta be alright, guess it's a vspipe problem
did this on r28 test1

jackoneill
24th June 2015, 11:34
http://i.imgur.com/ZV4LT6z.png
dunno why but vspipe failed to ouput "GrayS" clips, and preview in vseditor works good, so the vaporsynth core gotta be alright, guess it's a vspipe problem
did this on r28 test1

What is the script?

feisty2
24th June 2015, 13:04
now it's freaking me out...
I removed my modified RGVS.dll and FLT.dll from plugin folder, and it just works, like suddenly, I mean, I didn't even call things from RGVS.dll or FLT.dll in the python script, that doesn't make any sense at all, how's that even possible? and even if I just call things from RGVS.dll/FLT.dll, preview in vseditor works perfectly without any problem, why?
anyways, script

import vapoursynth as vs
core = vs.get_core()

def nlmcleansef (src, local=2.4, nlocal=0.8):
core = vs.get_core ()
lflt = core.knlm.KNLMeansCL (src, d=0, a=24, s=1, h=local).knlm.KNLMeansCL (d=0, a=24, s=0, h=local)
ldif = core.std.MakeDiff (src, lflt).knlm.KNLMeansCL (d=0, a=2, s=4, h=local)
clip = core.std.MergeDiff (lflt, ldif).knlm.KNLMeansCL (d=0, a=24, s=4, h=nlocal)
return clip

clp = core.raws.Source("Y.rgb", 736, 480, src_fmt="GRAYS")
clp = nlmcleansef (clp)
clp.set_output ()

jackoneill
24th June 2015, 13:51
now it's freaking me out...
I removed my modified RGVS.dll and FLT.dll from plugin folder, and it just works, like suddenly, I mean, I didn't even call things from RGVS.dll or FLT.dll in the python script, that doesn't make any sense at all, how's that even possible? and even if I just call things from RGVS.dll/FLT.dll, preview in vseditor works perfectly without any problem, why?
anyways, script

import vapoursynth as vs
core = vs.get_core()

def nlmcleansef (src, local=2.4, nlocal=0.8):
core = vs.get_core ()
lflt = core.knlm.KNLMeansCL (src, d=0, a=24, s=1, h=local).knlm.KNLMeansCL (d=0, a=24, s=0, h=local)
ldif = core.std.MakeDiff (src, lflt).knlm.KNLMeansCL (d=0, a=2, s=4, h=local)
clip = core.std.MergeDiff (lflt, ldif).knlm.KNLMeansCL (d=0, a=24, s=4, h=nlocal)
return clip

clp = core.raws.Source("Y.rgb", 736, 480, src_fmt="GRAYS")
clp = nlmcleansef (clp)
clp.set_output ()


Memory corruption is funny like that. See if Visual Studio can tell you where it happens.

foxyshadis
25th June 2015, 04:22
Build everything in debug, especially VS. You'll find the culprit quickly enough.

feisty2
25th June 2015, 07:58
after failed to trace any error down in the code
I tried to compile the original removegrain code from the vaporsynth master branch
and the same vspipe crash showed it fucking unwanted self again.. :(
so the error actually comes from wrong compiling settings, what kind of special compiling parameter I gotta add to keep it from crashing?

feisty2
25th June 2015, 17:49
@Myrsloik
to find out what went wrong in float nnedi3 exactly, I decide to do something similar but somehow easier, adding 16bits support to eedi3
lucky me, I got the same problem here just like nnedi3
here are the differences between the original version and the incorrect 16bits version
https://github.com/IFeelBloated/eedi3/commit/d232f207e02dd53e8abf9c6261f729b7358694fa
some guide about what I did wrong, plz?
it might help me figure out what's the float nnedi3 problem and we'll have a high bitdepth eedi3 also :)

Myrsloik
25th June 2015, 18:16
@Myrsloik
to find out what went wrong in float nnedi3 exactly, I decide to do something similar but somehow easier, adding 16bits support to eedi3
lucky me, I got the same problem here just like nnedi3
here are the differences between the original version and the incorrect 16bits version
https://github.com/IFeelBloated/eedi3/commit/d232f207e02dd53e8abf9c6261f729b7358694fa
some guide about what I did wrong, plz?
it might help me figure out what's the float nnedi3 problem and we'll have a high bitdepth eedi3 also :)

I don't see anything obviously wrong in the code. You'll just have to step through it and see if something weird happens somewhere. Compare the behavior to the 8 bit version.

feisty2
26th June 2015, 05:34
aside from eedi3, I uninstalled r28 test1 and rolled back to r27, and vspipe crash is gone, it's somehow compatible to plugins compiled by vs2015 rc again...