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

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: